axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siamak Haschemi <siama...@gmx.de>
Subject Re: [Axis2] NullPointerException while receiving Fault from Server
Date Tue, 25 Apr 2006 13:28:31 GMT
Hello,

sorry for not using the convention.

Here's the JIRA issue:

http://issues.apache.org/jira/browse/AXIS2-616

Thank you ver much,

Siamak Haschemi


Davanum Srinivas schrieb:
> Siamak,
>
> *PLEASE* log a jira bug report and then upload the files
>
> thanks,
> dims
>
> On 4/25/06, Siamak Haschemi <siamak.h@gmx.de> wrote:
>   
>> Hello Robert,
>>
>> I'm going crazy with Axis2 and Failures...
>>
>> I attached
>> - a simplified WSDL file which seems to be valid (validated with the
>> WSDL Validator of the Eclipse WTP Project).
>> - the services.xml
>> - My serverside Skeleton
>> - My simple Client
>> - The xml-request
>> - The xml-response
>> - The Exception
>>
>> Thank you for your help,
>>
>> Siamak Haschemi
>>
>> --
>>
>> <?xml version="1.0" encoding="http://schemas.xmlsoap.org/soap/envelope/"?>
>> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>> <soapenv:Header/>
>> <soapenv:Body>
>> <getProductRequest
>> xmlns="http://www.haschemi.org/fault/">Test</getProductRequest>
>> </soapenv:Body>
>> </soapenv:Envelope>
>>
>> --
>>
>> <?xml version="1.0" encoding="http://schemas.xmlsoap.org/soap/envelope/"?>
>> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>> <soapenv:Header/>
>> <soapenv:Body>
>> <soapenv:Fault>
>> <faultcode>soapenv:Client</faultcode>
>> <faultstring>GetProductFaultException</faultstring>
>> <detail>
>> <getProductFault xmlns="http://www.haschemi.org/fault/">Dicker
>> Fehler!</getProductFault>
>> </detail>
>> </soapenv:Fault>
>> </soapenv:Body>
>> </soapenv:Envelope>
>>
>> --
>>
>> Exception in thread "main" java.lang.RuntimeException: Data binding error
>>     at org.apache.axis2.FaultStub.fromOM(FaultStub.java:407)
>>     at org.apache.axis2.FaultStub.getProduct(FaultStub.java:174)
>>     at Client.main(Client.java:16)
>> Caused by: java.lang.NullPointerException
>>     at
>> org.apache.xmlbeans.impl.store.Cur$CurLoadContext.finish(Cur.java:3184)
>>     at
>> org.apache.xmlbeans.impl.store.Locale.loadXMLStreamReader(Locale.java:1216)
>>     at
>> org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:843)
>>     at
>> org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:826)
>>     at
>> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:231)
>>     at
>> org.haschemi.www.fault.GetProductFaultDocument$Factory.parse(GetProductFaultDocument.java:88)
>>     at org.apache.axis2.FaultStub.fromOM(FaultStub.java:403)
>>     ... 2 more
>>
>> robert lazarski schrieb:
>>     
>>> Try validating your wsdl file - I'm seeing some warning about missing types
>>> around getAllProductRequest .
>>>
>>> HTH,
>>> Robert
>>> http://www.braziloutsource.com/
>>>
>>> On 4/24/06, Siamak Haschemi <siamak.h@gmx.de> wrote:
>>>
>>>       
>>>> Hello to all.
>>>>
>>>> I posted this failure in the user-list but nobody responses, so I'll try
>>>> to reach the developers because it seems like a bug.
>>>>
>>>> I generated with the attached WSDL file the serverside and the
>>>> clientside code.
>>>>
>>>> The reqiest from the Client is:
>>>>
>>>> <?xml version="1.0" encoding="http://schemas.xmlsoap.org/soap/envelope/"?>
>>>> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>>>> ">
>>>> <soapenv:Header/>
>>>> <soapenv:Body>
>>>> <saveProductRequest xmlns="http://haschemi.org/shop/common">
>>>> <product amount="11.0" amountUnit="kg" calorificValue="15000"
>>>> dateOfExpiry="2006-04-24+02:00" description="Tolles Brot mit tollen
>>>> Eigenschaften...." fromTemperatureRange="-15.0" name="Hagen Brot"
>>>> toTemperatureRange="30.0"/>
>>>> </saveProductRequest>
>>>> </soapenv:Body>
>>>> </soapenv:Envelope>
>>>>
>>>> In the Server Skeleton I throw a Exception:
>>>>
>>>> public SaveProductResponseDocument
>>>> saveProduct(SaveProductRequestDocument param1) OperationException {
>>>>   final OperationException exception = new OperationException();
>>>>   final ExceptionMessageDocument exceptionMessageDocument =
>>>> ExceptionMessageDocument.Factory.newInstance();
>>>>   final ExceptionMessage exceptionMessage =
>>>> exceptionMessageDocument.addNewExceptionMessage();
>>>>   final LocalizedMessage localizedMessage =
>>>> exceptionMessage.addNewLocalizedMessage();
>>>>   localizedMessage.setLanguage(LocalizedMessage.Language.DE_DE);
>>>>   localizedMessage.setMessage("Fehlerbescrhreibung");
>>>>   exception.setFaultMessage(exceptionMessageDocument);
>>>>   throw exception;
>>>> }
>>>>
>>>>
>>>> And the response is:
>>>>
>>>> <?xml version="1.0" encoding="http://schemas.xmlsoap.org/soap/envelope/"?>
>>>> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>>>> ">
>>>> <soapenv:Header/>
>>>> <soapenv:Body>
>>>> <soapenv:Fault>
>>>> <faultcode>soapenv:Client</faultcode>
>>>> <faultstring>OperationException</faultstring>
>>>> <detail>
>>>> <exceptionMessage xmlns="http://haschemi.org/shop/common">
>>>> <localizedMessage language="de_DE" message="Fehlerbescrhreibung"/>
>>>> </exceptionMessage>
>>>> </detail>
>>>> </soapenv:Fault>
>>>> </soapenv:Body>
>>>> </soapenv:Envelope>
>>>>
>>>>
>>>> The client receives the response and throws:
>>>>
>>>> org.apache.axiom.om.OMException: java.lang.NullPointerException
>>>>     at
>>>> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java
>>>> :207)
>>>>     at
>>>> org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(
>>>> OMElementImpl.java:263)
>>>>     at
>>>> org.apache.axiom.om.impl.traverse.OMChildrenIterator.next(
>>>> OMChildrenIterator.java:111)
>>>>     at
>>>> org.apache.axiom.soap.impl.llom.SOAPFaultImpl.getChildWithName(
>>>> SOAPFaultImpl.java:187)
>>>>     at
>>>> org.apache.axiom.soap.impl.llom.SOAPFaultImpl.getNode(SOAPFaultImpl.java
>>>> :119)
>>>>     at
>>>> org.apache.axis2.description.OutInAxisOperationClient.execute(
>>>> OutInAxisOperation.java:286)
>>>>     at org.apache.axis2.CareStub.saveProduct(CareStub.java:277)
>>>>     at Client.main(Client.java:53)
>>>> Caused by: java.lang.NullPointerException
>>>>     at
>>>> org.apache.axiom.soap.impl.builder.SOAPBuilderHelper.processAttributes(
>>>> SOAPBuilderHelper.java:90)
>>>>     at
>>>> org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.handleEvent(
>>>> SOAP11BuilderHelper.java:146)
>>>>     at
>>>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(
>>>> StAXSOAPModelBuilder.java:310)
>>>>     at
>>>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
>>>> StAXSOAPModelBuilder.java:177)
>>>>     at
>>>> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java
>>>> :133)
>>>>     ... 7 more
>>>>
>>>>
>>>> So, did I something wrong?
>>>> Is there a miskate in the WSDL-file?
>>>>
>>>> Thanks for the help
>>>>
>>>>
>>>> Siamak Haschemi
>>>>
>>>>
>>>>
>>>>
>>>>         
>>>       
>>
>> /**
>>  * FaultSkeleton.java
>>  *
>>  * This file was auto-generated from WSDL
>>  * by the Apache Axis2 version: SNAPSHOT Apr 24, 2006 (08:15:33 CEST)
>>  */
>> package org.apache.axis2;
>>
>> import org.haschemi.www.fault.GetProductFaultDocument;
>>
>> /**
>>  * FaultSkeleton java skeleton for the axisService
>>  */
>> public class FaultSkeleton {
>>
>>         /**
>>          * Auto generated method signature
>>          *
>>          * @param param0
>>          *
>>          */
>>         public org.haschemi.www.fault.GetProductResponseDocument getProduct(
>>                         org.haschemi.www.fault.GetProductRequestDocument param0)
>>
>>         throws org.apache.axis2.FaultSkeleton.GetProductFaultException {
>>                 final GetProductFaultException exception = new GetProductFaultException();
>>                 final GetProductFaultDocument document = GetProductFaultDocument.Factory.newInstance();
>>                 document.setGetProductFault("Dicker Fehler!");
>>
>>                 exception.setFaultMessage(document);
>>
>>                 throw exception;
>>         }
>>
>>         public static class GetProductFaultException extends java.rmi.RemoteException
{
>>
>>                 private org.haschemi.www.fault.GetProductFaultDocument faultMessage;
>>
>>                 public void setFaultMessage(org.haschemi.www.fault.GetProductFaultDocument
msg) {
>>                         faultMessage = msg;
>>                 }
>>
>>                 public org.haschemi.www.fault.GetProductFaultDocument getFaultMessage()
{
>>                         return faultMessage;
>>                 }
>>         }
>>
>> }
>>
>>
>> import org.apache.axis2.FaultStub;
>> import org.apache.axis2.context.ConfigurationContext;
>> import org.apache.axis2.context.ConfigurationContextFactory;
>> import org.haschemi.www.fault.GetProductRequestDocument;
>>
>> public class Client {
>>         public static void main(String[] args) throws Exception {
>>                 ConfigurationContext configContext = ConfigurationContextFactory
>>                                 .createConfigurationContextFromFileSystem("client_repo",
null);
>>
>>                 final FaultStub faultStub = new FaultStub(configContext,
>>                                 "http://localhost:1234/axis2/services/fault");
>>
>>                 final GetProductRequestDocument document = GetProductRequestDocument.Factory.newInstance();
>>                 document.setGetProductRequest("Test");
>>                 faultStub.getProduct(document);
>>         }
>> }
>>
>>
>>
>>
>>     
>
>
> --
> Davanum Srinivas : http://wso2.com/blogs/
>
>   


Mime
View raw message