调用Web服务抛出异常

时间:2017-12-12 01:09:00

标签: java web-services

我有java程序调用cluster webservices但返回错误。 java程序托管在集群weblogic上。由于网络服务,我有嫌疑人。不是吗? " weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)&#34 ;.

package com.xxxx.ws;
public class AccountServiceServiceStub extends org.apache.axis2.client.Stub
        {
        public static class StatementDetail
                implements org.apache.axis2.databinding.ADBBean{

// -----------------详情--------------------------- ---------------------

####<Dec 12, 2017 8:47:35,895 AM HKT> <Error> <Cluster> <uat-application04> <uatwebapp04> <[ACTIVE] ExecuteThread: '320' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <668c1574-eb8d-472d-9727-b70a31158297-0000020d> <1513039655895> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-003144> <All session objects should be serializable to replicate. Check the objects in the session. Failed to replicate a non-serializable object in context /aeon_awip_one_piece.
java.rmi.MarshalException: failed to marshal update(Lweblogic.cluster.replication.ROID;ILjava.io.Serializable;Ljava.lang.Object;); nested exception is:
        java.io.NotSerializableException: com.xxx.bls.ws.AccountServiceServiceStub$StatementDetail
        at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:100)
        at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:297)
        at weblogic.cluster.replication.RemoteReplicationServicesInternalImpl_12213_WLStub.update(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor578.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at weblogic.cluster.replication.SecureReplicationInvocationHandler$ReplicationServicesInvocationAction.run(SecureReplicationInvocationHandler.java:222)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:137)
        at weblogic.cluster.replication.SecureReplicationInvocationHandler.invoke(SecureReplicationInvocationHandler.java:192)
        at com.sun.proxy.$Proxy320.update(Unknown Source)
        at weblogic.cluster.replication.ReplicationServicesImplBase.sendUpdateRequestToSecondary(ReplicationServicesImplBase.java:1670)
        at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondaryInternal(ReplicationServicesImplBase.java:1559)
        at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondary(ReplicationServicesImplBase.java:1525)
        at weblogic.cluster.replication.ReplicationServicesImplBase.updateSecondary(ReplicationServicesImplBase.java:1520)
        at weblogic.servlet.internal.session.ReplicatedSessionData._syncSession(ReplicatedSessionData.java:741)
        at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:705)
        at weblogic.servlet.internal.session.SessionContext.sync(SessionContext.java:161)
        at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:3445)
        at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSessions(ServletRequestImpl.java:3423)
        at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:3411)
        at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1800)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.ServletResponseImpl.syncSession(ServletResponseImpl.java:1796)
        at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1731)
        at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1713)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused By: java.io.NotSerializableException: com.xxxx.ws.AccountServiceServiceStub$StatementDetail
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
        at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1378)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
        at java.util.ArrayList.writeObject(ArrayList.java:762)
        at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)

1 个答案:

答案 0 :(得分:0)

  

由于网络服务,我有嫌疑人。不是吗?

可能不是。 (除非某些webservices工具生成该源代码!)

异常消息说:

Caused By: java.io.NotSerializableException:
    com.xxxx.ws.AccountServiceServiceStub$StatementDetail

这很清楚。这是说StatementDetail实例不可序列化。

现在,我可以看到您的StatementDetail类实现ADBBeanthis version)扩展Serializable。但这还不够。此外,实例的非瞬态字段的 all 的值也必须是可序列化的。