0

I am new to web application development and need your help. I use Spring3.1.2/Hibernate 4.1 on Weblogic 10.3. I deployed the war file but am getting the NoClassDefFoundError at run time below.

It complaints about LocalSessionFactoryBuilder. But if you see the first line of the stacktrace, the call was made from org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(). The LocalSessionFactoryBuilder and LocalSessionFactoryBean are in the same package and I can see both classes in org.springframework.orm-3.1.2.RELEASE.jar in WEB-INF/lib. Any clue?

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)
John
  • 61
  • 1
  • 1
  • 2

1 Answers1

0

I kind fixed this with alternative way. I have placed all the jars in the $DOMAIN/servers/$MYSERVER/lib directory and add them in the classpath in the setEnvsstserver. Not sure why the jars in the WEB-INF/lib not being picked up.

John
  • 61
  • 1
  • 1
  • 2