2010-10-19 4 views
0

j'ai mettre en œuvre un service Web simple la signature de la méthode de service Web est:avec un service Web Java

public OperationResult createUser(int systemId, int refId, String name, 
      String password, int planId, BigDecimal amount) 

la classe OperationResult est la suivante:

public class OperationResult implements Serializable { 

    private static final long serialVersionUID = 1L; 
    int resultType; 
    String result; 

    public OperationResult(int resultType, String result) { 
     super(); 
     this.resultType = resultType; 
     this.result = result; 
    } 

    public int getResultType() { 
     return resultType; 
    } 

    public void setResultType(int resultType) { 
     this.resultType = resultType; 
    } 

    public String getResult() { 
     return result; 
    } 

    public void setResult(String result) { 
     this.result = result; 
    } 

} 

lorsque je tente d'utiliser la service il jette cela exceptin

java.rmi.RemoteException: java.lang.InstantiationException: com.pardis.quota.core.OperationResult; nested exception is: 
    com.bea.xml.XmlRuntimeException: java.lang.InstantiationException: com.pardis.quota.core.OperationResult 
    at com.pardis.quota.webservice.Quota_Stub.createUser(Quota_Stub.java:216) 
    at Test.main(Test.java:20) 
Caused by: com.bea.xml.XmlRuntimeException: java.lang.InstantiationException: com.pardis.quota.core.OperationResult 
    at com.bea.staxb.runtime.internal.ClassLoadingUtils.newInstance(ClassLoadingUtils.java:139) 
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.createIntermediary(ByNameRuntimeBindingType.java:207) 
    at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshal(AttributeUnmarshaller.java:36) 
    at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(UnmarshalResult.java:179) 
    at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalType(UnmarshalResult.java:217) 
    at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshalType(UnmarshallerImpl.java:127) 
    at weblogic.wsee.bind.runtime.internal.LiteralDeserializerContext.unmarshalType(LiteralDeserializerContext.java:72) 
    at weblogic.wsee.bind.runtime.internal.BaseDeserializerContext.internalDeserializeType(BaseDeserializerContext.java:172) 
    at weblogic.wsee.bind.runtime.internal.BaseDeserializerContext.deserializeType(BaseDeserializerContext.java:86) 
    at weblogic.wsee.bind.runtime.internal.BaseDeserializerContext.deserializeWrappedElement(BaseDeserializerContext.java:135) 
    at weblogic.wsee.codec.soap11.SoapDecoder.decodePart(SoapDecoder.java:486) 
    at weblogic.wsee.codec.soap11.SoapDecoder.decodeReturn(SoapDecoder.java:404) 
    at weblogic.wsee.codec.soap11.SoapDecoder.decodeParts(SoapDecoder.java:174) 
    at weblogic.wsee.codec.soap11.SoapDecoder.decode(SoapDecoder.java:125) 
    at weblogic.wsee.codec.soap11.SoapCodec.decode(SoapCodec.java:180) 
    at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeOutput(CodecHandler.java:127) 
    at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:104) 
    at weblogic.wsee.ws.dispatch.client.CodecHandler.handleResponse(CodecHandler.java:81) 
    at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:287) 
    at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:271) 
    at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:213) 
    at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:150) 
    at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87) 
    at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:337) 
    at com.pardis.quota.webservice.Quota_Stub.createUser(Quota_Stub.java:207) 
    ... 1 more 
Caused by: java.lang.InstantiationException: com.pardis.quota.core.OperationResult 
    at java.lang.Class.newInstance0(Class.java:340) 
    at java.lang.Class.newInstance(Class.java:308) 
    at com.bea.staxb.runtime.internal.ClassLoadingUtils.newInstance(ClassLoadingUtils.java:137) 
    ... 25 more 

J'utilise weblogic 10, lorsque je teste le service avec weblogic il fonctionne avec succès

mais quand je l'utilise par un code java, il échoue.

merci à l'avance

Répondre

5

Je pense, vous devez ajouter constructeur parameterless:

public OpreationResult() { 
} 

Les points de STACKTRACE dans cette direction.

J'espère que ça aide.

+0

+1. C'est requis par le mécanisme de sérialisation. – Bozho

+0

oui ça marche. Je vous remercie – arash