You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "gavin lee (JIRA)" <ji...@apache.org> on 2013/02/18 09:43:14 UTC

[jira] [Comment Edited] (CLOUDSTACK-1181) mvn deploy db failing with NPE

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-1181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13580492#comment-13580492 ] 

gavin lee edited comment on CLOUDSTACK-1181 at 2/18/13 8:43 AM:
----------------------------------------------------------------

Pull the latest code on master branch can pass the db initialization, not sure how it chooses interface to access db:

========> WARNING: Provided file does not exist: /Users/gavin_lee/projects/cs-apache/incubator-cloudstack/utils/conf/db.properties.override
========> Initializing database=cloud with host=localhost port=3306 username=cloud password=cloud
============> Running query: drop database if exists `cloud`
SQL exception in trying initDB: java.sql.SQLException: Access denied for user 'root'@'172.16.212.1' (using password: NO)


I have several nics presented, after grant privileges for above interface, the db initialization can be passed.

However, the devcloud still failed:
bash$mvn -pl developer,tools/devcloud -Ddeploydb -P developer -e

[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (create-schema) on project cloud-devcloud: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${db.cloud.port}"'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (create-schema) on project cloud-devcloud: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${db.cloud.port}"'.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${db.cloud.port}"'.
	at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:618)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 more

Variable ${db.cloud.port} could not be interpreted as 3306.
                
      was (Author: gavinlee):
    Pull the latest code on master branch can pass the db initialization, not sure how it chooses interface to access db:

========> WARNING: Provided file does not exist: /Users/gavin_lee/projects/cs-apache/incubator-cloudstack/utils/conf/db.properties.override
========> Initializing database=cloud with host=localhost port=3306 username=cloud password=cloud
============> Running query: drop database if exists `cloud`
SQL exception in trying initDB: java.sql.SQLException: Access denied for user 'root'@'172.16.212.1' (using password: NO)


I have several nics presented, after grant privileges for above interface, the db initialization can be passed.

However, the devcloud still failed:
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (create-schema) on project cloud-devcloud: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${db.cloud.port}"'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (create-schema) on project cloud-devcloud: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${db.cloud.port}"'.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${db.cloud.port}"'.
	at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:618)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 more

Variable ${db.cloud.port} could not be interpreted as 3306.

                  
> mvn deploy db failing with NPE
> ------------------------------
>
>                 Key: CLOUDSTACK-1181
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1181
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.1.0
>         Environment: Fresh CS 4.1.0 installation and db deployment
>            Reporter: Venkata Siva Vijayendra Bhamidipati
>            Assignee: Rohit Yadav
>             Fix For: 4.1.0
>
>
> The check for the encryption property in the db.properties file in Transaction.java calls into check() in EncryptionSecretKeyChecker.java, and that fails to find the db.properties file. It looks like the full path of the db.properties file (or the db.properties.override file) is not being sent to the check() function.
> This is the output (with exception stack) of the deploydb:
> [root@RichActon3-CC2 incubator-cloudstack]# mvn -e -P developer -pl developer -Ddeploydb
> [INFO] Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Apache CloudStack Developer Tools 4.1.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO]
> [INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (default) @ cloud-developer ---
> [INFO]
> [INFO] --- maven-remote-resources-plugin:1.3:process (default) @ cloud-developer ---
> [INFO]
> [INFO] --- maven-antrun-plugin:1.7:run (default) @ cloud-developer ---
> [INFO] Executing tasks
> main:
> [INFO] Executed tasks
> [INFO]
> [INFO] >>> exec-maven-plugin:1.2.1:java (create-schema) @ cloud-developer >>>
> [INFO]
> [INFO] <<< exec-maven-plugin:1.2.1:java (create-schema) @ cloud-developer <<<
> [INFO]
> [INFO] --- exec-maven-plugin:1.2.1:java (create-schema) @ cloud-developer ---
> [WARNING]
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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:159)
>         ... 6 more
> Caused by: java.lang.NullPointerException
>         at java.io.FileInputStream.<init>(FileInputStream.java:133)
>         at com.cloud.utils.crypt.EncryptionSecretKeyChecker.check(EncryptionSecretKeyChecker.java:65)
>         at com.cloud.utils.db.Transaction.<clinit>(Transaction.java:101)
>         ... 7 more
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 13.052s
> [INFO] Finished at: Wed Feb 06 13:19:28 PST 2013
> [INFO] Final Memory: 19M/47M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (create-schema) on project cloud-developer: An exception occured while executing the Java class. null: InvocationTargetException: ExceptionInInitializerError: NullPointerException -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (create-schema) on project cloud-developer: An exception occured while executing the Java class. null
>         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
>         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>         at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
>         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:616)
>         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
>         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
>         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
>         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. null
>         at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:352)
>         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
>         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
>         ... 19 more
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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:159)
>         ... 6 more
> Caused by: java.lang.NullPointerException
>         at java.io.FileInputStream.<init>(FileInputStream.java:133)
>         at com.cloud.utils.crypt.EncryptionSecretKeyChecker.check(EncryptionSecretKeyChecker.java:65)
>         at com.cloud.utils.db.Transaction.<clinit>(Transaction.java:101)
>         ... 7 more
> [ERROR]
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please read the following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> [root@RichActon3-CC2 incubator-cloudstack]#
> Workaround for now:
> Revert commit# b1d70f7fe340302f180843c01ee6674166d03ee1
> The fix would be to locate the db.properties file correctly in the call to enc.check();

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira