对于想了解杰克逊ObjectMapper的读者,本文将是一篇不可错过的文章,我们将详细介绍构造函数抛出NoSuchMethod,并且为您提供关于android–View.setBackground抛出
对于想了解杰克逊ObjectMapper的读者,本文将是一篇不可错过的文章,我们将详细介绍构造函数抛出NoSuchMethod,并且为您提供关于android – View.setBackground抛出NoSuchMethodError、android – 实现扩展/自定义View为构造函数抛出NoSuchMethod、Apache Camel抛出java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull、AspectJ + Junit + Maven-测试中识别出切入点,但抛出NoSuchMethodError:AspectOf()异常的有价值信息。
本文目录一览:- 杰克逊ObjectMapper()构造函数抛出NoSuchMethod(杰克逊算法)
- android – View.setBackground抛出NoSuchMethodError
- android – 实现扩展/自定义View为构造函数抛出NoSuchMethod
- Apache Camel抛出java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull
- AspectJ + Junit + Maven-测试中识别出切入点,但抛出NoSuchMethodError:AspectOf()异常
杰克逊ObjectMapper()构造函数抛出NoSuchMethod(杰克逊算法)
我正在使用Jackson示例代码对POJO进行反序列化:
ObjectMapper m = new ObjectMapper();
这行抛出一个NoSuchMethodError:
Exception in thread "main" java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.<init>(Ljava/lang/Class;)V at org.codehaus.jackson.map.type.TypeBase.<init>(TypeBase.java:15) at org.codehaus.jackson.map.type.SimpleType.<init>(SimpleType.java:45) at org.codehaus.jackson.map.type.SimpleType.<init>(SimpleType.java:40) at org.codehaus.jackson.map.type.TypeBindings.<clinit>(TypeBindings.java:18) at org.codehaus.jackson.map.type.TypeFactory._fromType(TypeFactory.java:525) at org.codehaus.jackson.map.type.TypeFactory.type(TypeFactory.java:61) at org.codehaus.jackson.map.ObjectMapper.<clinit>(ObjectMapper.java:179) at com.me.util.ctrl.BillingJobStatus.fromJson(BillingJobStatus.java:37)
我不明白
答案1
小编典典我猜您的Jackson JAR不同步。本JavaType
类是jackson-core
JAR,和ObjectMapper
类是在jackson-mapper
。
确保它们都是相同的版本。
android – View.setBackground抛出NoSuchMethodError
参见英文答案 > setBackground vs setBackgroundDrawable (Android) 12个
以下代码:
View inflate = inflater.inflate(R.layout.page, null);
Drawable img = getResources().getDrawable((Integer) (item.get("img")));
inflate.findViewById(R.id.page_img).setBackground(img);
产生以下错误:
java.lang.NoSuchMethodError:android.view.View.setBackground
我不知道为什么.我已经用R.drawable.img尝试了setBackground但是我得到了同样的错误.
解决方法:
此方法在API级别16中引入,您很可能在较早的版本上运行:
http://developer.android.com/reference/android/view/View.html#setBackground(android.graphics.drawable.Drawable)
使用setBackgroundDrawable()
android – 实现扩展/自定义View为构造函数抛出NoSuchMethod
public class DynamicGeometryTextView extends TextView { public DynamicGeometryTextView (Context con) { super(con); } public DynamicGeometryTextView (Context con,AttributeSet attrs) { super(con,attrs); } public DynamicGeometryTextView (Context con,AttributeSet attrs,int style) { super(con,attrs,style); }
这是一个非静态内部类,因为它需要从外部类访问实例数据.它出现在.xml布局中:
<viewhttps://www.jb51.cc/tag/dis/" target="_blank">dis.chalkboard.displayText$DynamicGeometryTextView" android:id="@+id/chalkboard" android:layout_width="wrap_content" android:layout_height="wrap_content" />
一切都编译和安装很好,但在运行时:
Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class cogdis.chalkboard.displayText$DynamicGeometryTextView at android.view.LayoutInflater.createView(LayoutInflater.java:596) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256) at android.app.Activity.setContentView(Activity.java:1867) at cogdis.chalkboard.displayText.onCreate(displayText.java:26) at android.app.Activity.performCreate(Activity.java:5008) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2023) ... 11 more Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context,interface android.util.AttributeSet] at java.lang.class.getConstructorOrMethod(Class.java:460) at java.lang.class.getConstructor(Class.java:431) at android.view.LayoutInflater.createView(LayoutInflater.java:561) ... 22 more
在我看来,这意味着它无法找到构造函数的(Context,AttributeSet)版本……但它存在.我看了一些其他的SO帖子,比如Android Custom View Constructor,这一切都指向了相同的结论(我的眼睛),并反复阅读自定义组件的API指南,但我已经被这个问题困扰了一个多小时.
有人有主意吗?有没有办法进一步调试?
对于像我这样的新手来说,如果你的自定义视图在XML布局中被引用,那么非静态内部类是不行的,但是如果你以编程方式创建它,它可以工作,例如:
LayoutInflater lif = getLayoutInflater(); ViewGroup layout = (ViewGroup)lif.inflate(R.layout.board,null); tv = new DynamicGeometryTextView(this); layout.addView((View)tv);
在这种情况下,您只需要匹配实际使用的构造函数.可以通过从View继承的setLayoutParams()在构造函数中设置布局参数(WRAP_CONTENT等).
解决方法
OuterClass.InnerClass innerObject = outerObject.new InnerClass();
所以这可能是布局填充无法给你的课堂膨胀的原因.删除对外部类成员的引用后,使您的类保持静态.
Apache Camel抛出java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull
我有一个时髦的剧本,我正试着去;它的工作是读取一个消息队列,然后将消息重新排队到我们正在运行的一组新MQ中.
这是代码:
@Grab(group='org.apache.camel', module='camel-core', version='2.11.0')
@Grab(group='org.apache.activemq', module='activemq-core', version='5.7.0')
@Grab(group='org.apache.activemq', module='activemq-camel', version='5.8.0')
@Grab(group='ch.qos.logback', module='logback-classic', version='1.0.13')
import org.apache.activemq.camel.component.ActiveMQComponent
import org.apache.activemq.ActiveMQConnectionFactory
import org.apache.camel.CamelContext
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.impl.DefaultCamelContext
class copyFromOneserverToAnother extends RouteBuilder{
public static void main(String[] args) {
final CamelContext camelContext = new DefaultCamelContext();
camelContext.addComponent("jms-01", ActiveMQComponent.activeMQComponent("tcp://mq01:61616"));
try {
// Add the routes defined below to the camel context
camelContext.addRoutes(new copyFromOneserverToAnother());
camelContext.start();
Thread.sleep(10000000);
}
catch (final Exception e) {
e.printstacktrace();
}
finally {
try {
camelContext.stop();
}
catch (final Exception e) {
e.printstacktrace();
}
}
}
@Override
public void configure() throws Exception {
/// The name of the AMQ instance and queue where message will be taken from
from("jms-01:TEST-1")
.log("Processed")
// Final resting point for each message.
.to("jms-01:TEST-3")
.end();
}
}
因此,这是使用相同的代理来源和目标,但不同的队列.
这会读取消息,但在尝试编写消息时会抛出异常:
15:15:31.548 [Camel (camel-1) thread #0 - JmsConsumer[TEST-1]] INFO route1 - Processed
15:15:31.548 [Camel (camel-1) thread #0 - JmsConsumer[TEST-1]] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[jms-01://TEST-3] Exchange[JmsMessage[JmsMessageID: ID:mq01.dummycorp.corp-60083-1370438794752-5:131:1:1:1]]
15:15:31.594 [Camel (camel-1) thread #0 - JmsConsumer[TEST-1]] DEBUG o.a.c.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID:mq01.dummycorp.corp-60083-1370438794752-5:131:1:1:1 on ExchangeId: ID-ukm038662-local-53821-1370441730008-0-10). On delivery attempt: 0 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[JmsMessage[JmsMessageID: ID:mq01.dummycorp.corp-60083-1370438794752-5:131:1:1:1]]
15:15:31.595 [Camel (camel-1) thread #0 - JmsConsumer[TEST-1]] ERROR o.a.c.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID:mq01.dummycorp.corp-60083-1370438794752-5:131:1:1:1 on ExchangeId: ID-ukm038662-local-53821-1370441730008-0-10). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[JmsMessage[JmsMessageID: ID:mq01.dummycorp.corp-60083-1370438794752-5:131:1:1:1]]
org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[JmsMessage[JmsMessageID: ID:mq01.dummycorp.corp-60083-1370438794752-5:131:1:1:1]]
at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1354) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:272) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:137) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) ~[camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) [camel-core-2.11.0.jar:2.11.0]
at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104) [camel-jms-2.10.3.jar:2.10.3]
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncmessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncmessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1063) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncmessageListenerInvoker.run(DefaultMessageListenerContainer.java:960) [spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21]
Caused by: java.lang.NoSuchMethodError: org.apache.camel.util.ObjectHelper.notNull(Ljava/lang/Object;Ljava/lang/String;)V
at org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:285) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsProducer$2.createMessage(JmsProducer.java:270) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsConfiguration$Cameljmstemplate.doSendToDestination(JmsConfiguration.java:216) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsConfiguration$Cameljmstemplate.access$100(JmsConfiguration.java:159) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsConfiguration$Cameljmstemplate$1.doInJms(JmsConfiguration.java:173) ~[camel-jms-2.10.3.jar:2.10.3]
at org.springframework.jms.core.jmstemplate.execute(jmstemplate.java:466) ~[spring-jms-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.apache.camel.component.jms.JmsConfiguration$Cameljmstemplate.send(JmsConfiguration.java:170) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:402) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:356) ~[camel-jms-2.10.3.jar:2.10.3]
at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:132) ~[camel-jms-2.10.3.jar:2.10.3]
... 49 common frames omitted
解决方法:
我只是偶然发现了同样的问题.添加此依赖项:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
我的pom修好了.没有它,使用了一个较旧的(比我的其他骆驼库)版本的库 – 正如克劳斯在另一个答案中所建议的那样
AspectJ + Junit + Maven-测试中识别出切入点,但抛出NoSuchMethodError:AspectOf()异常
我在这里关注了几乎所有的JUnit + Maven + AspectJ问题,即使我很确定自己设置的都正确,我也无法对其进行测试。
我只有一个方面的Maven模块:
@Aspectpublic class AssertionAspect { @Pointcut("execution(@org.junit.Test * *())") public void testMethodEntryPoint() {} @Before("testMethodEntryPoint()") public void executeBeforeEnteringTestMethod() { System.out.println("EXECUTE ACTION BEFORE ENTERING TEST METHOD"); } @After("testMethodEntryPoint()") public void executeAfterEnteringTestMethod() { System.out.println("EXECUTE ACTION AFTER ENTERING TEST METHOD"); }}
非常简单。我想做的就是在我的测试项目中每次执行任何测试方法之前和之后执行一些用注释的操作@Test
。
现在,我使用aspectj-maven-plugin
我的<build>
是这样的:
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.4</version> <configuration> <aspectLibraries> <aspectLibrary> <groupId>my.package</groupId> <artifactId>with-aspects</artifactId> </aspectLibrary> </aspectLibraries> <source>1.6</source> <target>1.6</target> </configuration> <executions> <execution> <goals> <goal>test-compile</goal> </goals> <configuration> <showWeaveInfo>true</showWeaveInfo> </configuration> </execution> </executions> </plugin> </plugins></build>
1)我没有compile
目标,<execution>
因为我没有课程src/main/java
(是的,没关系,我知道我在做什么)
2)我有
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.7.3</version></dependency><dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.7.3</version></dependency>
在我的<dependencies>
部分 关于aspectj,仅此而已。
3)我确定我的测试课程被Aspectj认可,因为我发现建议使用连接点。我懂了:
Join point ''method-execution(xyz)'' in Type ''blabla'' (AppTestCase.java:124) advised by before advice from ''blabla'' (my-aspects jar.jar!AssertionAspect.class(from AssertionAspect.java))
事后建议也一样。
4)当我试图1.7.3版本,而不是1.6.11,这个消息似乎我,而连接点进行了处理:expected 1.6.11 found1.7.3
。我想这是来自aspectj-maven-plugin
1.4版的消息,我真的不知道何时发布1.5版来摆脱这一点。哪些版本兼容?
5)我的“代码”如下所示:)
@RunWith(JUnit4.class)public class TestClass() { @Test public void test01(){ }}
6)我有1.6.0_39 Oracle Java编译器,我正在用1.6编译所有内容(目标,源..全部)
因此,在认可,应用的方面,我将执行类似的测试,mvn clean test
但我得到的只是:
java.lang.NoSuchMethodError: my/aspect/AssertionAspect.aspectOf()Lmy/aspect/AssertionAspect;
和相当长的stacktrace。
我没有 任何 东西可能是错误的线索,真的。
答案1
小编典典所以,诀窍是用我的方面而不是javac而是ajc
(aka Aspectj-maven-plugin)编译该库
而已。我只需要将其与方面一起添加到Maven模块中(它们在src / main / java中)
方面都标注了注释,因此您 必须 具有1.6的源/目标/合规级别
ASPECTJ模块
<!-- Build --><build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.4</version> <configuration> <source>1.6</source> <target>1.6</target> <complianceLevel>1.6</complianceLevel> <verbose>true</verbose> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> <dependencies> </dependencies> </plugin> </plugins></build>
您不必将此模块作为测试依赖项添加到您要在其中使用方面的目标模块中
目标模块
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.4</version> <configuration> <aspectLibraries> <aspectLibrary> <groupId>that-artifact</groupId> <artifactId>mentioned-above</artifactId> </aspectLibrary> </aspectLibraries> <source>1.6</source> <target>1.6</target> <complianceLevel>1.6</complianceLevel> </configuration> <executions> <execution> <goals> <goal>test-compile</goal> </goals> <configuration> <showWeaveInfo>true</showWeaveInfo> </configuration> </execution> </executions> </plugin> </plugins> </build>
您必须在各处使用1.6级
关于杰克逊ObjectMapper和构造函数抛出NoSuchMethod的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于android – View.setBackground抛出NoSuchMethodError、android – 实现扩展/自定义View为构造函数抛出NoSuchMethod、Apache Camel抛出java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull、AspectJ + Junit + Maven-测试中识别出切入点,但抛出NoSuchMethodError:AspectOf()异常等相关知识的信息别忘了在本站进行查找喔。
本文标签: