facebook

problem deploying a base jar into a war

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #242729 Reply

    ndvivedi
    Member

    I am having some trouble with deploying a jar project that contains all of my base code into multiple webapps.

    If i deploy my code in a jar inside a war i get a NoClassDefFound Exception while spring is intializing my beans. The class that is not found is net.sf.hibernate.Session, which doesn’t really make sense as i am using hibernate3. The session it should be loading is org.hibernate.Session.

    If i deploy the code directly in the webapp, in the WEB-INF/classes directory this problem goes away and the app deploys and works as normal.

    Does anyone have any idea what my problem might be?

    eclipse 3.1.0
    myeclipse 4.0-Milestone-3
    java 1.4.2_09
    windows xp pro sp2

    2005-12-06 15:22:09,116 [main] ERROR org.springframework.web.context.ContextLoad
    er – Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean wit
    h name ‘contactDao’ defined in ServletContext resource [/WEB-INF/applicationCont
    ext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDef
    FoundError: net/sf/hibernate/Session
    java.lang.NoClassDefFoundError: net/sf/hibernate/Session
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
    at java.lang.Class.getDeclaredMethods(Class.java:1139)
    at java.beans.Introspector$1.run(Introspector.java:1272)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:12
    70)
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1133)
    at java.beans.Introspector.getBeanInfo(Introspector.java:383)
    at java.beans.Introspector.getBeanInfo(Introspector.java:157)
    at java.beans.Introspector.getBeanInfo(Introspector.java:218)
    at java.beans.Introspector.<init>(Introspector.java:364)
    at java.beans.Introspector.getBeanInfo(Introspector.java:157)
    at java.beans.Introspector.getBeanInfo(Introspector.java:218)
    at java.beans.Introspector.<init>(Introspector.java:364)
    at java.beans.Introspector.getBeanInfo(Introspector.java:157)
    at org.springframework.beans.CachedIntrospectionResults.<init>(CachedInt
    rospectionResults.java:140)
    at org.springframework.beans.CachedIntrospectionResults.forClass(CachedI
    ntrospectionResults.java:82)
    at org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(BeanW
    rapperImpl.java:370)
    at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrap
    perImpl.java:328)
    at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrap
    perImpl.java:310)
    at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java
    :192)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFactory.java:317)
    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:275)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(StandardService.java:480)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

    #242764

    Riyad Kalla
    Member

    If you open up the applicationContext.xml file do you see a reference to the net.sf.hibernate.Session class anywhere?

    #243019

    ndvivedi
    Member

    nope, no reference to net.sf.hibernate at all, and all of my spring references use the org.springframework.orm.hibernate3 package where needed.

    nikhil

    #243036

    Riyad Kalla
    Member

    Sorry for the delay nikhil, this one stumped me and I went around asking the Hibernate and Spring guys what they thought it might be, no one knew for sure but the Spring team did let me know that there has been many bug fixes to Hibernate/Spring from the 4.0M3 release you are using and 4.0.3. They also mentioned a lot more fixes have gone into 4.1M2 that will be out this week (Milestone release though).

    I know that we specifically had an issue with the Spring libraries we were packaging during the early 4.0 dev cycle, so I’m wondering if that is the problem.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: problem deploying a base jar into a war

You must be logged in to post in the forum log in