2012-11-06 75 views
0

我是web應用程序開發新手,需要您的幫助。我在Weblogic 10.3上使用Spring3.1.2/Hibernate 4.1。我部署了war文件,但在運行時正在獲取NoClassDefFoundError。NoClassDefFoundError jar中的LocalSessionFactoryBuilder

它抱怨LocalSessionFactoryBuilder。但是,如果您看到堆棧跟蹤的第一行,則調用是從org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet()中調用的。 LocalSessionFactoryBuilder和LocalSessionFactoryBean在同一個包中,我可以在WEB-INF/lib的org.springframework.orm-3.1.2.RELEASE.jar中看到這兩個類。任何線索?

Caused By: java.lang.NoClassDefFoundError: org/springframework/orm/hibernate4/LocalSessionFactoryBuilder 
     at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:277) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) 
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:591) 
     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) 
     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) 
     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) 

回答

0

我用另一種方式解決了這個問題。我已將所有jar放在$ DOMAIN/servers/$ MYSERVER/lib目錄中,並將它們添加到setEnvsstserver的類路徑中。不知道爲什麼WEB-INF/lib中的jar沒有被拾取。

相關問題