You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Balkrishnan.V" <ba...@iiitb.net> on 2009/03/07 07:12:58 UTC

servlet simple-server-test threw exception java.lang.NullPointerException ...

Hi,

I am using the Simple-Server from the Sandbox.

When I load a text-file of size 4MB to generate the corresponding annotation-xml
then I get the following exception:

==============================================================================
org.apache.uima.simpleserver.servlet.SimpleServerServlet: POST request received:
Sat Mar 07 00:51:48 IST 2009
Mar 7, 2009 12:51:48 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet simple-server-test threw exception
java.lang.NullPointerException
	at org.apache.uima.simpleserver.servlet.SimpleServerServlet.analyze
(SimpleServerServlet.java:194)
	at org.apache.uima.simpleserver.servlet.SimpleServerServlet.doPost
(SimpleServerServlet.java:181)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process
(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Unknown Source)
==============================================================================

Can you please let me know how I can resolve this error ?

Thanks in Advance,

--Balkrishnan.V




Re: servlet simple-server-test threw exception java.lang.NullPointerException ...

Posted by Marshall Schor <ms...@schor.com>.
Hi -

The error below says "NullPointerException" on line 194 in the
SimpleServerServlet.

That line in the source code (assuming you're running version 2.2.2,
from the latest release) is:

    System.out.println("Given text: " + text.substring(0, Math.min(50,
text.length())));

The only way that line can produce a null pointer exception is if the
value of the "text" field is null.

That field is set a few lines above, using this code:

    String text = request.getParameter("text");

(request is the representation of the http request).

So it would seem that you perhaps did not formulate your http request
correctly. 

If you need more help, please reply with more details, including the
exact line you are "POST"-ing to the simple server.

-Marshall
 
Balkrishnan.V wrote:
> Hi,
>
> I am using the Simple-Server from the Sandbox.
>
> When I load a text-file of size 4MB to generate the corresponding annotation-xml
> then I get the following exception:
>
> ==============================================================================
> org.apache.uima.simpleserver.servlet.SimpleServerServlet: POST request received:
> Sat Mar 07 00:51:48 IST 2009
> Mar 7, 2009 12:51:48 AM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet simple-server-test threw exception
> java.lang.NullPointerException
> 	at org.apache.uima.simpleserver.servlet.SimpleServerServlet.analyze
> (SimpleServerServlet.java:194)
> 	at org.apache.uima.simpleserver.servlet.SimpleServerServlet.doPost
> (SimpleServerServlet.java:181)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:290)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:206)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke
> (StandardWrapperValve.java:233)
> 	at org.apache.catalina.core.StandardContextValve.invoke
> (StandardContextValve.java:191)
> 	at org.apache.catalina.core.StandardHostValve.invoke
> (StandardHostValve.java:128)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke
> (ErrorReportValve.java:102)
> 	at org.apache.catalina.core.StandardEngineValve.invoke
> (StandardEngineValve.java:109)
> 	at org.apache.catalina.connector.CoyoteAdapter.service
> (CoyoteAdapter.java:286)
> 	at org.apache.coyote.http11.Http11Processor.process
> (Http11Processor.java:845)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process
> (Http11Protocol.java:583)
> 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> 	at java.lang.Thread.run(Unknown Source)
> ==============================================================================
>
> Can you please let me know how I can resolve this error ?
>
> Thanks in Advance,
>
> --Balkrishnan.V
>
>
>
>
>
>