Announcement Announcement Module
Collapse
No announcement yet.
Advice ClassNotFound when starting web app Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Advice ClassNotFound when starting web app

    I'm trying to start a web app in Tomcat 5.25. When I start the container I get an error telling me that the Advice class doesn't exist. I've included all of the 3.0 release jars in my WEB-INF/lib directory.

    Here's the exception I get:

    HTML Code:
    12:00:13,937 ERROR ContextLoader:208 - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'petpp' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:671)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:401)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	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:597)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Caused by: java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
    	at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:98)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1422)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1389)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    	... 25 more
    Caused by: java.lang.ClassNotFoundException: org.aopalliance.aop.Advice
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    	... 29 more
    Here's my applicationContext.xml file

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd
               http://www.springframework.org/schema/tx
               http://www.springframework.org/schema/tx/spring-tx.xsd
               http://www.springframework.org/schema/aop
               http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
      <!-- Scan for annotation based controllers -->
      <!--
      -->
      <bean id="mySqlDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
        <property name="url" value="jdbc:oracle:thin:@ldap://foo"/>
        <property name="username" value="abc"/>
        <property name="password" value="123"/>
      </bean>
      <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="mySqlDataSource" />
        <property name="jpaVendorAdapter">
          <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
            <property name="showSql" value="true"/>
            <property name="generateDdl" value="false"/>
            <property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect"/>
          </bean>
        </property>
        <property name="loadTimeWeaver">
          <bean class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>
        </property>
      </bean>
      <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <property name="dataSource" ref="mySqlDataSource" />
      </bean>
      <!-- 
       -->
      <bean id="petpp" class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
      <bean id="pabpp" class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
    </beans>
    Here's my WEB-INF/abc-servlet.xml file

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd
               http://www.springframework.org/schema/aop
               http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx
               http://www.springframework.org/schema/tx/spring-tx.xsd">
    
    	<!-- Scan for annotation based controllers -->
    	<context:component-scan base-package="edu.cornell.kfs.dart.*" />
    	<context:annotation-config />
    
    	<!-- Miscellaneous -->
    	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
    		<property name="prefix"><value>/WEB-INF/jsp/</value></property>
    		<property name="suffix"><value>.jsp</value></property>
    	</bean>
    	
      <tx:annotation-driven />
    
    	<bean id="defaultHibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    		<property name="properties">
    			<props>
    				<prop key="hibernate.hbm2ddl.auto">update</prop>
    				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    				<prop key="hibernate.query.substitutions">true 'T', false 'F'</prop>
    				<prop key="hibernate.show_sql">false</prop>
    				<prop key="hibernate.c3p0.minPoolSize">5</prop>
    				<prop key="hibernate.c3p0.maxPoolSize">20</prop>
    				<prop key="hibernate.c3p0.timeout">600</prop>
    				<prop key="hibernate.c3p0.max_statement">50</prop>
    				<prop key="hibernate.c3p0.testConnectionOnCheckout">false</prop>
    			</props>
    		</property>
    	</bean>
    
      <bean id="mySqlSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="mySqlDataSource"/>
        <property name="hibernateProperties">
        	<ref bean="defaultHibernateProperties" />
        </property>
      </bean>
      
    </beans>
    What do I need to do to satisfy the library dependencies. Also, if there's anything I can do to consolidate the two config files into one, that would be welcome advice.

    Thanks

  • #2
    aopalliance

    You need the aopalliance.jar from http://sourceforge.net/projects/aopalliance

    Comment


    • #3
      Originally posted by laran View Post
      ...
      What do I need to do to satisfy the library dependencies. Also, if there's anything I can do to consolidate the two config files into one, that would be welcome advice.

      Thanks
      I'd suggest servlet specification - 'SRV.9.5 Directory Structure' in order to understand java web app assembly organization.

      Comment


      • #4
        wamly welcome

        Sure all pro gamer are most welcome... if you can reach out to them it would be great!! Thanks a lot

        __________________
        Calcul pret immobilier simulation en ligne | Taux simulation rachat de pret immobilier lcl | Pret immobilier simulation gratuit caisse d'epargne

        Comment

        Working...
        X