0

我是 Web 应用程序开发的新手,需要您的帮助。我在 Weblogic 10.3 上使用 Spring3.1.2/Hibernate 4.1。我部署了战争文件,但在下面的运行时得到了 NoClassDefFoundError。

它抱怨 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)
4

1 回答 1

0

我用另一种方式解决了这个问题。我已将所有 jars 放在 $DOMAIN/servers/$MYSERVER/lib 目录中,并将它们添加到 setEnvsstserver 的类路径中。不知道为什么 WEB-INF/lib 中的 jars 没有被拾取。

于 2012-11-07T15:19:03.627 回答