You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Virginie Legrand <Vi...@sophia.inria.fr> on 2005/03/31 15:12:33 UTC
Null Pointer Exception
Hello,
I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
Here is a sample of my code :
Emitter emitter = new Emitter();
emitter.setDisallowedMethods(disallowedMethods);
emitter.setAllowedMethods(allowedMethods);
emitter.setLocationUrl(urlRouter);
emitter.setIntfNamespace(namespace);
emitter.setImplNamespace(namespace);
emitter.setCls(c);
emitter.setServiceElementName(serviceName);
String wsdl = emitter.emitToString(Emitter.MODE_ALL);
when calling the emitToString() method, I get a NullPointerException.
I worked when I was using previous version of axis.
What do I do wrong here ?
Thanks for your help
Regards,
Virginie
Re: Null Pointer Exception
Posted by Virginie Legrand <Vi...@sophia.inria.fr>.
I use the jdk 1.4.2_04
venkatesh wrote:
> what version of jdk u r using?
>
> ----- Original Message ----- From: "Virginie Legrand"
> <Vi...@sophia.inria.fr>
> To: <ax...@ws.apache.org>
> Sent: Thursday, March 31, 2005 6:42 PM
> Subject: Null Pointer Exception
>
>> Hello,
>>
>> I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
>> Here is a sample of my code :
>> Emitter emitter = new Emitter();
>> emitter.setDisallowedMethods(disallowedMethods);
>> emitter.setAllowedMethods(allowedMethods);
>> emitter.setLocationUrl(urlRouter);
>> emitter.setIntfNamespace(namespace);
>> emitter.setImplNamespace(namespace);
>> emitter.setCls(c);
>> emitter.setServiceElementName(serviceName);
>> String wsdl = emitter.emitToString(Emitter.MODE_ALL);
>>
>>
>> when calling the emitToString() method, I get a NullPointerException.
>> I worked when I was using previous version of axis.
>> What do I do wrong here ?
>>
>> Thanks for your help
>>
>> Regards,
>>
>> Virginie
>
>
java.io.IOException: Non nillable element 'documentMimeType' is null
Posted by Michael Niemaz <Mi...@xrce.xerox.com>.
Hi,
I'm facing a strange bug ;-)
I'm exposing my web services on Tomcat using axis. Everything worked
fine until I decided to upgrade to the RC3 release?
Would you have any input on that?
Here's the wsdl:
<wsdl:types>
<schema targetNamespace="http://services.smartdocument.xerox.com"
xmlns="http://www.w3.org/2001/XMLSchema">
<import
namespace="http://initiate.services.smartdocument.xerox.com"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType abstract="true" name="SmartDocumentResult">
<sequence>
<element name="SmartDocumentId" nillable="true" type="xsd:string"/>
<element name="DocumentId" nillable="true" type="xsd:string"/>
<element name="*DocumentMimeType*" nillable="true"
type="xsd:string"/>
<element name="DocumentURL" nillable="true" type="xsd:string"/>
<element name="Message" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
<schema
targetNamespace="http://initiate.services.smartdocument.xerox.com"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://services.smartdocument.xerox.com"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="InitiateResult">
<complexContent>
<extension base="tns2:SmartDocumentResult">
<sequence>
<element name="AuthId" nillable="true" type="xsd:string"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
</wsdl:types>
and the error I get:
31-Mar-2005 16:16:22 org.apache.axis.encoding.ser.BeanSerializer
serialize
SEVERE: Exception:
java.io.IOException: Non nillable element 'documentMimeType' is null.
at
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:200)
at
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1415)
at
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:910)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:186)
at
org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:435)
at
org.apache.axis.message.MessageElement.output(MessageElement.java:1207)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:477)
at
org.apache.axis.message.MessageElement.output(MessageElement.java:1207)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
at
org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:519)
at org.apache.axis.Message.getContentType(Message.java:475)
at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:765)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
31-Mar-2005 16:16:22 org.apache.axis.attachments.AttachmentsImpl
getAttachmentCount
WARNING: Exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: java.io.IOException: Non nillable
element 'documentMimeType' is null.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException:
java.io.IOException: Non nillable element 'documentMimeType' is null.
--mike
Re: Null Pointer Exception
Posted by venkatesh <ve...@lasonindia.com>.
what version of jdk u r using?
----- Original Message -----
From: "Virginie Legrand" <Vi...@sophia.inria.fr>
To: <ax...@ws.apache.org>
Sent: Thursday, March 31, 2005 6:42 PM
Subject: Null Pointer Exception
> Hello,
>
> I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
> Here is a sample of my code :
> Emitter emitter = new Emitter();
> emitter.setDisallowedMethods(disallowedMethods);
> emitter.setAllowedMethods(allowedMethods);
> emitter.setLocationUrl(urlRouter);
> emitter.setIntfNamespace(namespace);
> emitter.setImplNamespace(namespace);
> emitter.setCls(c);
> emitter.setServiceElementName(serviceName);
> String wsdl = emitter.emitToString(Emitter.MODE_ALL);
>
>
> when calling the emitToString() method, I get a NullPointerException.
> I worked when I was using previous version of axis.
> What do I do wrong here ?
>
> Thanks for your help
>
> Regards,
>
> Virginie
Re: Null Pointer Exception
Posted by Venkat Reddy <vr...@gmail.com>.
try setting the TypeMappingRegistry before calling emitToString, if
you can get hold of msgContext -
emitter.setTypeMappingRegistry(msgContext.getTypeMappingRegistry());
- venkat
On Apr 6, 2005 8:17 PM, Virginie Legrand
<Vi...@sophia.inria.fr> wrote:
> Here is the Stack trace :
>
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.axis.wsdl.fromJava.Emitter.init(Emitter.java:574)
> at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:465)
> at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:326)
> at
> org.apache.axis.wsdl.fromJava.Emitter.emitToString(Emitter.java:399)
>
> Venkat Reddy wrote:
>
> > Can you provide the full exception stacktrace?
> >
> > - venkat
> >
> >
> > On Apr 6, 2005 2:39 PM, *Virginie Legrand*
> > <Virginie.Legrand@sophia.inria.fr
> > <ma...@sophia.inria.fr>> wrote:
> >
> > Does anybody never encounter this issue ??
> >
> > Virginie Legrand wrote:
> >
> > > Hello,
> > >
> > > I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
> > > Here is a sample of my code :
> > > Emitter emitter = new Emitter();
> > > emitter.setDisallowedMethods(disallowedMethods);
> > > emitter.setAllowedMethods(allowedMethods);
> > > emitter.setLocationUrl(urlRouter);
> > > emitter.setIntfNamespace(namespace);
> > > emitter.setImplNamespace(namespace);
> > > emitter.setCls(c);
> > > emitter.setServiceElementName(serviceName);
> > > String wsdl = emitter.emitToString(Emitter.MODE_ALL);
> > >
> > >
> > > when calling the emitToString() method, I get a
> > NullPointerException.
> > > I worked when I was using previous version of axis.
> > > What do I do wrong here ?
> > >
> > > Thanks for your help
> > >
> > > Regards,
> > >
> > > Virginie
> > >
> >
> >
>
>
Re: Null Pointer Exception
Posted by Virginie Legrand <Vi...@sophia.inria.fr>.
Here is the Stack trace :
Exception in thread "main" java.lang.NullPointerException
at org.apache.axis.wsdl.fromJava.Emitter.init(Emitter.java:574)
at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:465)
at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:326)
at
org.apache.axis.wsdl.fromJava.Emitter.emitToString(Emitter.java:399)
Venkat Reddy wrote:
> Can you provide the full exception stacktrace?
>
> - venkat
>
>
> On Apr 6, 2005 2:39 PM, *Virginie Legrand*
> <Virginie.Legrand@sophia.inria.fr
> <ma...@sophia.inria.fr>> wrote:
>
> Does anybody never encounter this issue ??
>
> Virginie Legrand wrote:
>
> > Hello,
> >
> > I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
> > Here is a sample of my code :
> > Emitter emitter = new Emitter();
> > emitter.setDisallowedMethods(disallowedMethods);
> > emitter.setAllowedMethods(allowedMethods);
> > emitter.setLocationUrl(urlRouter);
> > emitter.setIntfNamespace(namespace);
> > emitter.setImplNamespace(namespace);
> > emitter.setCls(c);
> > emitter.setServiceElementName(serviceName);
> > String wsdl = emitter.emitToString(Emitter.MODE_ALL);
> >
> >
> > when calling the emitToString() method, I get a
> NullPointerException.
> > I worked when I was using previous version of axis.
> > What do I do wrong here ?
> >
> > Thanks for your help
> >
> > Regards,
> >
> > Virginie
> >
>
>
Re: Null Pointer Exception
Posted by Venkat Reddy <vr...@gmail.com>.
Can you provide the full exception stacktrace?
- venkat
On Apr 6, 2005 2:39 PM, Virginie Legrand <Vi...@sophia.inria.fr>
wrote:
>
> Does anybody never encounter this issue ??
>
> Virginie Legrand wrote:
>
> > Hello,
> >
> > I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
> > Here is a sample of my code :
> > Emitter emitter = new Emitter();
> > emitter.setDisallowedMethods(disallowedMethods);
> > emitter.setAllowedMethods(allowedMethods);
> > emitter.setLocationUrl(urlRouter);
> > emitter.setIntfNamespace(namespace);
> > emitter.setImplNamespace(namespace);
> > emitter.setCls(c);
> > emitter.setServiceElementName(serviceName);
> > String wsdl = emitter.emitToString(Emitter.MODE_ALL);
> >
> >
> > when calling the emitToString() method, I get a NullPointerException.
> > I worked when I was using previous version of axis.
> > What do I do wrong here ?
> >
> > Thanks for your help
> >
> > Regards,
> >
> > Virginie
> >
>
>
Re: Null Pointer Exception
Posted by Virginie Legrand <Vi...@sophia.inria.fr>.
Does anybody never encounter this issue ??
Virginie Legrand wrote:
> Hello,
>
> I use axis axis-1_2RC3 and wsdl4j in order to generate a WSDL file.
> Here is a sample of my code :
> Emitter emitter = new Emitter();
> emitter.setDisallowedMethods(disallowedMethods);
> emitter.setAllowedMethods(allowedMethods);
> emitter.setLocationUrl(urlRouter);
> emitter.setIntfNamespace(namespace);
> emitter.setImplNamespace(namespace);
> emitter.setCls(c);
> emitter.setServiceElementName(serviceName);
> String wsdl = emitter.emitToString(Emitter.MODE_ALL);
>
>
> when calling the emitToString() method, I get a NullPointerException.
> I worked when I was using previous version of axis.
> What do I do wrong here ?
>
> Thanks for your help
>
> Regards,
>
> Virginie
>