[jboss-jira] [JBoss JIRA] Commented: (AS7-1015) Deployment fails with NullPointerException when installing JDBC Driver as a deployment
Tom Manning (JIRA)
jira-events at lists.jboss.org
Thu Jun 30 12:24:23 EDT 2011
[ https://issues.jboss.org/browse/AS7-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612056#comment-12612056 ]
Tom Manning commented on AS7-1015:
----------------------------------
The admin guide at [https://docs.jboss.org/author/display/AS7/DataSource+configuration] remains confusing as of right now. It says "As you can see the datasource references a driver by it's logical name." However, that's not the case. As far as I can tell there are two ways to deploy your JDBC driver: drop it into the {{deployments}} directory and make the <driver> element value equal to the jar's file name, or make it a "module" by creating a directory structure for it under {{modules}} and then have the <driver> element's value equal to... something else?
So according to the documentation as I understand it, I should be able to do this once I drop the jar into the {{deployments}} directory:
DS configuration in {{standalone.xml}} as follows:
{code:xml}
<datasource jndi-name="java:/demods" pool-name="demods" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>
jdbc:mysql://localhost:3306/demo
</connection-url>
<driver-class>
com.mysql.jdbc.Driver
</driver-class>
<driver>
mysql
</driver>
..
</datasource>
<drivers>
<driver name="mysql" module="com.mysql"/>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>
org.h2.jdbcx.JdbcDataSource
</xa-datasource-class>
</driver>
</drivers>
{code}
Yet in this case, the CLI gives me this:
{noformat}
[standalone at localhost:9999 /] /subsystem=datasources:installed-drivers-list
{
"outcome" => "success",
"result" => [
{
"driver-name" => "h2",
"deployment-name" => undefined,
"driver-module-name" => "com.h2database.h2",
"module-slot" => "main",
"driver-xa-datasource-class-name" => "org.h2.jdbcx.JdbcDataSource",
"driver-class-name" => "org.h2.Driver",
"driver-major-version" => 1,
"driver-minor-version" => 2,
"jdbc-compliant" => true
},
{
"driver-name" => "mysql-connector-java-5.1.16.jar",
"deployment-name" => "mysql-connector-java-5.1.16.jar",
"driver-module-name" => undefined,
"module-slot" => undefined,
"driver-xa-datasource-class-name" => undefined,
"driver-class-name" => "com.mysql.jdbc.Driver",
"driver-major-version" => 5,
"driver-minor-version" => 1,
"jdbc-compliant" => false
}
]
}
{noformat}
and it doesn't work. The schema documentation at [http://docs.jboss.org/ironjacamar/userguide/1.0/en-US/html/deployment.html#deployingds] specifies that the <driver> element is for specifying "An unique name for the JDBC driver specified in the drivers section", but that doesn't seem to be entirely true - it has to match the name of the jar file!
> Deployment fails with NullPointerException when installing JDBC Driver as a deployment
> --------------------------------------------------------------------------------------
>
> Key: AS7-1015
> URL: https://issues.jboss.org/browse/AS7-1015
> Project: Application Server 7
> Issue Type: Bug
> Components: JCA
> Environment: Fedora 14. JBoss AS7 build from June 8, Using MySQL JDBC driver downloaded as an example from http://community.jboss.org/wiki/DataSourceConfigurationinAS7#Installing_a_JDBC_driver_as_a_deployment
> Reporter: Sande Gilda
> Assignee: Stefano Maestri
> Attachments: standalone.xml
>
>
> I am working on the DataSource configuration changes for the EAP5 -> EAP6 migration guide and am following the steps here: http://community.jboss.org/wiki/DataSourceConfigurationinAS7.
> I have been able to successfully install the MySQL JDBC driver as a module, however, I am not having much luck installing the driver as a deployment, which this document says is the recommended way to install it.
> I've done the following:
> - I copied the JDBC-compliant mysql-connector-java-5.1.15.jar (downloaded from the above web site) into my <jboss7>/standalone/deployments directory.
> - I still have the <datasource> and <driver> elements defined in my standalone.xml file from when I successfully installed the driver as a module.
> When I start the server, I see the following error in the log:
> 11:53:42,348 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."TopicIndex.war".CONFIGURE_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."TopicIndex.war".CONFIGURE_MODULE: Failed to process phase CONFIGURE_MODULE of deployment "TopicIndex.war"
> at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675) [jboss-msc-1.0.0.Beta8.jar:1.0.0.Beta8]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
> at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
> Caused by: java.lang.NullPointerException
> at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188) [jboss-msc-1.0.0.Beta8.jar:1.0.0.Beta8]
> at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2165) [jboss-msc-1.0.0.Beta8.jar:1.0.0.Beta8]
> at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188) [jboss-msc-1.0.0.Beta8.jar:1.0.0.Beta8]
> at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2165) [jboss-msc-1.0.0.Beta8.jar:1.0.0.Beta8]
> at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:325) [jboss-msc-1.0.0.Beta8.jar:1.0.0.Beta8]
> at org.jboss.as.server.deployment.module.ModuleSpecProcessor.createModuleService(ModuleSpecProcessor.java:193) [jboss-as-server-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]
> at org.jboss.as.server.deployment.module.ModuleSpecProcessor.deploy(ModuleSpecProcessor.java:99) [jboss-as-server-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]
> at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]
> ... 4 more
> 11:53:42,350 ERROR [org.jboss.as] (MSC service thread 1-1) JBoss AS 7.0.0.Beta4-SNAPSHOT "(TBD)" started (with errors) in 6159ms - Started 136 of 196 services (5 services failed or missing dependencies, 55 services are passive or on-demand)
> Later I see the message that deployment of my WAR failed due to the missing dependency:
> 11:53:42,394 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "TopicIndex.war"
> 11:53:42,394 INFO [org.jboss.as.server] (MSC service thread 1-6) Service status report
> New missing/unsatisfied dependencies:
> service jboss.jdbc-driver._________________________ (missing) required by [service jboss.data-source.java:/TopicIndexDatasource]
> Is there something else I need to be doing here?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list