Deployment exception: "found in jboss.xml but not in ejb-jar
michael.sanders Jun 7, 2004 9:16 PMI'm trying to deploy my application to JBoss 3.2.3, having developed it on (and exported my EAR from) WebSphere v5. I've encountered and solved a few hurdles along the way, but I've been stuck on this one problem related to JDBC data source references for two days. I have searched the forums, google, other JBoss discussion sites etc but have not been able to solve it.
My stateless session bean "MDBJDBCConnectionFactory" declares a resource reference "jdbc/MDBDataSource", which I'm trying to bind via jboss.xml to the concrete data source "java:/jdbc/TeraSolve_SQL".
I get the following exception when deploying my EAR:
12:44:42,298 INFO [EARDeployer] Init J2EE application: file:/C:/JBoss/jboss-3.2
.3/server/all/deploy/TeraSolve_SQL.ear
12:44:43,626 ERROR [XmlFileLoader] failed to load jboss.xml. There could be a s
yntax error.
org.jboss.deployment.DeploymentException: Error in jboss.xml for Bean MDBJDBCCon
nectionFactory: found in jboss.xml but not in ejb-jar.xml
at org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMeta
Data.java:764)
at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:175)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:436)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at java.lang.reflect.Method.invoke(Native Method)
My EAR contains several ejb jars. The deployment descriptors for the ejb jar for which the exception is related are:
ejb-jar.xml:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>TDBUtilsEJB</display-name>
<enterprise-beans>
<ejb-name>MDBJDBCConnectionFactory</ejb-name>
<local-home>com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocalHome</local-home>
com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocal
<ejb-class>com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/RDBLoggerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-link>RDBLoggerSession</ejb-link>
</ejb-local-ref>
<resource-ref>
<res-ref-name>jdbc/MDBDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<ejb-name>MDBSnapshotManager</ejb-name>
<local-home>com.dss.server.xdb.snapshot.MDBSnapshotManagerLocalHome</local-home>
com.dss.server.xdb.snapshot.MDBSnapshotManagerLocal
<ejb-class>com.dss.server.xdb.snapshot.MDBSnapshotManagerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/MDBJDBCConnectionFactory</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocalHome</local-home>
com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocal
<ejb-link>MDBJDBCConnectionFactory</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/RDBLoggerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-link>RDBLoggerSession</ejb-link>
</ejb-local-ref>
<ejb-name>MDBBMTController</ejb-name>
<local-home>com.dss.server.xdb.MDBBMTControllerLocalHome</local-home>
com.dss.server.xdb.MDBBMTControllerLocal
<ejb-class>com.dss.server.xdb.MDBBMTControllerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/RDBLoggerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-link>RDBLoggerSession</ejb-link>
</ejb-local-ref>
<ejb-name>ResourceLockSession</ejb-name>
<local-home>com.dss.server.xdb.lock.ResourceLockSessionLocalHome</local-home>
com.dss.server.xdb.lock.ResourceLockSessionLocal
<ejb-class>com.dss.server.xdb.lock.ResourceLockSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/MDBJDBCConnectionFactory</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocalHome</local-home>
com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocal
<ejb-link>MDBJDBCConnectionFactory</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/RDBLoggerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-link>RDBLoggerSession</ejb-link>
</ejb-local-ref>
<ejb-name>SessionIdManager</ejb-name>
<local-home>com.dss.server.xdb.session.SessionIdManagerLocalHome</local-home>
com.dss.server.xdb.session.SessionIdManagerLocal
<ejb-class>com.dss.server.xdb.session.SessionIdManagerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/MDBJDBCConnectionFactory</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocalHome</local-home>
com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocal
<ejb-link>MDBJDBCConnectionFactory</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/RDBLoggerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-link>RDBLoggerSession</ejb-link>
</ejb-local-ref>
<ejb-name>RDBLoggerSession</ejb-name>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-class>com.dss.server.xdb.logging.RDBLoggerSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-name>SecurityAuthoriserSession</ejb-name>
<local-home>com.dss.server.xdb.security.SecurityAuthoriserSessionLocalHome</local-home>
com.dss.server.xdb.security.SecurityAuthoriserSessionLocal
<ejb-class>com.dss.server.xdb.security.SecurityAuthoriserSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/MDBJDBCConnectionFactory</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocalHome</local-home>
com.dss.server.xdb.jdbc.MDBJDBCConnectionFactoryLocal
<ejb-link>MDBJDBCConnectionFactory</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/RDBLoggerSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.dss.server.xdb.logging.RDBLoggerSessionLocalHome</local-home>
com.dss.server.xdb.logging.RDBLoggerSessionLocal
<ejb-link>RDBLoggerSession</ejb-link>
</ejb-local-ref>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<ejb-name>SessionIdManager</ejb-name>
<method-intf>Local</method-intf>
<method-name>getSessionId</method-name>
<method-params>
</method-params>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
jboss.xml
-----------
<enterprise-beans>
<ejb-name>MDBJDBCConnectionFactory</ejb-name>
<resource-ref>
<res-ref-name>jdbc/MDBDataSource</res-ref-name>
<jndi-name>java:/jdbc/TeraSolve_SQL</jndi-name>
</resource-ref>
</enterprise-beans>
Things I've checked:
0) This is indeed the first exception to occur.
1) The session bean "MDBJDBCConnectionFactory" referenced in my jboss.xml does indeed exist in the EAR, with exactly the same name.
2) The app deploys ok if I don't specify a jboss.xml for that ejb jar. Of course, it fails when bean "MDBJDBCConnectionFactory" first tries to use the data source, but it imples that the ejb-jar is probably ok...
3) The concrete data source seems to be ok, as I get the message "2004-06-08 12:44:39,876 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.jdbc/TeraSolve_SQL] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=jdbc/TeraSolve_SQL to JNDI name 'java:/jdbc/TeraSolve_SQL'" in the JBoss log.
Any help appreciated! Please point out where I'm missing something obvious!
Thanks,
- Michael