[
https://issues.jboss.org/browse/AS7-4711?page=com.atlassian.jira.plugin.s...
]
Michael Voegele commented on AS7-4711:
--------------------------------------
I tried with the nightly build, the behaviour is a bit different, but it does not work:
First:
1. start with enabled="false"
2. deploy the app
3. I get error, missing dependencies, the ds
-> correct (and the enabled flag does not disappear anymore from the config)
Second:
1. start with enabled="true"
2. deploy the app
-> same error as in 7.1.1.Final, ds already registered, deployment fails
Behaviour with datasources and the enabled attribute
----------------------------------------------------
Key: AS7-4711
URL:
https://issues.jboss.org/browse/AS7-4711
Project: Application Server 7
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 7.1.1.Final
Reporter: Michael Voegele
Assignee: Scott Marlow
Labels: datasource
I have following test configuration, mind the attribute enabled="false":
{code:xml}
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource enabled="false" jta="true"
jndi-name="java:jboss/jdbc/Db2NonXaDataSource" pool-name="DB2DSPool"
use-java-context="true" use-ccm="true">
<connection-url>jdbc:db2://ddb-dintalc:50006/UALC</connection-url>
<driver>db2</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>s01talc</user-name>
<password>Not4You</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<use-fast-fail>false</use-fast-fail>
</validation>
</datasource>
<drivers>
<driver name="db2" module="com.ibm.db2.v4_3_85">
<xa-datasource-class>com.ibm.db2.jcc.DB2Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
{code}
1. I start the server (standalone mode, I did not check domain mode). The attribute is
still the same, enabled="false".
In an ejb, a persistence unit references the datasource:
@PersistenceContext(unitName = "db2_persistence_unit")
private EntityManager entityManager;
2. Now I deploy (maven-ear-plugin or just drop in deployments dir) the ear. The
configuration is changed automatically, the attribute is not there anymore:
{code:xml}
<datasource jta="true"
jndi-name="java:jboss/jdbc/Db2NonXaDataSource" pool-name="DB2DSPool"
use-java-context="true" use-ccm="true">
<connection-url>jdbc:db2://ddb-dintalc:50006/UALC</connection-url>
<driver>db2</driver>
...
{code}
The application works, the datasource is available, so it is enabled in the background.
3. Now just restart the server.
Outcome:
{code:java}
2012-05-04 13:30:53,817 [MSC service thread 1-1] ERROR org.jboss.msc.service.fail -
MSC00001: Failed to start service
jboss.deployment.subunit."jet-demo-ear-0.0.1-SNAPSHOT.ear"."jet-demo-ejb-0.0.1-SNAPSHOT.jar".INSTALL:
org.jboss.msc.service.StartException in service
jboss.deployment.subunit."jet-demo-ear-0.0.1-SNAPSHOT.ear"."jet-demo-ejb-0.0.1-SNAPSHOT.jar".INSTALL:
Failed to process phase INSTALL of subdeployment
"jet-demo-ejb-0.0.1-SNAPSHOT.jar" of deployment
"jet-demo-ear-0.0.1-SNAPSHOT.ear"
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.7.0_02]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.7.0_02]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_02]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS010464:
Exception deploying datasource java:jboss/jdbc/Db2NonXaDataSource
at
org.jboss.as.connector.deployers.processors.DsXmlDeploymentInstallProcessor.deploy(DsXmlDeploymentInstallProcessor.java:125)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: org.jboss.msc.service.DuplicateServiceException: Service
jboss.naming.context.java.jboss.jdbc.Db2NonXaDataSource is already registered
at
org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.as.connector.deployers.processors.DsXmlDeploymentInstallProcessor.startDataSource(DsXmlDeploymentInstallProcessor.java:309)
at
org.jboss.as.connector.deployers.processors.DsXmlDeploymentInstallProcessor.deploy(DsXmlDeploymentInstallProcessor.java:123)
... 6 more
{code}
So the deployment fails. The same happens when the server is started with enabled
datasource and then deploying the app.
This behaviour came with 7.1.1.Final, before it worked as expected.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira