- This topic has 3 replies, 3 voices, and was last updated 18 years, 3 months ago by
rbrand.
-
AuthorPosts
-
rbrandMemberHi all
I created a Spring DOA pretty much along the lines of a very simple app that did work, but now I get the exception as shown below. On the spring forums I found a related problem at http://forum.springframework.org/showthread.php?t=20553 but I already have hibernate-annotations.jar in my project and did not update. Any ideas?
Thanks
rbrand
2006-10-26 11:35:53,402 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] – <Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [sessionFactoryId,TicketsDAO,StockitemDAO,WarehouseDAO,StocktransactionDAO,ContactDAO, UserRolesDAO,StockorderlinesDAO, StockitemmapDAO,StockorderdocDAO,StockorderDAO,SupplieraddressesDAO,ClubDAO,StockitempriceDAO,TransactionreasonsDAO, TicketeventDAO,WarehouseitemDAO,StockdocDAO,StockorderdocreasonDAO,BinsmappingDAO,BinsDAO,EmailDAO,GroupDAO,PublisherDAO,AuthuserDAO, hibInterceptor,txManager,matchAllWithPropReq,matchAllTxInterceptor,autoProxy]; root of BeanFactory hierarchy}>
2006-10-26 11:35:53,412 INFO [org.codehaus.xfire.handler.DefaultFaultHandler] – <Fault occurred!>
org.codehaus.xfire.fault.XFireFault: Error creating bean with name ‘sessionFactoryId’ defined in file [C:\path\src\applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
at org.codehaus.xfire.service.invoker.FactoryInvoker.getServiceObject(FactoryInvoker.java:36)
at org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:24)
at org.codehaus.xfire.service.invoker.ObjectInvoker.invoke(ObjectInvoker.java:45)
at org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessage(ServiceInvocationHandler.java:271)
at org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:85)
[snip]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactoryId’ defined in file [C:\path\src\applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:370)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
[snip]
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1637)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1310)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1190)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.hibernate.cfg.Configuration.add(Configuration.java:386)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1325)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:627)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
… 59 more
Riyad KallaMemberrbrand,
Give the NoClassDefFounderror’s that are in your stack trace, either you are using incompatible versions of Hibernate with Spring, or you have not properly added necessary libraries to the build path that it needs. Can you drill down and find your HbmBinder.SecondPass inner class?
Haris PecoMemberrbrand,
You needn’t hibernate-annotations.jar if you use xml mappings (annotations are for ejb30.Class HBMBinder$SecondPass exists in hibernate 3.0 and it is removed from hibernate 3.1.I suppose that you use version spring, which request hibernate 3.0 and you have hibernate 3.1 in classpath and have not hibernate3 in classpath.It is easiest that you check your classpath and add hibernate3.jar from version hibernate 3.0.5 (remove hibernate3.jar if exists, because it is from 3.1)
regards,
rbrandMemberPeco
Thanks. That was indeed the problem. It is a bit strange though since I used MyEclipse to add all libraries, that is, I simply used the menus to add Spring and Hibernate capabilities.
Cheers
rbrand
-
AuthorPosts