标签: nosuchmethoderror

我们什么时候得到java.lang.NoSuchMethodError,即使jar /类有特定的方法

我正在使用IText库来促进applet中的pdf导出.在导出调用期间,它失败并出现以下错误:

java.lang.NoSuchMethodError: com.lowagie.text.pdf.PdfPTable.completeRow()V
Run Code Online (Sandbox Code Playgroud)

我在JD Decompiler中打开了Itext jar/PdfPtable.class,并确认该类具有completeRow作为公共方法.

有人可以解释一下java.lang.NoSuchMethodError即使jar/class有它时抛出a的可能场景吗?

这是堆栈跟踪; 可能不是很有用,因为大多数调用都是我们的应用程序特定的.

导出到CSV文件时出错 - java.lang.NoSuchMethodError:com.lowagie.text.pdf.PdfPTable.completeRow()V
com.blox.table.action.ExportToCSVAction.actionPerformed(ExportToCSVAction.java:193)
javax.swing. AbstractButton.fireActionPerformed(Unknown Source)
javax.swing.AbstractButton $ Handler.actionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
javax.swing.plaf.basic. BasicButtonListener.mouseReleased(未知来源)
java.awt.Component.processMouseEvent(未知来源)
javax.swing.JComponent.processMouseEvent(未知来源)
java.awt.Component.processEvent(未知来源)
java.awt.Container.processEvent(未知来源) )
java.awt.Component.dispatchEventImpl(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
java.awt.LightweightDispatcher .processMouseEve nt(未知来源)
java.awt.LightweightDispatcher.dispatchEvent(未知来源)
java.awt.Container.dispatchEventImpl(未知来源)
java.awt.Window.dispatchEventImpl(未知来源)
java.awt.Component.dispatchEvent(未知来源)
java .awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents (未知来源)
java.awt.EventDispatchThread.pumpEvents(未知来源)
java.awt.EventDispatchThread.run(未知来源)
com.lowagie.text.pdf.PdfPTable.completeRow()V
com.blox.table.view.GridTableModel $ PdfExportWriter.writeNewLine(GridTableModel.java:7259)
com.blox.table.view.GridTableModel.buildExportData(GridTableModel.java:3111)
com.blox.table.view.GridTableModel.export(GridTableModel.java:2541)
com.blox. table.view.GridTable.export(GridTable.java:1318)
com.blox.table.ac .ExportToCSVAction.exportToFile(ExportToCSVAction.java:248)
com.blox.table.action.ExportToCSVAction.access $ 1(ExportToCSVAction.java:245)
com.blox.table.action.ExportToCSVAction $ Worker.exportToCSVFile(ExportToCSVAction.java:111 )
sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
sun.reflect.NativeMethodAccessorImpl.invoke(来源不明) …

java applet nosuchmethoderror

10
推荐指数
3
解决办法
3万
查看次数

Flutter-该方法在null上被调用

我正在编写一个应用程序,该应用程序通过一个水平方向listView和一个垂直方向在同一视图中显示两个媒体流listView。我目前正在listView使用一些漂亮的样板实现信息的底层,可以在这里找到。

我是新手,相信我的代码有些混乱,总之,我收到了错误;

flutter: The following NoSuchMethodError was thrown building Builder:
flutter: The method 'loadCurrencies' was called on null.
flutter: Receiver: null
flutter: Tried calling: loadCurrencies()
Run Code Online (Sandbox Code Playgroud)

试图执行代码时,发现这里home_page_view.dart到上述样板。

这是我用来激发错误的代码;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:to_be_deleted/data/crypto_data.dart';
import 'package:to_be_deleted/modules/crypto_presenter.dart';
import 'dart:async';
import 'dart:io';
import 'background.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
  title: 'Flutter Demo',
  theme: new ThemeData(
    primarySwatch: Colors.blue,
  ), …
Run Code Online (Sandbox Code Playgroud)

nosuchmethoderror dart flutter flutter-layout

10
推荐指数
2
解决办法
3万
查看次数

春季启动:java.lang.NoSuchMethodError:javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax / servlet / http / HttpServletMapping;

当我在内置服务器或其他tomcat服务器上运行此应用程序时,它显示以下错误消息。我正在使用jdk8,STS V-3.9.7。有人可以帮我解决吗

具有以下内容的简单Springboot应用程序:

用于视图映射的application.properties文件

    spring.mvc.view.prefix=/WEB-INF/jspViews/
    spring.mvc.view.suffix=.jsp
Run Code Online (Sandbox Code Playgroud)

index.jsp

    <body>
       <h3>Application is working</h3>
     </body>
Run Code Online (Sandbox Code Playgroud)

控制器类

    @Controller
    public class AppController {    
       @RequestMapping("/")
       public String indexPage() {
           return "index";
       }
    }
Run Code Online (Sandbox Code Playgroud)

pom.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>  
    <groupId>com.demo</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>ehospitalsso</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins> …
Run Code Online (Sandbox Code Playgroud)

java spring-mvc nosuchmethoderror spring-boot

10
推荐指数
3
解决办法
7233
查看次数

当我使用android.widget.RelativeLayout.setBackground时,NoSuchMethodError

在Android 4.2我的应用程序工作正常,但当我尝试使用Android 4.0.4测试它我有这个消息错误:

04-16 15:06:46.601: E/AndroidRuntime(3844): java.lang.NoSuchMethodError: android.widget.RelativeLayout.setBackground
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at com.myapp.MainActivity.cambiarPagina(MainActivity.java:271)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at com.myapp.MainActivity.cambiarPagina(MainActivity.java:119)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at com.myapp.MainActivity.access$0(MainActivity.java:116)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at com.myapp.MainActivity$2.onClick(MainActivity.java:70)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at android.view.View.performClick(View.java:3524)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at android.view.View$PerformClick.run(View.java:14202)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at android.os.Handler.handleCallback(Handler.java:605)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at android.os.Handler.dispatchMessage(Handler.java:92)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at android.os.Looper.loop(Looper.java:137)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at android.app.ActivityThread.main(ActivityThread.java:4499)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at java.lang.reflect.Method.invokeNative(Native Method)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at java.lang.reflect.Method.invoke(Method.java:511)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
    04-16 15:06:46.601: E/AndroidRuntime(3844):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
    04-16 …
Run Code Online (Sandbox Code Playgroud)

android nosuchmethoderror

9
推荐指数
2
解决办法
1万
查看次数

java.lang.NoSuchMethodError:org.springframework.http.MediaType.getCharset()Ljava/nio/charset/Charset

当我试图TestNG通过我的测试来运行我的测试antjava.lang.NoSuchMethodError: org.springframework.http.MediaType.getCharset()Ljava/nio/charset/Charset(参见下面的完整例外)

我编译或运行我的Web应用程序没有问题,但无法通过ant运行测试.我很确定这是一个类加载问题,但不确定应该在运行时加载什么类加载.我正在使用Spring 4.3.1和Spring Security 4.1.1.

是否有特定的顺序加载我的罐子,以便使用"正确"的版本org.springframework.http.MediaType

[testng] org.testng.TestNGException: 
   [testng] An error occurred while instantiating class com.avada.rest.api.GroupsIntTest: org.springframework.http.MediaType.getCharset()Ljava/nio/charset/Charset;
   [testng]     at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:388)
   [testng]     at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:290)
   [testng]     at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:125)
   [testng]     at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:191)
   [testng]     at org.testng.TestClass.getInstances(TestClass.java:104)
   [testng]     at org.testng.TestClass.initTestClassesAndInstances(TestClass.java:90)
   [testng]     at org.testng.TestClass.init(TestClass.java:82)
   [testng]     at org.testng.TestClass.<init>(TestClass.java:45)
   [testng]     at org.testng.TestRunner.initMethods(TestRunner.java:409)
   [testng]     at org.testng.TestRunner.init(TestRunner.java:247)
   [testng]     at org.testng.TestRunner.init(TestRunner.java:217)
   [testng]     at org.testng.TestRunner.<init>(TestRunner.java:161)
   [testng]     at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:555)
   [testng]     at org.testng.SuiteRunner.init(SuiteRunner.java:168)
   [testng]     at org.testng.SuiteRunner.<init>(SuiteRunner.java:117)
   [testng]     at org.testng.TestNG.createSuiteRunner(TestNG.java:1359)
   [testng]     at org.testng.TestNG.createSuiteRunners(TestNG.java:1346)
   [testng]     at org.testng.TestNG.runSuitesLocally(TestNG.java:1200) …
Run Code Online (Sandbox Code Playgroud)

java ant spring nosuchmethoderror

9
推荐指数
1
解决办法
1万
查看次数

Java:更通用的方法签名给我一个NoSuchMethodError

有一个罐子,当它被创建时应该使用一种方法MyClass.doSomething(List).此方法已更改为doSomething(Collection)并放入另一个jar(仅限此类).

我把第二个jar放在classpath的第一个jar前面,但是当我的第一个jar中的代码MyClass.doSomething()用List 调用时,我仍然得到一个

java.lang.NoSuchMethodError: MyClass.doSomething(Ljava/util/List;)Ljava/util/List;

怎么可能?Ant已被用于编译jar.

java signature nosuchmethoderror

8
推荐指数
2
解决办法
2741
查看次数

Jetty 9.0嵌入式和RestEasy 3.0不断抛出NoSuchMethodError

今天我有了构建一个非常简单的Web应用程序的想法,该应用程序将由REST后端提供支持.因为我想要一个非常轻量级的服务器,所以我开始关注Jetty.因为我想尝试另一个JAX-RS实现而不是Jersey我看了RestEasy.我认为这两个很容易实现.我错了...

我导入了基本的Jetty服务器和servlet依赖项,因为我认为这是基本(仅限REST)Jetty服务器的唯一服务器要求(我总是尝试使用webapp依赖项;这给出了相同的错误).

<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>9.0.0.RC0</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlet</artifactId>
    <version>9.0.0.RC0</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlets</artifactId>
    <version>9.0.0.RC0</version>
    <scope>compile</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

然后我导入了基本的RestEasy依赖项.

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxrs</artifactId>
    <version>3.0.1.Final</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxb-provider</artifactId>
    <version>3.0.1.Final</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>async-http-servlet-3.0</artifactId>
    <version>3.0.1.Final</version>
    <scope>compile</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

主要方法:

public class ExampleActivator {
    public static void main(String args[]) throws Exception {
        Server server = new Server(8080);
        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
        context.setContextPath("/");
        ServletHolder h = new ServletHolder(new HttpServlet30Dispatcher());
        h.setInitParameter("javax.ws.rs.Application", "packages.ExampleResources");
        context.addServlet(h, "/*");
        server.setHandler(context);
        server.start();
        server.join();
    }
}
Run Code Online (Sandbox Code Playgroud)

ExampleResources:

public …
Run Code Online (Sandbox Code Playgroud)

jetty jax-rs nosuchmethoderror embedded-jetty resteasy

8
推荐指数
2
解决办法
6652
查看次数

Inflating TextView throwing noSuchMethodException on method addFontWeightStyle() during inflate process

Update: I've changed the title to remove the indication that ExoPlayer has anything to do with what is going on as I've managed to duplicate this without it being used at all.

I decided to try and isolate this error on API levels:

I obtained an older Samsung tablet (Tab S2) running Android 7.0 (Api 24), and the error does not occur there.

I am not able to duplicate this problem on a Nexus 6 emulator using API 25

I …

nosuchmethoderror android-inflate layout-inflater android-studio android-typeface

8
推荐指数
1
解决办法
705
查看次数

java.lang.NoSuchMethodError:类 Lcom/facebook/GraphRequest 中没有虚拟方法 setSkipClientToken(Z)V;

在我什么也没做之前,它工作得很好,没有包更新,没有 gradle 更新,没有什么,只是创建了新的构建,并且发生了这个错误。但对于某些团队成员来说,错误发生在 gradle 同步之后。

问题是构建成功生成,没有任何错误,但打开应用程序时突然崩溃(在调试和发布模式下)

错误

    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            at java.lang.Thread.run(Thread.java:923)
Run Code Online (Sandbox Code Playgroud)

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Run Code Online (Sandbox Code Playgroud)

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
  ext {
      buildToolsVersion = "30.0.2"
      minSdkVersion = 21
      compileSdkVersion = 30
      targetSdkVersion = 30 …
Run Code Online (Sandbox Code Playgroud)

android nosuchmethoderror gradle build.gradle react-native

8
推荐指数
1
解决办法
5548
查看次数

Spring MutableValues的NoSuchMethodError

我编写了一个测试,其中我用注释指定了我的应用程序上下文位置.然后我将我的dao自动装入测试中.

@ContextConfiguration(locations = {"file:service/src/main/webapp/WEB-INF/applicationContext.xml"}) 
public class MyTest extends AbstractTestNGSpringContextTests {

@Autowired                                      
protected MyDao myDao;                        

private PlatformTransactionManager transactionManager;
private TransactionTemplate transactionTemplate;      


@Test                                   
public void shouldSaveEntityToDb() { 
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {        
    protected void doInTransactionWithoutResult(TransactionStatus status) { 

    Entity entity = new Entity();

    //test
    myDao.save(entity)

    //assert                                                            
    assertNotNull(entity.getId());                                

  }                                                                       
});                                                                         


}
Run Code Online (Sandbox Code Playgroud)

当我运行测试时,我得到一个异常,表明无法加载应用程序上下文,它归结为:

    Caused by: java.lang.NoSuchMethodError:
    org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;

我不知道从哪里开始寻找,为什么我会收到此错误,我该如何解决?Info springframework 3.0.2.RELEASE,Hibernate 3.4.0.GA,testng 5.9

谢谢!

java testng spring nosuchmethoderror

7
推荐指数
1
解决办法
1万
查看次数