0 Replies Latest reply on Jul 9, 2004 6:33 AM by benoit

    Castor - JBoss integration

    benoit Newbie

      Hi All !

      I've been trying to integrate Castor into JBoss for 4 days now. After Reading tons of docs I wondered if someone could help me a bit... I'm trying to acces Castor JDO through JNDI.
      Sorry for the length of this post, I tried to make it short whithout overlooking too many details.

      Tools versions :
      - JBoss-3.2.5
      - Castor-0.9.5.3
      - JVM : jrockit81sp2_141_05
      - OS : Windows XP - Home edition

      1 - I checked out JBoss from CVS this way :

      cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/jboss login
      cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/jboss co -r JBoss_3_2_5 jboss-3.2

      2 - Then build JBoss using build.bat, everything worked fine.

      3 - I've created this directory :
      jboss/server/default/deploy/castor-jdo-plugin.sar

      which has the following structure :
      castor-jdo-plugin.sar/META-INF/jboss-service.xml
      castor-jdo-plugin.sar/org/jboss/jdo/castor/CastorJDOImpl.class
      castor-jdo-plugin.sar/org/jboss/jdo/castor/CastorJDOImplMBean.class


      These two last files come from the varia\output\classes\org\jboss\jdo\castor directory after jboss build has completed.

      4 - I put castor-0.9.5.3.jar in the jboss/server/default/lib directory

      castor-jdo-plugin.sar/META-INF/jboss-service.xml contains the following xml :
      <server>
      
       <mbean code="org.jboss.jdo.CastorJDOImpl" name="DefaultDomain:service=castorJDO,name=castorJdo">
       <attribute name="Configuration">file:../conf/default/database.xml</attribute>
       <attribute name="JndiName">jdo/castorJdo</attribute>
       <attribute name="LockTimeout">0</attribute>
       <attribute name="LoggingEnabled">false</attribute>
       <attribute name="CommonClassPath">false</attribute>
       <attribute name="AutoStore">true</attribute>
       <attribute name="DatabasePooling">true</attribute>
       </mbean>
      
      </server>


      database.xml contains the following xml :
      <database name="dietavenuedb" engine="mysql" >
       <jndi name="java:/DietAvenueDS"/>
       <mapping href="mapping-byhand.xml" />
      </database>

      5 - When I start JBoss I get the following exception :
      11:15:15,296 WARN [NestedThrowable] Duplicate throwable nesting of same base type:
      class org.jboss.deployment.DeploymentException is assignable from:
      class org.jboss.deployment.DeploymentException
      11:15:15,296 ERROR [MainDeployer] could not create deployment:
      file:/<path-to-server-dir>/default/deploy/castor-jdo-plugin.sar/org.jboss.deployment.DeploymentException:
      create operation failed for package file:/<path-to-server-dir>/default/deploy/castor-jdo-plugin.sar/;
      - nested throwable: (org.jboss.deployment.DeploymentException:
      No ClassLoaders found for: org.jboss.jdo.CastorJDOImpl;
      - nested throwable: (java.lang.ClassNotFoundException:
      No ClassLoaders found for: org.jboss.jdo.CastorJDOImpl))
      [... stack trace ...]
      Caused by: org.jboss.deployment.DeploymentException:
      No ClassLoaders found for: org.jboss.jdo.CastorJDOImpl;
      - nested throwable: (java.lang.ClassNotFoundException:
      No ClassLoaders found for: org.jboss.jdo.CastorJDOImpl)
      at org.jboss.system.ServiceConfigurator.install
      Lorg.w3c.dom.Element;Ljavax.management.ObjectName;)Ljava.util.List;(ServiceConfigurator.java:139)
      [... stack trace ...]
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.jdo.CastorJDOImpl
       at org.jboss.mx.loading.LoadMgr3.beginLoadTask(Lorg.jboss.mx.loading.ClassLoadingTask;
      Lorg.jboss.mx.loading.UnifiedLoaderRepository3;)Z(LoadMgr3.java:185)
      [... stack trace ...]


      It seems that I have a ClassLoader problem which I happen to be unable to solve. I'd greatly appreciate your help but hope not to waste your time in the case I would not have read all that I should have read to solve my problem.

      Does anybody has an idea on how to access Castor JDO through JNDI ?

      Thanks for your time and reading and sorry for my spelling mistakes.

      Benoit.