Persistance deployment problem - ObjectName: persistence.uni
ujludwig1 May 12, 2006 5:59 PMHi all. I'm trying to get my Jboss to work with Oracle XE. Everything's running on Suse 10. I've created a simple Entity bean as shown below but I can't seem to get the entity manager to get loaded, in short, on deploy I receive the message shown below...
14:53:59,581 ERROR [URLDeploymentScanner] Incomplete Deployment listing: --- Incompletely deployed packages --- org.jboss.deployment.DeploymentInfo@3f97cfc3 { url=file:/home/ulysses/jboss-4.0.4.CR2/server/default/deploy/ejb3-clustered-sfsbcache-service.xml } deployer: org.jboss.deployment.SARDeployer@1c486f2 status: Deployment FAILED reason: Unexpected error during load of: org.jboss.ejb3.cache.tree.PassivationTreeCache, msg=org/jboss/cache/TreeCache; - nested throwable: (java.lang.ClassNotFoundException: Unexpected error during load of: org.jboss.ejb3.cache.tree.PassivationTreeCache, msg=org/jboss/cache/TreeCache) state: FAILED watch: file:/home/ulysses/jboss-4.0.4.CR2/server/default/deploy/ejb3-clustered-sfsbcache-service.xml altDD: null lastDeployed: 1147470765402 lastModified: 1147470765000 mbeans: org.jboss.deployment.DeploymentInfo@f62942f9 { url=file:/home/ulysses/jboss-4.0.4.CR2/server/default/deploy/ejb3-entity-cache-service.xml } deployer: org.jboss.deployment.SARDeployer@1c486f2 status: Deployment FAILED reason: No ClassLoaders found for: org.jboss.cache.TreeCache; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.cache.TreeCache) state: FAILED watch: file:/home/ulysses/jboss-4.0.4.CR2/server/default/deploy/ejb3-entity-cache-service.xml altDD: null lastDeployed: 1147470766295 lastModified: 1147470766000 mbeans: --- MBeans waiting for other MBeans --- ObjectName: jboss.j2ee:jar=TestEJB.jar,name=Mes_ItemMaintBean,service=EJB3 State: NOTYETINSTALLED I Depend On: persistence.units:unitName=OracleDS --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- ObjectName: persistence.units:unitName=OracleDS State: NOTYETINSTALLED Depends On Me: jboss.j2ee:jar=TestEJB.jar,name=Mes_ItemMaintBean,service=EJB3
I have attached all of the major components of the application below for your perusal, any help would be great.
<persistence> <persistence-unit name="OracleDS"> <jta-data-source>java:/oracle-ds</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> </properties> </persistence-unit> </persistence>
Here's my datasource (oracle-ds) and yes I put the Oracle jdbc in server/devault/lib
<datasources> <xa-datasource> <jndi-name>XAOracleDS</jndi-name> <track-connection-by-tx/> <isSameRM-override-value>false</isSameRM-override-value> <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class> <xa-datasource-property name="URL">jdbc:oracle:oci8:@localhost</xa-datasource-property> <xa-datasource-property name="User">myuser</xa-datasource-property> <xa-datasource-property name="Password">mypass</xa-datasource-property> <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool --> <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name--> <!-- Checks the Oracle error codes and messages for fatal errors --> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name> <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa --> <no-tx-separate-pools/> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> <metadata> <type-mapping>Oracle9i</type-mapping> </metadata> </xa-datasource> <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" name="jboss.jca:service=OracleXAExceptionFormatter"> <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends> </mbean> </datasources>
Here's my entity bean
/** * */ package db; import javax.persistence.*; import java.io.Serializable; /** * @author ulysses * */ @Entity @Table(name = "mes_item") public class Mes_Item implements Serializable { public static final long serialVersionUID= 7422574264257894633L; private String mes_item_id; private String mes_item_name; private String mes_item_description; public Mes_Item () { super(); } public Mes_Item (String id,String title, String description) { this.mes_item_id = id; this.setMes_item_name(title); this.setMes_item_description(description); } @Id //@GeneratedValue @Column (name="mes_item_id") public String getMes_item_id () { return mes_item_id; } public void setMes_item_id (String id) { this.mes_item_id = id; } /** * @param title The title to set. */ public void setMes_item_name(String title) { this.mes_item_name = title; } /** * @return Returns the title. */ @Column (name="mes_item_title") public String getMes_item_name() { return mes_item_name; } /** * @param description The description to set. */ public void setMes_item_description(String description) { this.mes_item_description = description; } /** * @return Returns the description. */ @Column (name="mes_item_description") String getMes_item_description() { return mes_item_description; } }
Here's the session bean
package db; import javax.ejb.Stateless; import java.util.Iterator; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import db.Mes_ItemMaint; public @Stateless class Mes_ItemMaintBean implements Mes_ItemMaint { @PersistenceContext(unitName="OracleDS") EntityManager em; public void test() { Mes_Item itm1 = new Mes_Item("111111111", "Test 1", "Test 1 Description"); em.persist(itm1); Mes_Item itm2 = new Mes_Item("22222222222", "Test 2", "Test 2 Description"); em.persist(itm2); } }