English 中文(简体)
• 弹道试验
原标题:AspectJ :: Surefire tests gives NoSuchMethodError

我正在编辑AspectJ在现有课堂上挖掘的时间,这在剪辑中是美丽的。 但是,当我用定点火在ven夜中进行测试时,这一类的试验案例在适用方面已经失败。 我确信,挖掘工作正在正确进行,它像一个阶级道路问题一样。 下面是我进行定点火试验时的错误。

java.lang.NoSuchMethodError: com.online.station.OBSDescriptorBrokerageMortgageRemovalAspect.aspectOf()Lcom/online/station/OBSDescriptorBrokerageMortgageRemovalAspect; at com.online.station.delegate.fundstransfer.AuthorizeAccForTransfDelegImpl.unpackResponse(AuthorizeAccForTransfDelegImpl.java:111)

下面是我定点火的火.。

        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <forkMode>once</forkMode>
                <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                </argLine>
                <useSystemClassloader>true</useSystemClassloader>
                <includes>
                    <include>**/*Test.java</include>
                </includes>
                <excludes>
                    <exclude>**/WebTestCase.java</exclude>
                </excludes>
            </configuration>
        </plugin>

我尝试了各种事情,但做了一些工作,任何建议都将受到极大赞赏!

Is there any need to have a aop.xml for this to work ? Following is the aspectj plugin info.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
    <verbose>true</verbose>
    <complianceLevel>${jdk.source.version}</complianceLevel>
    <target>${jdk.target.version}</target>
    <showWeaveInfo>true</showWeaveInfo>
    <weaveMainSourceFolder>true</weaveMainSourceFolder>
    <includes>
        <!-- Class AspectClass1 and dependencies -->
        <include>**/AspectClass1*</include>
        <include>**/Class2*</include>
        <include>**/Class3*</include>
        <include>**/Class4*</include>
        <include>**/Class5*</include>
        <include>**/Class6*</include>
        <include>**/Class7*</include>
        <include>**/Class8*</include>

    </includes>
</configuration>
<executions>
    <execution>
    <goals>
        <goal>compile</goal>                <goal>test-compile</goal>       </goals>
    </execution>
   </executions>

由于我只需要编篡时间,我没有编织物。

Any Any

Thanks !! Girish

问题回答

三项建议:

  1. Make sure that your aspectj plugin for maven is configured correctly. If you have any questions about that, paste that part of your pom.xml in your question above.
  2. Make sure that your aop.xml references all of the required aspects.
  3. Make sure that your aspect-path/in-path is configured properly.




相关问题
spring 3 AOP anotated advises

Trying to figure out how to Proxy my beans with AOP advices in annotated way. I have a simple class @Service public class RestSampleDao { @MonitorTimer public Collection<User> ...

Wicket with Spring declarative transaction

It is possible to use the Spring Framework s @Transactional support outside of a Spring container. In reference documentation is chapter about AspectJ aspect. I m trying to use it in my wicket ...

handling multiple Aspects in AspectJ

I have a query, when im using multiple Aspects in my aop.xml. here s the problem. i have defined some <include> and <exclude> in my <weaver>. i have 3 aspects in my aop file. i need ...

Polymorphism in AspectJ

I am trying to decide which is the better way to dispatch on a type in AspectJ. Suppose I am performing a computation on a tree with three kinds of nodes. I could then write a simple Java method: ...

热门标签