spring aspectj我的课程没有编织

时间:2015-02-27 21:45:50

标签: spring aop aspectj

我使用的是弹簧版本4.1.4。我也在使用axis2。

这是我的aop.xml

<!DOCTYPE aspectj PUBLIC 
"-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
    <weaver options="-verbose -debug -showWeaveInfo">
        <!-- only weave classes in our application-specific packages -->
        <include within="com.alu.motive.smdm.mediation.process.orchestration.process.*" />
        <include within="com.alu.motive.smdm.mediation.process.orchestration.activity.*" />
    </weaver>
    <aspects>
        <aspect name="com.alu.motive.smdm.mediation.process.orchestration.process.TransitionGovernorAspect" />
    </aspects>
</aspectj> 

这是我的jvm args(我起诉Tomcat 8):

-Dcatalina.base="C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="C:\Tomcat\apache-tomcat-8.0.18" -Dwtp.deploy="C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -Djava.endorsed.dirs="C:\Tomcat\apache-tomcat-8.0.18\endorsed" -javaagent:"C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar" -XX:-UseSplitVerifier

这是我的申请背景:

<?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:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- will register load time weaver needed to weave Aspect which controls activity transition,
         TransitionGovernorAspect  -->
    <context:load-time-weaver/>

    <!--  PART 1 – Process Assembly -->
    <aop:config>
        <!-- we are using "bean" pointcut in conjunction with execution pointcut  
             which will allow us to assemble some other process from another instance of
             GenericProcessImpl -->
        <aop:pointcut id="serviceToAssociatePointcut" 
            expression="bean(serviceToAssociate) and 
                execution(void com.alu.motive.smdm.mediation.process.orchestration.process.GenericProcessImpl.execute(..))"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="validateServiceDataFlter" order="1"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="associateServiceInM2MFlter" order="2"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="storeSessionStepFlter" order="3"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="retryFlter" order="4"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="processAsyncResponseFlter" order="5"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="processAsyncErrorResponseFlter" order="6"/>
    </aop:config>

    <!--  PART 2 – Activity Interceptors (Filters) Configuration -->
    <!--  Individual Intercepting filters wired with corresponding 
          Activities and simple Fact rules-->
    <bean id="genericFlter" class="com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor" 
                                                            abstract="true"/>
    <bean id="validateServiceDataFlter" parent="genericFlter">
        <constructor-arg ref="validateServiceDataActivity"/>
        <property name="facts" value="!VALIDATED_SERVICE"/>
    </bean>
    <bean id="associateServiceInM2MFlter" parent="genericFlter">
        <constructor-arg ref="associateServiceInM2MActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,!ASSOCIATED_SERVICE,!STORE_SESSION_ASSOCIATED_SERVICE,!ASSOCIATION_ERROR"/>
    </bean>
    <bean id="storeSessionStepFlter" parent="genericFlter">
        <constructor-arg ref="storeSessionActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,!STORE_SESSION_ASSOCIATED_SERVICE,!ASSOCIATION_ERROR"/>
    </bean>
    <bean id="retryFlter" parent="genericFlter">
        <constructor-arg ref="RetryActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,STORE_SESSION_ASSOCIATED_SERVICE,RETRY"/>
    </bean>
    <bean id="processAsyncResponseFlter" parent="genericFlter">
        <constructor-arg ref="processAsyncResponseActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,STORE_SESSION_ASSOCIATED_SERVICE,!ASYNC_RESPONSE,!ASSOCIATION_ERROR"/>
    </bean>
    <bean id="processAsyncErrorResponseFlter" parent="genericFlter">
        <constructor-arg ref="processAsyncErrorResponseActivity"/>
        <property name="facts" value="!ASYNC_RESPONSE,ACTIVITY_ERROR,!ASYNC_ERROR_RESPONSE"/>
    </bean>

    <!--  PART 3 – POJO Activities -->
    <bean id="validateServiceDataActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity"/>
    <bean id="associateServiceInM2MActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity"/>
    <bean id="storeSessionActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.StoreSessionActivity"/>
    <bean id="RetryActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.RetryActivity"/>
    <bean id="processAsyncResponseActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.ProcessAsyncResponseActivity"/>
    <bean id="processAsyncErrorResponseActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.ProcessAsyncErrorResponseActivity"/>
</beans>

以下是应用程序的跟踪:

févr. 27, 2015 10:22:01 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
AVERTISSEMENT: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Cpmv215' did not find a matching property.
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server version:        Apache Tomcat/8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server built:          Jan 23 2015 11:56:07 UTC
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server number:         8.0.18.0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Name:               Windows 7
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Version:            6.1
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Architecture:          amd64
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Java Home:             C:\Program Files\Java\jre7
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Version:           1.7.0_75-b13
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Vendor:            Oracle Corporation
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_BASE:         C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_HOME:         C:\Tomcat\apache-tomcat-8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.base=C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.home=C:\Tomcat\apache-tomcat-8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dwtp.deploy=C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Djava.endorsed.dirs=C:\Tomcat\apache-tomcat-8.0.18\endorsed
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -javaagent:C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -XX:-UseSplitVerifier
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dfile.encoding=Cp1252
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFOS: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Oracle_universal\10_32;C:\Program Files\TortoiseSVN\bin;C:\ProgramFiles\nodejs\;C:\PCRefresh\oracle\instantclient\instantclient_11_2;C:\ProgramFiles\ApacheSoftwareFoundation\apache-maven-3.2.1\bin;C:\Program Files (x86)\CVSNT\;C:\Program Files\Java\jdk1.8.0_05\bin;C:\Users\claveri1\AppData\Roaming\npm;C:\ProgramFiles\nodejs;C:\PCRefresh\oracle\instantclient\instantclient_12_1;.
févr. 27, 2015 10:22:02 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-nio-8080"]
févr. 27, 2015 10:22:02 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
févr. 27, 2015 10:22:02 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["ajp-nio-8009"]
févr. 27, 2015 10:22:02 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 886 ms
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.StandardService startInternal
INFOS: Démarrage du service Catalina
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet Engine: Apache Tomcat/8.0.18
févr. 27, 2015 10:22:02 PM org.apache.jasper.servlet.TldScanner scanJars
INFOS: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
févr. 27, 2015 10:22:02 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFOS: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [182] milliseconds.
2015-02-27 22:22:16,310 [localhost-startStop-1] WARN  org.apache.axis2.transport.http.AxisAdminServlet - line:39 - Web application uses org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to use org.apache.axis2.webapp.AxisAdminServlet instead
2015-02-27 22:22:19,705 [localhost-startStop-1] WARN  org.apache.axis2.transport.http.AxisServlet - line:165 - No transportReceiver for org.apache.axis2.transport.http.AxisServletListener found. An instance for HTTP will be configured automatically. Please update your axis2.xml file!
févr. 27, 2015 10:22:19 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["http-nio-8080"]
févr. 27, 2015 10:22:19 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["ajp-nio-8009"]
févr. 27, 2015 10:22:19 PM org.apache.catalina.startup.Catalina start
INFOS: Server startup in 17470 ms
2015-02-27 22:22:34,987 [http-nio-8080-exec-3] INFO  com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:64 - associateService: beg - responseURI=http://localhost:8882/foo - endpointId=myEndPointId - sgwId=mySgwId - serviceID=myServiceId - serviceDeliveryID=mySDid
2015-02-27 22:22:34,988 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:71 - first check input parameters
2015-02-27 22:22:34,989 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:99 - All mandatory parameters found
2015-02-27 22:22:34,989 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:100 - Instanciating service from input parameters
2015-02-27 22:22:34,991 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:107 - transaction id generated is: mPqRdhR5ASWc7bBB
2015-02-27 22:22:34,992 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:113 - Service LCS is null with errorSubCode=null
2015-02-27 22:22:34,992 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:114 - set synchronous answer to OK since there is no additional check
2015-02-27 22:22:34,993 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:129 - Launch the association orchestration
2015-02-27 22:22:35,001 [http-nio-8080-exec-3] INFO  com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:176 - associateService: end (return the synchronous response)
2015-02-27 22:22:35,019 [Thread-8] DEBUG com.alu.motive.if_dm_sm.ThreadForAssociateService - line:22 - Begin of ThreadForAssociateService:run
2015-02-27 22:22:35,020 [Thread-8] DEBUG com.alu.motive.if_dm_sm.ThreadForAssociateService - line:27 - Load application configuration: application-config-associateService.xml
[TomcatInstrumentableClassLoader@4dee3a29] info AspectJ Weaver Version 1.8.5 built on Thursday Jan 29, 2015 at 01:03:58 GMT
[TomcatInstrumentableClassLoader@4dee3a29] info register classloader org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader@4dee3a29
[TomcatInstrumentableClassLoader@4dee3a29] info using configuration /C:/PCRefresh/workspace-luna/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Cpmv215/WEB-INF/classes/META-INF/aop.xml
[TomcatInstrumentableClassLoader@4dee3a29] info using configuration file:/C:/PCRefresh/workspace-luna/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Cpmv215/WEB-INF/lib/spring-aspects-4.1.4.RELEASE.jar!/META-INF/aop.xml
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect com.alu.motive.smdm.mediation.process.orchestration.process.TransitionGovernorAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.transaction.aspectj.AnnotationTransactionAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.cache.aspectj.AnnotationCacheAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.cache.aspectj.JCacheCacheAspect
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.TargetSource'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.TargetClassAware'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator$BeanFactoryAdvisorRetrievalHelperAdapter'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.AdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.UnknownAdviceTypeException'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 
...
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.BeforeAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.AfterReturningAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.AfterAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.ThrowsAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.TrueMethodMatcher'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.support.MethodMatchers'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.ReflectiveMethodInvocation'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.ProxyMethodInvocation'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.InterceptorAndDynamicMethodMatcher'
2015-02-27 22:22:39,142 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:47 - >>>> Executing com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:51 - >>>> with Facts 
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity - line:17 - Checking service data (nothing to check)
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:47 - >>>> Executing com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:51 - >>>> with Facts VALIDATED_SERVICE
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity - line:42 - AssociateServiceInFM2SActivity:process - BEG
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'com.sun.jersey.api.client.Client'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'com.sun.jersey.api.client.ClientHandler'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'com.sun.jersey.api.client.filter.Filterable'

我的问题:

我自己的类(com.alu.motive.smdm.mediation.process.orchestration.activity。*)从未编织过。 建议将有助于理解我的问题。

3 个答案:

答案 0 :(得分:2)

我已经解决了我的问题。 我的jvm论点是错误的。请注意,更正时,类会在开始时加载,而不仅仅是在应用程序上下文加载期间加载。 之前,我的jvm arg包括:

-javaagent:C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar

更正是将其设置如下:

-javaagent:"C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\aspectjweaver.jar"

答案 1 :(得分:0)

Tomcat需要扫描类路径以查找带有Servlet 3.0注释的类,它通过加载所有类来完成。因为这是在Spring配置AspectJ之前发生的,所以你的类不会被编织。有两种方法可以解决这个问题:在web.xml中指定Servlet 2.5,或在web.xml中将metadata-complete="true"添加到<web-app>。如果您正在使用Servlet 3.0注释(@Servlet等),那么就会让您陷入困境--AFAIK无法在Tomcat上将LTW与Servlet 3.0注释结合起来。

答案 2 :(得分:0)

感谢

这是我在更改之前的web.xml。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://java.sun.com/xml/ns/javaee" 
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
            id="WebApp_ID" 
            version="2.5">
  <display-name>Cpmv215</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    <welcome-file>/axis2-web/index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <display-name>Apache-Axis Admin Servlet Web Admin</display-name>
    <servlet-name>AxisAdminServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisAdminServlet</servlet-name>
    <url-pattern>/axis2-admin/*</url-pattern>
  </servlet-mapping>
</web-app>

以下是您建议的更改后web.xml的开头:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://java.sun.com/xml/ns/javaee" 
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
            id="WebApp_ID" 
            version="2.5"
        metadata-complete="true">

但是,我有同样的痕迹。 Spring从不试图编织自己的类。

相关问题