Default Datasource for entity beans
halliballi May 16, 2012 10:26 AMHallo everybody,
maybe this is some stupid question. But I just don't find a solution. I am stuck for 3 days now.
I have a project that uses ejb 2.1 definitions.
I can deploy and remotly access my session beans, I have defined a datasource in standalone-full.xml.
{code:xml}
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/DataSource" pool-name="DefaultDSPool" enabled="true" use-java-context="true">
<connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=databasename</connection-url>
<driver>sqljdbc</driver>
<security>
<user-name>user</user-name>
<password>password</password>
</security>
</datasource>
<drivers>
<driver name="sqljdbc" module="com.microsoft.sqlserver.jdbc">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
</driver>
</drivers>
</datasources>
</subsystem>
{code}
I added the driver to the modules with the corresponding modules.xml
I want to use Container Managed Persistence
But when I try to deploy my application on the JBoss AS 7.1.0 final I get the following errors:
15:39:30,277 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990
15:39:30,281 ERROR [org.jboss.as] (MSC service thread 1-2) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors)
in 56593ms - Started 4258 of 4967 services (596 services failed or missing dependencies, 112 services are passive or on-demand)
15:39:30,492 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "applica.ear" was rol
led back with failure message {"JBAS014771: Services with missing/unavailable dependencies"=>["jboss.deployment.subunit.\"appli
ca.ear\".\"gan_zdb-server.jar\".component.LPStatisticEntityEJB.jdbc.store-manager.INITjboss.data-source.java:jboss/datasources/
ExampleDSMissing[jboss.deployment.subunit.\"aplica.ear\".\"gan_zdb-server.jar\".component.LPStatisticEntityEJB.jdbc.store-manag
er.INITjboss.data-source.java:jboss/datasources/ExampleDS]",
...
...
How do I tell the entity Beans which Datasource to use?
Is there a configuration file for defining the default Datasource for the Entities?
Thank you very much