当我在本地服务器(Jetty)上运行我的代码时,我的一个类没有实现可序列化,那时它运行良好。(没有实现可序列化,代码在本地服务器上运行良好)
但是当我在 weblogic 上部署它时,它给我的错误是:
Caused by: java.rmi.UnmarshalException:
当我对那个特定的类实现 Serializable 时,WebLogic 上的错误就消失了。
知道为什么会这样吗?
错误的堆栈跟踪
<65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766596> <BEA-000000> <Caused by: java.rmi.UnmarshalException: com.example.usecase.command.version.VersionSearchCriteria; nested exception is:
java.io.NotSerializableException: com.example.usecase.command.version.VersionSearchCriteria>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766597> <BEA-000000> < at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:350)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766598> <BEA-000000> < at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766599> <BEA-000000> < at com.example.Starter_5i7spw_EOImpl_1002_WLStub.evaluateCommand(Unknown Source)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766600> <BEA-000000> < at com.example.taco2.service.impl.CallcomServerService.callServerWithCommand(CallcomServerService.java:178)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766601> <BEA-000000> < ... 40 more>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766602> <BEA-000000> <Caused by: java.io.NotSerializableException: com.example.usecase.command.version.VersionSearchCriteria>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766603> <BEA-000000> < at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1087)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766604> <BEA-000000> < at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1382)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766605> <BEA-000000> < at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1354)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766606> <BEA-000000> < at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1296)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766607> <BEA-000000> < at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1085)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766608> <BEA-000000> < at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:304)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766609> <BEA-000000> < at weblogic.rmi.extensions.server.CBVOutputStream.writeObject(CBVOutputStream.java:91)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766610> <BEA-000000> < at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:238)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766611> <BEA-000000> < at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766612> <BEA-000000> < at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:335)>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <System.err> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766613> <BEA-000000> < ... 43 more>
####<Tracing Data here> <01.05.2012 09:02:46 CEST> <Error> <HTTP> <example> <coms1m1vm1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-000000000000003d> <1335855766617> <BEA-101020> <[weblogic.servlet.internal.WebAppServletContext@eff17d - appName: 'taco2', name: 'taco2', context-path: '/taco2'] Servlet failed with Exception
java.lang.NullPointerException
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:384)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.example.taco2.common.AuthorizeFilter.doFilter(AuthorizeFilter.java:65)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.example.enterprise.beasecurity.AuthenticationFilter$1.run(AuthenticationFilter.java:150)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.security.Security.runAs(Security.java:41)
at com.example.enterprise.beasecurity.AuthenticationFilter.doFilter(AuthenticationFilter.java:147)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.example.taco2.common.EncodingFilter.doFilter(EncodingFilter.java:36)
at com.example.taco2.common.Taco2EncodingFilter.doFilter(Taco2EncodingFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(Unknown Source)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.execute(Unknown Source)
at weblogic.servlet.internal.ServletRequestImpl.run(Unknown Source)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
>
####<01.05.2012 09:02:50 CEST> <Error> <System.err> <example> <coms1m1vm1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-0000000000000004> <1335855770431> <BEA-000000> <01.05.2012 09:02:50 - WARNUNG : Could not refresh JMS Connection for destination 'jms/elu.AnswerQueue2' - retrying in 5000 ms. Cause: Error creating bean with name 'elu.connection.target.factory2' defined in class path resource [at/example/abc/kernel/beanContext/abc.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: While trying to lookup 'jms.com.example.elu.ConnectionFactory2' didn't find subcontext 'jms'. Resolved ''; remaining name 'jms/at/example/elu/ConnectionFactory2'>
####<01.05.2012 09:02:50 CEST> <Error> <System.err> <example> <coms1m1vm1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-0000000000000004> <1335855770433> <BEA-000000> <>
####<01.05.2012 09:02:50 CEST> <Info> <System.out> <example> <coms1m1vm1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <com> <> <65d8f2366e4156e8:6d5e12f8:137072e8ad2:-8000-0000000000000004> <1335855770436> <BEA-000000> <<<exampleTimeDebugInfo>>MeteredStream.isToRotate: [STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' time=2012-05-01 09:02:32.435 creationTime=2012-05-01 09:02:29.335 CurrentTime=Tue May 01 09:02:50 CEST 2012>
^Z