- This topic has 4 replies, 2 voices, and was last updated 18 years, 7 months ago by
erno1978.
-
AuthorPosts
-
erno1978MemberI read a lot of posts on this thread, but they al seem to not help me out, I’m getting mad. 🙁
I have a MyEclipse project with a working HibernateReadTest.java which puts data from database to console.
In the same project I have WebRoot with a working call to some ProdManager class which puts some products in my browser.Now: I want to combine those, but if I put a call to my DAO object in the ProdManager-class I get this error when starting the server:
2006-10-13 11:27:16,296 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Context initialization failed> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'prodMan' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ernstig.bus.ProductManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ernstig.bus.ProductManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion Caused by: java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion at com.ernstig.bus.ProductManager.<init>(ProductManager.java:16) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
As a newbie I see he cannot create the bean prodMan. Note that if I remove the call to the DAO in the ProdMan class, it works flawless. It looks like Spring is not familiair with Hibernate at all? I don’t know what else is helpful to know for you guys, but any help would be greatly appreciated!
Haris PecoMembererno1978 ,
You have not hibernate libraries in your web application.You probably have off deployment options for jars .
Right click on project and choose Properties> MyEclipse>Web and in Tab ‘Deployment’ check all jars in ‘Library deployment policy’
Aftre this redeploy your applicationBest
Peco
erno1978Member@support-snpe wrote:
erno1978 ,
You have not hibernate libraries in your web application.You probably have off deployment options for jars .
Right click on project and choose Properties> MyEclipse>Web and in Tab ‘Deployment’ check all jars in ‘Library deployment policy’
Aftre this redeploy your applicationBest
PecoHi Peco,
Thanks for your help. It sounds like a good solution-direction, but it doesn’t work. Here’s a screenshot with the settings-page you mentioned. I fiddled with these options (also tried different settings with the Web Project Depend Project Deployment Policy), but it doesn’t seem to matter: when I redeploy and restart the server the same error occurs.
Also, when I look at the directory of the deployment, I can see the hibernate3.jar is inside the \WEB-INF\lib directory. Do you have any other tips? Thanks in advance!
(Screenshot, bigger version at: http://www.euronet.nl/users/tcls/tmp/myeclipse.jpg)
Haris PecoMemberI am not sure what is problem if you have hibernate’s libraries in web application.It is diffcult to conclude without your project.You can send project on
support@genuitec.com with subject ATTN: snpe if it is possibleCheck if MyEclipse deploy your complete application, too
Best
Peco
erno1978Member@support-snpe wrote:
I am not sure what is problem if you have hibernate’s libraries in web application.It is diffcult to conclude without your project.You can send project on
support@genuitec.com with subject ATTN: snpe if it is possibleCheck if MyEclipse deploy your complete application, too
Best
PecoThanks for your help so far. Really appreciated. While I was trying to package the thing to send to you I fiddled on with libraries, in the end I could not reproduce the error, but after a full day of hassling another error came up (I opened a new topic on this, because it has nothing to do with this as it seems). Thanks anyway!
-
AuthorPosts