users@jax-rpc.java.net

Re: ServiceFactory.createService() giving NullPointerException

From: Arun Gupta <arun.gupta_at_sun.com>
Date: Thu, 17 Jul 2003 13:32:46 -0700

I'm getting the following server-side exception when
jaxrpc-orderProcessor app is loaded ....

javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException: java.io.FileNotFoundException:
/home/arung/testbed/jwsdp1.2/bin/q:/book/src/com/javector/chap5/sec1/OrderProcessor/etc/prettyprint.xslt
(No such file or directory)
    at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:805)
    at
com.javector.chap5.sec1.OrderProcessor.OrderProcessor.<clinit>(OrderProcessor.java:31)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:217)
    at
com.sun.xml.rpc.server.http.JAXRPCRuntimeInfoParser.loadClass(JAXRPCRuntimeInfoParser.java:150)

and thus I'm not able to view the WSDL in browser. Can you please
provide me a new fixed version of the war ?

Thanks,
-Arun


Mark D. Hansen wrote:

>Arun,
>
>I'm using the RI (JWSDP 1.2). Attached is the WAR. Any help you can
>provide is much appreciated.
>
>-- Mark
>
>
>-----Original Message-----
>From: Public discussion on JAX-RPC
>[mailto:JAXRPC-INTEREST_at_JAVA.SUN.COM]On Behalf Of Arun Gupta
>Sent: Thursday, July 17, 2003 2:34 PM
>To: JAXRPC-INTEREST_at_JAVA.SUN.COM
>Subject: Re: ServiceFactory.createService() giving NullPointerException
>
>
>Hi Mark,
>
>I used a WSDL similar to yours and was able to create a Service instance
>easily. Here is my WSDL excerpt ...
>
> <wsdl:types>
> <xsd:schema targetNamespace="http://hello.org/bp1.1/types">
> <xsd:element name="stringIn" type="xsd:string"/>
> <xsd:element name="stringHeader" type="xsd:string"/>
> <xsd:element name="stringOut" type="xsd:string"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="echoStringInput">
> <wsdl:part name="stringIn" element="types:stringIn"/>
> <wsdl:part name="stringHeader" element="types:stringHeader"/>
> </wsdl:message>
> <wsdl:message name="echoStringOutput">
> <wsdl:part name="stringOut" element="types:stringOut"/>
> </wsdl:message>
> <wsdl:portType name="HelloPortType">
> <wsdl:operation name="echoString">
> <wsdl:input message="tns:echoStringInput"/>
> <wsdl:output message="tns:echoStringOutput"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
> <soap:binding style="document"
>transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="echoString">
> <soap:operation/>
> <wsdl:input>
> <soap:body parts="stringIn" use="literal"/>
> <soap:header message="tns:echoStringInput"
>part="stringHeader" use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> <soap:operation style="document"/>
> </wsdl:operation>
> </wsdl:binding>
>
>The only difference in the WSDL is that message parts in my WSDL are
>simple types, where as you have complex types. I dont think will make a
>difference though.
>
>Where are you picking JAX-RPC from ?
>
>If you can send me your war file, I can investigate further.
>
>Thanks for your interest in JAX-RPC.
>
>Regards,
>-Arun
>
>Mark D. Hansen wrote:
>
>
>
>>Here is the stack trace (sorry).
>>
>>java.lang.NullPointerException
>> at
>>
>>
>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildDocumentOperation(Ser
>viceInfoBuilder.java:335)
>
>
>> at
>>
>>
>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildOperationInfo(Service
>InfoBuilder.java:185)
>
>
>> at
>>
>>
>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildPortInfo(ServiceInfoB
>uilder.java:171)
>
>
>> at
>>
>>
>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceIn
>foBuilder.java:121)
>
>
>> at
>>
>>
>com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.ja
>va:58)
>
>
>> at
>>
>>
>com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.ja
>va:47)
>
>
>> at
>>
>>
>com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryIm
>pl.java:38)
>
>
>> at
>>
>>
>com.javector.chap5.sec1.OrderProcessor.OrderProcessorClient.<init>(Order
>ProcessorClient.java:93)
>
>
>> at
>>
>>
>com.javector.chap5.sec1.OrderProcessor.OrderProcessorClient.main(OrderPr
>ocessorClient.java:137)
>
>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>
>>
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39)
>
>
>> at
>>
>>
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25)
>
>
>> at java.lang.reflect.Method.invoke(Method.java:324)
>> at
>>
>>
>org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:208)
>
>
>> at
>>
>>
>org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:150)
>
>
>> at org.apache.tools.ant.taskdefs.Java.run(Java.java:443)
>> at
>>
>>
>org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
>
>
>> at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
>> at org.apache.tools.ant.Task.perform(Task.java:341)
>> at org.apache.tools.ant.Target.execute(Target.java:309)
>> at org.apache.tools.ant.Target.performTasks(Target.java:336)
>> at
>>
>>
>org.apache.tools.ant.Project.executeTarget(Project.java:1339)
>
>
>> at
>>
>>
>org.apache.tools.ant.Project.executeTargets(Project.java:1255)
>
>
>> at org.apache.tools.ant.Main.runBuild(Main.java:609)
>> at org.apache.tools.ant.Main.start(Main.java:196)
>> at org.apache.tools.ant.Main.main(Main.java:235)
>>
>>-----Original Message-----
>>From: Public discussion on JAX-RPC
>>[mailto:JAXRPC-INTEREST_at_JAVA.SUN.COM]On Behalf Of Mark D. Hansen
>>Sent: Thursday, July 17, 2003 1:19 PM
>>To: JAXRPC-INTEREST_at_JAVA.SUN.COM
>>Subject: ServiceFactory.createService() giving NullPointerException
>>
>>
>>I'm having trouble generating a Service instance using ServiceFactory.
>>
>>
>I keep getting NPEs. The server side is no problem. The ties get
>generated OK and deploy with no problem on Tomcat. But, I can't seem to
>generate the Service on the client side from the WSDL without getting
>NPEs.
>
>
>>Any suggestions will be much appreciated.
>>
>>Here is the code for instantiation.
>>
>> String wsdlURL =
>>
>>
>"http://localhost:8080/jaxrpc-OrderProcessor/orderproc?WSDL";
>
>
>> String namespaceURI = "http://www.xyzcorp.com/css/wsdl";
>> String serviceName = "orderProcessingService";
>> URL urlWSDL = new URL(wsdlURL);
>> QName qnameService =
>> new QName(namespaceURI, serviceName);
>> log.info("urlWSDL = " + urlWSDL + NL +
>> "qnameService = " + qnameService);
>> Service orderService =
>> serviceFac.createService(urlWSDL, qnameService);
>>
>>Here is part of the WSDL:
>>
>><wsdl:definitions
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:xyz="http://www.xyzcorp.com/xyzcorp.xsd"
>> xmlns:oms="http://www.xyzcorp.com/oms/order.xsd"
>> xmlns:tns="http://www.xyzcorp.com/css/wsdl"
>> targetNamespace="http://www.xyzcorp.com/css/wsdl">
>> <wsdl:types>
>> <schema ...>
>> ....
>> </schema>
>> </wsdl:types>
>> <wsdl:message name="order">
>> <wsdl:part name="body" element="oms:SalesOrder"/>
>> <wsdl:part name="messagetypeHeader" element="xyz:typeofmessage"/>
>> </wsdl:message>
>> <wsdl:portType name="orderProcessingPortType">
>> <wsdl:operation name="orderProcessingInput">
>> <wsdl:input message="tns:order"/>
>> </wsdl:operation>
>> </wsdl:portType>
>> <wsdl:binding name="orderProcessingBinding"
>>
>>
>type="tns:orderProcessingPortType">
>
>
>> <soapbind:binding style="document"
>>
>>
>transport="http://schemas.xmlsoap.org/soap/http"/>
>
>
>> <wsdl:operation name="orderProcessingInput">
>> <wsdl:input>
>> <soapbind:body parts="body" use="literal"/>
>> <soapbind:header message="tns:order" part="messagetypeHeader"
>>
>>
>use="literal"/>
>
>
>> </wsdl:input>
>> <soapbind:operation style="document"/>
>> </wsdl:operation>
>> </wsdl:binding>
>> <wsdl:service name="orderProcessingService">
>> <wsdl:port name="orderProcessingPort"
>>
>>
>binding="tns:orderProcessingBinding">
>
>
>> <soapbind:address
>>
>>
>location="http://javector-server:8080/css/orders"/>
>
>
>> </wsdl:port>
>> </wsdl:service>
>></wsdl:definitions>
>>
>>
>>
>>
>
>--
>=============================================
>There is only one me, I must live myself!
>There is only one today, I must live itself!
>=============================================
>http://members.tripod.com/~apgupta/index.html
>=============================================
>

--
=============================================
There is only one me, I must live myself!
There is only one today, I must live itself!
=============================================
http://members.tripod.com/~apgupta/index.html
=============================================