Announcement Announcement Module
Collapse
No announcement yet.
error loading appcontext Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • error loading appcontext

    hi folks,

    in my webapp i have declared some appcontext

    testJavaContext:
    Code:
    <beans>
    	<!-- ========================= GENERAL DEFINITIONS ========================= -->
    
    	<bean id="propertyConfigurer" 
    		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="location"><value>/WEB-INF/conf/db.properties</value></property>
    	</bean>
    
    	<!-- ========================= RESOURCE DEFINITIONS ========================= -->
    
    	<bean id="testJavaDataSource" 
    		class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    		<property name="driverClassName"><value>$&#123;db.driverClassName&#125;</value></property>
    		<property name="url"><value>$&#123;db.url&#125;</value></property>
    		<property name="username"><value>$&#123;db.username&#125;</value></property>
    		<property name="password"><value>$&#123;db.password&#125;</value></property>
    	</bean>
    	
    	<bean id="testJavaSessionFactory"
    	      class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
    	      <property name="dataSource"><ref local="testJavaDataSource"/> </property>
    	      <property name="configLocation"><value>classpath&#58;hibernate.cfg.xml</value></property>
    	   </bean>
    
    	<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
    		<property name="sessionFactory"><ref local="testJavaSessionFactory"/></property>
    	</bean>
    
    	<!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->
    
        <bean id="testJavaTarget" 
        	class="uk.ac.ebi.database.dao.HibernateSbmlDao">
            <property name="sessionFactory">
                <ref bean="testJavaSessionFactory"/>
            </property>
        </bean>
    
    	<bean id="testJavaDao" 
    		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager"><ref local="transactionManager"/></property>
    		<property name="target"><ref local="testJavaTarget"/></property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
    				<prop key="store*">PROPAGATION_REQUIRED</prop>
    			</props>
    		</property>
    	</bean>
    testJavaApp-servlet:

    Code:
    	<bean id="testJavaAppController" 
    		class="uk.ac.ebi.web.controller.TestJavaAppController">
    		<property name="sbmlDao"><ref bean="testJavaDao"/></property>
    		<property name="methodNameResolver"><ref local="testJavaAppControllerResolver"/></property>
    	</bean>
    when i try to deploy it i get this error:

    Code:
    &#91;ContainerBackgroundProcessor&#91;StandardEngine&#91;Catalina&#93;&#93;&#93; ERROR org.springframework.web.context.ContextLoader  - Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException&#58; Error registering bean with name 'testJavaDao' defined in resource &#91;/WEB-INF/testJavaContext-hibernate.xml&#93; of ServletContext&#58; Class that bean class &#91;org.springframework.transaction.interceptor.TransactionProxyFactoryBean&#93; depends on not found; nested exception is java.lang.NoClassDefFoundError&#58; org/aopalliance/aop/Advice
    java.lang.NoClassDefFoundError&#58; org/aopalliance/aop/Advice
    	at java.lang.Class.forName0&#40;Native Method&#41;
    	at java.lang.Class.forName&#40;Class.java&#58;217&#41;
    	at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition&#40;BeanDefinitionReaderUtils.java&#58;50&#41;
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition&#40;DefaultXmlBeanDefinitionParser.java&#58;303&#41;
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinition&#40;DefaultXmlBeanDefinitionParser.java&#58;263&#41;
    	at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinition&#40;DefaultXmlBeanDefinitionParser.java&#58;229&#41;
    i don't understand the problem because i have placed the spring.jar in the /web-inf/lib directory for the webapp.

    can please somebody help me ??

  • #2
    add aopalliance.jar to WEB-INF/lib

    Comment

    Working...
    X