users@jax-rpc.java.net

Re: ServiceFactory.createService() giving NullPointerException

From: Mark D. Hansen <khookguy_at_YAHOO.COM>
Date: Thu, 17 Jul 2003 22:19:20 -0400

My appologies - this one should work!

P.S. I fixed the soap:address problem that you pointed out earlier.

-- Mark



On Thu, 17 Jul 2003 14:27:28 -0700, Arun Gupta <Arun.Gupta_at_SUN.COM>
wrote:

>I'm getting the following error now ...
>
>[INFO] StandardHostDeployer - -Installing web application at context
path
>/jaxrpc-OrderProcessor from URL
>jar:file:/home/arung/testbed/jwsdp1.2/webapps/jaxrpc-OrderProcessor.war
!/
>[INFO] http - -JAX-RPC context listener initializing
>javax.xml.transform.TransformerConfigurationException:
>javax.xml.transform.TransformerConfigurationException:
>javax.xml.transform.TransformerException:
java.io.FileNotFoundException:
>/home/arung/testbed/jwsdp1.2/bin/prettyprint.xslt (No such file or
>directory)
>at
>org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transf
ormerFactoryImpl.java:805)
>at
>com.javector.chap5.sec1.OrderProcessor.OrderProcessor.<clinit>(OrderPro
cessor.java:32)
>at java.lang.Class.forName0(Native Method)
>at java.lang.Class.forName(Class.java:217)
>at
>com.sun.xml.rpc.server.http.JAXRPCRuntimeInfoParser.loadClass(JAXRPCRun
timeInfoParser.java:150)
>
>webapp is trying to look for prettyprint.xslt in the directory where I
>start my catalina server.
>
>-Arun
>
>Mark D. Hansen wrote:
>
>>Sorry - try this. I removed the file system dependency from the
service
>>and rebuilt the war.
>>
>>
>>-----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 4:33 PM
>>To: JAXRPC-INTEREST_at_JAVA.SUN.COM
>>Subject: Re: ServiceFactory.createService() giving
NullPointerException
>>
>>
>>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/O
rd
>>erProcessor/etc/prettyprint.xslt
>>(No such file or directory)
>> at
>>org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Trans
fo
>>rmerFactoryImpl.java:805)
>> at
>>com.javector.chap5.sec1.OrderProcessor.OrderProcessor.<clinit>(OrderPr
oc
>>essor.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(JAXRPCRu
nt
>>imeInfoParser.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(
Se
>>>
>>>
>>r
>>
>>
>>>viceInfoBuilder.java:335)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildOperationInfo(Serv
ic
>>>
>>>
>>e
>>
>>
>>>InfoBuilder.java:185)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildPortInfo(ServiceIn
fo
>>>
>>>
>>B
>>
>>
>>>uilder.java:171)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(Servic
eI
>>>
>>>
>>n
>>
>>
>>>foBuilder.java:121)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService
.j
>>>
>>>
>>a
>>
>>
>>>va:58)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService
.j
>>>
>>>
>>a
>>
>>
>>>va:47)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactor
yI
>>>
>>>
>>m
>>
>>
>>>pl.java:38)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.javector.chap5.sec1.OrderProcessor.OrderProcessorClient.<init>(Or
de
>>>
>>>
>>r
>>
>>
>>>ProcessorClient.java:93)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>com.javector.chap5.sec1.OrderProcessor.OrderProcessorClient.main(Orde
rP
>>>
>>>
>>r
>>
>>
>>>ocessorClient.java:137)
>>>
>>>
>>>
>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
ja
>>>
>>>
>>v
>>
>>
>>>a:39)
>>>
>>>
>>>
>>>
>>>> at
>>>>
>>>>
>>>>
>>>>
>>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
so
>>>
>>>
>>r
>>
>>
>>>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:15
0)
>>>
>>>
>>>
>>>
>>>> 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
>>=============================================
>>
>
>--
>=============================================
>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
>=============================================