2014-01-30 50 views
0

我到一個奇怪的問題中運行,java.lang.NoSuchMethodError在WebSphere 7

我有彈簧2.5開發的Web應用程序。

我將這個應用程序部署在websphere 7應用程序服務器。

有兩個WebSphere應用服務器,應用程序正常工作在一個應用程序服務器,但在另一方面,它給出了一個奇怪的錯誤說,Web應用程序正在爲一個不存在的方法的調用。

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

實際方法調用應用程序製作是,

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

我附下面日誌的一部分。當我爲這個問題搜索時,我找不到任何解決方案,希望你們可以給我一些幫助以解決問題。 如果您想了解有關此問題的更多信息,請讓我知道。

[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) 

問候, Rangana

回答

0

在大多數情況,這意味着你的jar版本不對應一個。
您需要驗證它們的版本是否正確。

我想這樣做的原因是當加載所需的類classloader時,因爲該類存在沒有其他錯誤,它可以加載到JVM中。
但是,當您調用該方法時,它會失敗,因爲在此版本的jar中可能沒有必需的方法。

請檢查方法getPendingSell()在這個類com.dfn.mtr.mix.beans.PortfolioRecord

如果您不能手動找到它,你現在可以做進一步的探索!

+0

com.dfn.mtr.mix.beans.PortfolioRecord.getPendingSell()方法存在於jar文件中,但是我發現web應用程序是使用jdk 1.5構建的,包含上述方法類的jar文件來自jdk 1。6,這可以對問題產生影響嗎? –

+0

@ranganaMIT我認爲這可能是原因!較低的jre不兼容較高jdk – Rugal

0

我建議要做的第一件事是: 轉到目錄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路徑中,這就是你遇到的問題。

+0

應用程序服務器位於HP UX服務器上,我查看了單元並沒有發現任何遺留的jar文件,以確認我完全卸載了該應用程序,清除了安裝的日誌和其他臨時文件新鮮安裝仍然問題保持不變。 : - / –