Hmm, it's different issue.
CS-1181 says NPE caused by db.properties not on classpath, this issue is a 
wrong db.properites file presenting in cloud-utils-4.1.0-SNAPSHOT-tests.jar.
CS-1181 is no harm as you can ignore the NPE and continue deploying db. The 
issue I encountered totally stops deploying db.
The problem is I don't know the intention of db.properites in 
cloud-utils-4.1.0-SNAPSHOT-tests.jar, otherwise I will delete it for a fix

> -----Original Message-----
> From: Vijayendra Bhamidipati
> Sent: Friday, February 08, 2013 4:21 PM
> To: Frank Zhang; cloudstack-dev@incubator.apache.org
> Subject: RE: can't deploydb on 4.1 branch, why don't you face it?
> 
> Hi Frank,
> 
> This issue is being tracked in
> https://issues.apache.org/jira/browse/CLOUDSTACK-1181 . The workaround
> is to comment out the code in Transaction.java that checks whether the
> db.properties file contains a parameter for encryption. It needs to be fixed -
> everyone deploying a fresh db will face the issue as of now. I haven't had the
> time to look into it yet but will do so at the first opportunity unless 
> someone
> fixes it before that.
> 
> Regards,
> Vijay
> 
> -----Original Message-----
> From: Frank Zhang [mailto:frank.zh...@citrix.com]
> Sent: Friday, February 08, 2013 3:52 PM
> To: cloudstack-dev@incubator.apache.org
> Subject: can't deploydb on 4.1 branch, why don't you face it?
> 
> 'mvn -P developer -pl developer -Ddeploydb' greets me below error:
> 
> [INFO]
> [INFO] --- exec-maven-plugin:1.2.1:java (create-schema) @ cloud-developer
> --- ========> WARNING: Provided file does not exist:
> /home/frank/dev/incubator-cloudstack/utils/conf/db.properties.override
> [WARNING]
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:616)
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
>         at java.lang.Thread.run(Thread.java:679)
> Caused by: java.lang.ExceptionInInitializerError
>         at com.cloud.upgrade.DatabaseCreator.main(DatabaseCreator.java:160)
>         ... 6 more
> Caused by: com.cloud.utils.exception.CloudRuntimeException: File
> db.properties not found
>         at
> com.cloud.utils.crypt.EncryptionSecretKeyChecker.check(EncryptionSecretK
> eyChecker.java:142)
>         at com.cloud.utils.db.Transaction.<clinit>(Transaction.java:101)
>         ... 7 more
> Caused by: java.io.FileNotFoundException:
> file:/home/frank/.m2/repository/org/apache/cloudstack/cloud-utils/4.1.0-
> SNAPSHOT/cloud-utils-4.1.0-SNAPSHOT-tests.jar!/db.properties (No such
> file or directory)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(FileInputStream.java:137)
>         at
> com.cloud.utils.crypt.EncryptionSecretKeyChecker.check(EncryptionSecretK
> eyChecker.java:65)
> 
> after looking into it, I think it's a bug that everyone would encounter, but 
> to
> my surprise it seems as if only I suffer it.
> 
> The cause is in EncryptionSecretKeyChecker.java
> 
>     @Override
>     public void check() {
>         //Get encryption type from db.properties
>         final File dbPropsFile = 
> PropertiesUtil.findConfigFile("db.properties");
>         final Properties dbProps = new Properties();
> 
>         ... ....
> 
> PropertiesUtil.findConfigFile will search file in classpath first, and
> unfortunately cloud-utils-4.1.0-SNAPSHOT-tests.jar does have db.properties
> packaged in it, then it's returned as the first match.
> As it's a file in JAR it can not be opened as ordinary file that why the
> exception happens.
> 
> I don't know why we have utils/conf/db.properties,  can anyone tell me its
> purpose? And does anyone else encountered this bug?

Reply via email to