当前位置: 代码迷 >> Java Web开发 >> SSH框架融合解决办法
  详细解决方案

SSH框架融合解决办法

热度:871   发布时间:2013-02-25 21:09:00.0
SSH框架融合
我在进行SSH框架融合时,在没有启动事物时,没问题。可是启动了事物时就要报错,麻烦各位高手帮忙看看呢?看看是我的事物配置错误还是其他什么原因呢,我的在applicationContext.xml配置的事物是:
XML code
    <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">        <property name="sessionFactory" ref="sessionFactory"></property>    </bean>    <tx:advice id="txAdvice" transaction-manager="txManager">        <tx:attributes>            <tx:method name="*" read-only="true" propagation="REQUIRED"/>        </tx:attributes>    </tx:advice>    <aop:config>        <aop:pointcut expression="execution(com.accp.st106.jboa.dao.impl.*)" id="serviceMethod"/>        <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod"/>    </aop:config>


启动服务器后要报一下错误信息
Java code
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)    at org.apache.catalina.core.StandardService.start(StandardService.java:525)    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)    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:289)    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor    at java.lang.ClassLoader.defineClass1(Native Method)    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)    at org.springframework.transaction.config.TxAdviceBeanDefinitionParser.getBeanClass(TxAdviceBeanDefinitionParser.java:72)    at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:66)    at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)    at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1419)    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)    ... 28 moreCaused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)    at org.apache.catalina.core.StandardService.start(StandardService.java:525)    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)    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:289)    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor    at java.lang.ClassLoader.defineClass1(Native Method)    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)Caused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)    ... 47 more2012-9-11 14:59:55 org.apache.catalina.core.StandardContext start
  相关解决方案