amjava
asked on
EJB3 problem with Jboss datasource??
I am new to EJB3 and am trying to run through the tutorial from http://www.laliluna.de/ejb-3-tutorial-jboss.html. I don't think my datasource is getting set up correctly. Here is the error from the Jboss server on start up.
13:38:01,717 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:jar=Firs tEJB3Tutor ial Ant.jar,unitName=FirstEjb3 Tutorial
State: NOTYETINSTALLED
I Depend On:
jboss.jca:name=ejb3Project DS,service =DataSourc eBinding
Depends On Me:
jboss.j2ee:jar=FirstEJB3Tu torial Ant.jar,name=BookTestBean, service=EJ B3
ObjectName: jboss.j2ee:jar=FirstEJB3Tu torial Ant.jar,name=BookTestBean, service=EJ B3
State: NOTYETINSTALLED
I Depend On:
persistence.units:jar=Firs tEJB3Tutor ial Ant.jar,unitName=FirstEjb3 Tutorial
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:name=ejb3Project DS,service =DataSourc eBinding
State: NOTYETINSTALLED
Depends On Me:
persistence.units:jar=Firs tEJB3Tutor ial Ant.jar,unitName=FirstEjb3 Tutorial
13:38:02,092 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
13:38:02,170 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:38:02,185 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 54s:735ms
I think the datasource is set up ok? This is from earlier in the output -
13:37:59,967 INFO [ConnectionFactoryBindingS ervice] Bound ConnectionManager 'jboss.jca:service=DataSou rceBinding ,name=ejb3 ExampleDS' to JNDI name 'java:ejb3ExampleDS'
Here is my mysql-ds.xml from the C:\jboss-4.2.2.GA\server\d efault\dep loy directory
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mysql-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
<!-- Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->
<datasources>
<local-tx-datasource>
<jndi-name>ejb3ExampleDS</ jndi-name>
<connection-url>jdbc:mysql ://mysql-l ocalhost:3 306/test</ connection -url>
<driver-class>com.mysql.jd bc.Driver< /driver-cl ass>
<user-name>x</user-name>
<password>y</password>
<exception-sorter-class-na me>org.jbo ss.resourc e.adapter. jdbc.vendo r.MySQLExc eptionSort er</except ion-sorter -class-nam e>
<!-- should only be used on drivers after 3.22.1 with "ping" support
<valid-connection-checker- class-name >org.jboss .resource. adapter.jd bc.vendor. MySQLValid Connection Checker</v alid-conne ction-chec ker-class- name>
-->
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecke r is preferred for newer drivers
<check-valid-connection-sq l>some arbitrary sql</check-valid-connectio n-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
<metadata>'
<type-mapping>mySQL</type- mapping>
</metadata>
</local-tx-datasource>
</datasources>
I have tried both
<connection-url>jdbc:mysql ://mysql-l ocalhost:3 306/test</ connection -url>
and
<connection-url>jdbc:mysql ://localho st:3306/te st</connec tion-url>
for the <connection-url> syntax and same error with both.
Also here is my persistence.xml file --
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="FirstEjb3Tutorial" transaction-type="JTA">
<jta-data-source>java:/ejb 3ProjectDS </jta-data -source>
</persistence-unit>
</persistence>
Is it the datasource causing the error??
13:38:01,717 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:jar=Firs
State: NOTYETINSTALLED
I Depend On:
jboss.jca:name=ejb3Project
Depends On Me:
jboss.j2ee:jar=FirstEJB3Tu
ObjectName: jboss.j2ee:jar=FirstEJB3Tu
State: NOTYETINSTALLED
I Depend On:
persistence.units:jar=Firs
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:name=ejb3Project
State: NOTYETINSTALLED
Depends On Me:
persistence.units:jar=Firs
13:38:02,092 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
13:38:02,170 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:38:02,185 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 54s:735ms
I think the datasource is set up ok? This is from earlier in the output -
13:37:59,967 INFO [ConnectionFactoryBindingS
Here is my mysql-ds.xml from the C:\jboss-4.2.2.GA\server\d
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mysql-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
<!-- Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->
<datasources>
<local-tx-datasource>
<jndi-name>ejb3ExampleDS</
<connection-url>jdbc:mysql
<driver-class>com.mysql.jd
<user-name>x</user-name>
<password>y</password>
<exception-sorter-class-na
<!-- should only be used on drivers after 3.22.1 with "ping" support
<valid-connection-checker-
-->
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecke
<check-valid-connection-sq
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
<metadata>'
<type-mapping>mySQL</type-
</metadata>
</local-tx-datasource>
</datasources>
I have tried both
<connection-url>jdbc:mysql
and
<connection-url>jdbc:mysql
for the <connection-url> syntax and same error with both.
Also here is my persistence.xml file --
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="FirstEjb3Tutorial" transaction-type="JTA">
<jta-data-source>java:/ejb
</persistence-unit>
</persistence>
Is it the datasource causing the error??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER