java.lang.NoSuchMethodError

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiashaohua/article/details/79726455
01-15 12:13:22.836  9986  9986 D AndroidRuntime: Shutting down VM
01-15 12:13:22.836  9986  9986 E AndroidRuntime: FATAL EXCEPTION: main
01-15 12:13:22.836  9986  9986 E AndroidRuntime: Process: com.tencent.qt.sns, PID: 9986
01-15 12:13:22.836  9986  9986 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method b()I in class Landroid/net/http/SslError; or its super classes (declaration of 'android.net.http.SslError' appears in /system/framework/framework.jar)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at oicq.wlogin_sdk.quicklogin.d.onReceivedSslError(QuickLoginWebViewActivity.java:175)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at com.android.webview.chromium.Ap.onReceivedSslError(WebViewContentsClientAdapter.java:447)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at org.chromium.android_webview.AwContentsClientBridge$$Lambda$1.run(Unknown Source:2)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:790)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6518)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
01-15 12:13:22.836  9986  9986 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
01-15 12:13:22.837  9986  9986 W MtaSDK  : [main(2): SourceFile:380] - crash happened, but MTA AutoExceptionCaught is desable.
01-15 12:13:22.837  9986  9986 W System.err: java.lang.NoSuchMethodError: No virtual method b()I in class Landroid/net/http/SslError; or its super classes (declaration of 'android.net.http.SslError' appears in /system/framework/framework.jar)
01-15 12:13:22.838  9986  9986 W System.err: at oicq.wlogin_sdk.quicklogin.d.onReceivedSslError(QuickLoginWebViewActivity.java:175)
01-15 12:13:22.838  9986  9986 W System.err: at com.android.webview.chromium.Ap.onReceivedSslError(WebViewContentsClientAdapter.java:447)
01-15 12:13:22.838  9986  9986 W System.err: at org.chromium.android_webview.AwContentsClientBridge$$Lambda$1.run(Unknown Source:2)
01-15 12:13:22.838  9986  9986 W System.err: at android.os.Handler.handleCallback(Handler.java:790)
01-15 12:13:22.838  9986  9986 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
01-15 12:13:22.838  9986  9986 W System.err: at android.os.Looper.loop(Looper.java:164)
01-15 12:13:22.838  9986  9986 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6518)
01-15 12:13:22.838  9986  9986 W System.err: at java.lang.reflect.Method.invoke(Native Method)

01-15 12:13:22.838  9986  9986 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)


1. we can find NoSuchMethodError exception in the log


01-01 01:31:05.279 15621 15621 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method b()I in class Landroid/net/http/SslError; or its super classes (declaration of 'android.net.http.SslError' appears in /system/framework/framework.jar)




2. apk has it's own android.net.http.SslError in the class.dex, not that one in the /system/framework/framework.jar


sslError.class


package android.net.http;


import java.security.cert.X509Certificate;


public class SslError
{
  @Deprecated
  public SslError(int paramInt, SslCertificate paramSslCertificate)
  {
    throw new RuntimeException("Stub!");
  }
...




3. the exception is thrown when call paramSslError.b() by it's onReceivedSslError() of class3.dex, 


d.class


public void onReceivedSslError(WebView paramWebView, SslErrorHandler paramSslErrorHandler, SslError paramSslError)
  {
    util.LOGI("ssl error " + paramSslError.b());
    if (true == QuickLoginWebViewActivity.a)
    {
      paramSslErrorHandler.proceed();
      return;
    }
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.b);
    localBuilder.setMessage("页面证书错误(" + paramSslError.b() + "),是否继续?");
    localBuilder.setPositiveButton("继续", new e(this, paramSslErrorHandler));
    localBuilder.setNegativeButton("取消", new f(this, paramSslErrorHandler));
    AlertDialog localAlertDialog = localBuilder.create();



4. after parsered the class.dex, we can find the class sslError lied in it, but it's method b() is not in it.


method b() defined in sslError.java ,


 public int b()
  {
    throw new RuntimeException("Stub!");
  }




5. after parsered the class3.dex, we can find method b() lied in it's method section, it's index is 570, but it's class does not lie in class3.dex, rather than lie in class.dex, so the ResolveMethod() in the class_linker.cc can't find the method b(), then an exception of NoSuchMethodError is thrown. it's an issue of multidex caused by apk owner.


6.why the issue only found on SDM450?


  then we go back to the callback function onReceivedSslError(),
public void onReceivedSslError(WebView paramWebView, SslErrorHandler paramSslErrorHandler, SslError paramSslError)
  {
    util.LOGI("ssl error " + paramSslError.b());
    if (true == QuickLoginWebViewActivity.a)
    {
      paramSslErrorHandler.proceed();
      return;
    }
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.b);
    localBuilder.setMessage("页面证书错误(" + paramSslError.b() + "),是否继续?");
    localBuilder.setPositiveButton("继续", new e(this, paramSslErrorHandler));
    localBuilder.setNegativeButton("取消", new f(this, paramSslErrorHandler));
    AlertDialog localAlertDialog = localBuilder.create();
    try
    {
      localAlertDialog.show();
      return;
    }
    catch (Exception localException)
    {
    }
  }


 
  we can know issue happened when "页面证书错误", what caused the 页面证书错误?  so many causes, in this case, I found it's caused by system time.


   if we set a wrong system time, pixel8.0/sdm670 will crash also, if the time is right, all devices work well. 


  
  so it's moved to p2-p3 3rd-party classify.





java.lang.NoSuchMethodError:

08-13

[code=Java]件号id:nullrn判断是否给予外键件号:com.whhd.entity.ArticleId@5e9a94rnHibernate: insert into hdData.dbo.articleId (articleId_Name, articleId_ATA) values (?, ?)rn==========-==========rn2009-8-13 11:35:41 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.lang.NoSuchMethodError: com.whhd.biz.ArticleIdBiz.findbyintName(Ljava/lang/String;)Ljava/lang/Integer;rn at com.whhd.struts.action.MainAction.main_doAdd(MainAction.java:140)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rn[/code]rnactionrn[code=XML]public ActionForward main_doAdd(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn System.out.println("+++++++++++++++++++我进了doAdd了");rn // TODO Auto-generated method stub rn HdmainForm hdmainForm = (HdmainForm)form;rn Hdmain hd = new Hdmain();rn ArticleId aid = new ArticleId();rn Corporation cor = new Corporation();rn Hddate hdd = new Hddate();rn rn List list = hdmainBiz.findAll();rnrn rn System.out.println("====================");rn hd.setMainCycle(request.getParameter("hdmainCycle"));//周期rn System.out.println("main_doAdd cycle:"+"+"+hd.getMainCycle());rn rn hd.setMainWarrantyTime(request.getParameter("hdmainWarrantyTime"));//保修期rn System.out.println("warrantyTime:"+hd.getMainWarrantyTime());rn rn hd.setMainManhourTest(request.getParameter("manhourTest"));rn hd.setMainManhourRepair(request.getParameter("manhourRepair"));rn hd.setMainManhourOverhaul(request.getParameter("manhourOverhaul"));rn hd.setMainImmobilityRepair(request.getParameter("immobilityRepair"));rn hd.setMainImmobilityOverhaul(request.getParameter("immobilityOverhaul"));rn hdd.setDateData(request.getParameter("hdDate"));rn hd.setHddate(hdd);rn //给件号跟ATA章节号赋值rn aid.setArticleIdName(request.getParameter("hdmainArticleId"));rn aid.setArticleIdAta(request.getParameter("hdmainAta")); rn String jh = articleIdBiz.findbyId(aid.getArticleIdName()); rn System.out.println("件号id:"+jh);rn //把ID给予查询出返回一个件号rn if(jh == null)//判断是否有这个件号;rn System.out.println("判断是否给予外键件号:"+aid);rn articleIdBiz.addIArticle(aid);//如果没有这个件号系统就会添加这个件号rn System.out.println("==========-==========");rn Integer jhh = articleIdBiz.findbyintName(aid.getArticleIdName());rn //String jhh= articleIdBiz.findbyId(aid.getArticleIdName());rn System.out.println("==========-==========");rn System.out.println("看看jh是否有返回件号ID:"+jhh+"==也要看看有没有:"+aid.getArticleIdName()); rn System.out.println(jhh);rn hd.setArticleId(jhh);//然后在把这个件号给hd的外键给予联系 rn else//如果有返回件号的id给Hmain上的外键赋值rn hd.setArticleId(Integer.parseInt(articleIdBiz.findbyId(aid.getArticleIdName())));rn rn rn System.out.println(articleIdBiz.findbyId(aid.getArticleIdName()));rnrn System.out.println("!!!!!!!!!:"+hd.getArticleId());rn rnrnrn rn System.out.println(aid.getArticleIdAta()+"|"+aid.getArticleIdName());rn rn cor.setCorporationName(request.getParameter("hdmainName"));//添加公司名称rn hd.setCorporation(cor);//添加入外键的公司名称rn Hdmain p = hdmainBiz.findbyCorAndId(cor.getCorporationName(), aid.getArticleIdName());rn rn if (p == null) //来判断是不是有公司名称并且件号同时相等的条件,如果存在说明以添加过rn System.out.println("看看是否能进判断语句");rn System.out.println("HD前一句:"+hd);rn articleIdBiz.addIArticle(aid);rn corporationBiz.addIArticle(cor);rn hddateBiz.addIArticle(hdd);rn hdmainBiz.addHdmain(hd);// TODO 有问题的一句话rn System.out.println("HD后一句:"+hd);rn return mapping.findForward("Add_success");rn else rn return mapping.findForward("Add_Failure");rn rn [/code]

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试