【问题标题】:java.lang.NoSuchMethodError in websphere 7websphere 7中的java.lang.NoSuchMethodError
【发布时间】:2014-01-30 05:10:37
【问题描述】:

我遇到了一个奇怪的问题,

我有一个使用 spring 2.5 开发的网络应用程序。

我将此应用程序部署在 websphere 7 应用程序服务器中。

有两个 websphere 应用程序服务器,应用程序在一个应用程序服务器上运行良好,但在另一个应用程序服务器上它给出了一个奇怪的错误,说明该 web 应用程序正在调用一个不存在的方法。

java.lang.NoSuchMethodError: com.dfn.mtr.mix.beans.PortfolioRecord.getPendingSell()J

应用程序调用的实际方法是,

com.dfn.mtr.mix.beans.PortfolioRecord.getPendingSell()

我在下面附上了部分日志。我在google上搜索问题时找不到任何解决方案,希望你们能给我一些帮助以解决问题。 如果您想了解有关该问题的更多信息,请告诉我。

[1/29/14 17:37:29:457 GMT+03:00] 0000004d LoggingInterc E com.directfn.tradeweb.system.interceptors.LoggingInterceptor afterThrowing Exception in method: calcAssetAllocation Exception is: null In class: class com.directfn.tradeweb.system.service.AccountSummaryService
                             java.lang.NoSuchMethodError: com.dfn.mtr.mix.beans.PortfolioRecord.getPendingSell()J
at com.directfn.tradeweb.system.service.MIXProtocolHelper.toCustomerHolding(MIXProtocolHelper.java:367)
at com.directfn.tradeweb.system.service.AccountSummaryMIXProtocolHelper.toPortfolioServiceResponse(AccountSummaryMIXProtocolHelper.java:150)
at com.directfn.tradeweb.system.service.AccountSummaryService.getPortfolioInternal(AccountSummaryService.java:200)
at com.directfn.tradeweb.system.service.AccountSummaryService.getPortfolio(AccountSummaryService.java:159)
at com.directfn.tradeweb.system.service.AccountSummaryService.calcAssetAllocation(AccountSummaryService.java:250)
at com.directfn.tradeweb.system.service.AccountSummaryService$$FastClassByCGLIB$$4fb54bb2.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:126)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
at com.directfn.tradeweb.system.service.AccountSummaryService$$EnhancerByCGLIB$$f497980b.calcAssetAllocation(<generated>)
at com.directfn.tradeweb.plugins.inquiry.AccountSummaryPlugin.handleRequest(AccountSummaryPlugin.java:95)
at com.directfn.tradeweb.system.controllers.MainController.handleRequest(MainController.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:126)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy100.handleRequest(Unknown Source)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1658)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1598)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)
at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:270)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:80)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:935)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:503)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:875)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)

问候, 兰加纳

【问题讨论】:

    标签: java jakarta-ee spring-mvc spring-webflow websphere-7


    【解决方案1】:

    在大多数情况下,这意味着您的jar版本不是对应的。
    您需要验证它们的版本是否正确。

    我认为这是因为classloader加载所需的类时,由于该类存在且没有其他错误,因此可以将其加载到JVM中。
    但是当您调用该方法时,它会失败,因为在这个版本的jar 中可能没有必需的方法。

    请检查该类com.dfn.mtr.mix.beans.PortfolioRecord中的方法getPendingSell()

    如果手动找不到,现在可以进一步探索!

    【讨论】:

    • com.dfn.mtr.mix.beans.PortfolioRecord.getPendingSell() 方法存在于jar文件中,但我发现web应用程序是使用jdk 1.5构建的,jar文件包含上述方法类来自 jdk 1.6 ,这对问题有影响吗?
    • @ranganaMIT 我认为这可能是原因!较低的 jre 不兼容较高的 jdk
    【解决方案2】:

    我建议做的第一件事是: 转到目录 HOME_OF_YOUR_WAS_PROFILE\installedApps\YOUR_APP_NAME 并检查那里的 jar 文件。尝试检查您的库,它们可能在耳朵级别或在战争档案中。它们在两台服务器上必须相同。

    如果您使用 Windows 作为操作系统,请考虑 Websphere 7 有时在卸载时不会清除应用程序目录。当您更改库的版本时,这是很常见的情况:

    1) 例如有一个 lib 文件 lib1-3.2.0.jar。 2) 您在应用中将其更改为 lib1-3.3.1.jar。 3)您卸载您的应用程序并安装新版本。 4) 这两个文件都在您的 lib 路径中,这就是您遇到的问题。

    【讨论】:

    • 应用服务器在 HP UX 服务器上,我查看了单元格并没有发现任何剩余的 jar 文件,以确认我完全卸载了应用程序,清除了安装的日志和其他临时文件全新安装仍然存在相同的问题。 :-/
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-13
    • 1970-01-01
    • 2011-10-15
    相关资源
    最近更新 更多