-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Deploying in Jboss
PostPosted: Fri Dec 05, 2003 12:38 pm 
Beginner
Beginner

Joined: Thu Oct 09, 2003 3:42 pm
Posts: 22
I've gone through several posts as well as the wiki and still haven't been able to make this work.

It always gets to the point in the service deployment where it is doing the hibernate configuration and mapping and then fails with NoClassDefFoundError on net.sf.hibernate.collection.List.

I checked and the class is definately in the hibernate2.jar. This seems incredibly strange to me since jboss is finding other classes in the jar before it fails on List.

Here is the stack trace .... details on my deployment follow the trace.

Code:
11:21:27,014 INFO  [STDOUT] 11:21:27,014 INFO  [HibernateServiceMBean] starting
service at JNDI name: java:/FolderPMFactory
11:21:27,014 INFO  [STDOUT] 11:21:27,014 INFO  [HibernateServiceMBean] service p
roperties: {hibernate.session_factory_name=java:/FolderPMFactory, hibernate.tran
saction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManage
rLookup, hibernate.dialect=hibernate.dialect net.sf.hibernate.dialect.TeradataDi
alect, hibernate.show_sql=true, hibernate.use_outer_join=false, hibernate.transa
ction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory, hibernat
e.connection.datasource=java:/TeradataDS, jta.UserTransaction=UserTransaction}
11:21:27,084 INFO  [STDOUT] 11:21:27,084 INFO  [Environment] Hibernate 2.1 beta
5
11:21:27,104 INFO  [STDOUT] 11:21:27,104 INFO  [Environment] hibernate.propertie
s not found
11:21:27,114 INFO  [STDOUT] 11:21:27,114 INFO  [Environment] using CGLIB reflect
ion optimizer
11:21:27,124 INFO  [STDOUT] 11:21:27,124 INFO  [Configuration] Mapping resource:
mappings/Folder.hbm.xml
11:21:27,585 INFO  [STDOUT] 11:21:27,585 INFO  [Binder] Mapping class: com.terad
ata.tap.folder.domain.Folder -> IOS_FLDRS
11:21:27,875 WARN  [ServiceController] Problem starting service jboss.jca:servic
e=HibernateFactory,                             name=HibernateFactory
java.lang.NoClassDefFoundError: net/sf/hibernate/collection/List
        at net.sf.hibernate.type.TypeFactory.list(TypeFactory.java:186)
        at net.sf.hibernate.mapping.List.getType(List.java:18)
        at net.sf.hibernate.mapping.CollectionValue.getType(CollectionValue.java
:23)
        at net.sf.hibernate.cfg.Binder.bindProperty(Binder.java:382)
        at net.sf.hibernate.cfg.Binder.createProperty(Binder.java:968)
        at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:949)
        at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:312)
        at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1146)
        at net.sf.hibernate.cfg.Configuration.add(Configuration.java:243)
        at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:
266)
        at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:289
)
        at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateSe
rvice.java:160)
        at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:131
)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:976)
        at $Proxy12.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:394)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:816)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
        at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy6.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:302)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:476)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:201)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:274)
        at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
92)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:976)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:394)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy5.deploy(Unknown Source)
        at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
        at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
        at org.jboss.Main.boot(Main.java:150)
        at org.jboss.Main$1.run(Main.java:388)
        at java.lang.Thread.run(Thread.java:534)



My ideal deployment looks like the following. I thought the problem might have been caused by the sar being in the ear so I have also tried placing it outside of the ear. The same problem occured.

Code:
folder.ear
   \META-INF
        application.xml  -- includes all of the necessary jars
   \folder-ejb.jar  -- session beans and persistent classes
   \folder.sar
        \mappings  --- contains mapping files
        \META-INF
             jboss-service.xml
   \lib
        hibernate2.jar and other jars required by hibernate including jdbc driver



folder.ear\META-INF\application.xml
Code:
<application>
   <display-name>folder</display-name>
   <module><java>lib/hibernate2.jar</java></module>
   <module><java>lib/TeradataDialect.jar</java></module>
   <module><java>lib/dom4j.jar</java></module>
   <module><java>lib/commons-collections.jar</java></module>
   <module><java>lib/commons-logging.jar</java></module>
   <module><java>lib/commons-lang.jar</java></module>
   <module><java>lib/cglib-asm.jar</java></module>
   <module><java>lib/terajdbc4.jar</java></module>
   <module><ejb>folder-ejb.jar</ejb></module>
</application>


folder.ear\META-INF\jboss-app.xml
Code:
<jboss-app>
   <loader-repository>com.teradata.crm.folder.loader:loader=folder-ejb.ear</loader-repository>
   <module>
      <service>folder-ejb.sar</service>
   </module>
</jboss-app>



folder.ear\folder.sar\META-INF\jboss-service.xml
Code:
<server>
   <classpath codebase="." archives="lib/cglib-asm.jar, lib/commons-beanutils.jar,
   lib/commons-collections.jar, lib/commons-logging.jar, lib/commons-lang.jar,
   lib/dom4j.jar, lib/TeradataDialect.jar, lib/terajdbc4.jar, lib/tdgssjava.jar,
   lib/hibernate2.jar, folder-ejb.jar"/>
   <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
      <depends>jboss.jca:service=RARDeployer</depends>
      <depends>jboss.jca:service=LocalTxCM,name=TeradataDS</depends>
      <!-- Make it deploy ONLY after DataSource had been started -->
      <attribute name="MapResources">mappings/Folder.hbm.xml, mappings/FolderItem.hbm.xml</attribute>
      <attribute name="JndiName">java:/FolderPMFactory</attribute>
      <attribute name="Datasource">java:/TeradataDS</attribute>
      <attribute name="Dialect">hibernate.dialect net.sf.hibernate.dialect.TeradataDialect</attribute>
      <attribute name="UseOuterJoin">false</attribute>
      <attribute name="ShowSql">true</attribute>
      <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
      <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
      <attribute name="UserTransactionName">UserTransaction</attribute>
   </mbean>
</server>



I'm about ready to pull all of my hair out because of this so any help would be greatly appreciated.

Thanks,
Marc


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 2:35 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Try moving the hibernate related jars into either:

1) the server/default/lib directory, or
2) in the root of the SAR

The documentation in the Hibernate Wiki points to using the first approach.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 3:14 pm 
Beginner
Beginner

Joined: Thu Oct 09, 2003 3:42 pm
Posts: 22
Thanks for the reply. I'd already tried both of those options with no luck. I think I've tried every possible combination of jar location and configuration that exist without it working.

There are several posts on the JBoss forums that seem related to the same issues with JBoss and Hibernate that I'm running into unfortunately none of them seem to have a solution.

I assume I'm doing something stupid I just wish I knew what it was.

-marc


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 4:05 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
You are missing odmg.jar.

net.sf.hibernate.collection.List implements some odmg interfaces.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.