users@jax-rpc.java.net

web service serialization error when server under heavy load (repost)

From: Jair da Silva Ferreira Júnior <j2_at_amazon.com.br>
Date: Mon, 12 Apr 2004 16:02:33 -0300

Hi everybody,

    As nobody could give me any hint on how to solve my problem, I am
reposting it again hoping someone can help me now. Here is my problem:

    I am using j2sdk1.4.2, JWSDP 1.3, Windows XP Professional (sp1) and
Tomcat 5.0.19 as the servlet/jsp container (I don't use the Tomcat bundled
with JWSDP1.3).
    I am developing a web service using JAX-RPC which is accessed by a Java
Static Stub Client.
    The problem is that I keep getting a serialization error caused by a
NullPointerException on the server side (web service endpoint) when many
clients (about 30) try to access the web service simultaneosly. If there is
a small number of concurrent accesses (about 10) the problem does not happen
and everything works fine. The strangest thing is that my endpoint
implementation class successfuly processes all the requests (I logged the
implementation class execution and no exception is throw and the expected
results are generated). It looks like JAX-RPC is not able to correctly
serialize my response objects (SearchResult and SearchResultEntry) and send
it back to the client when the server is under heavy load.
    I updated the JAX-RPC implementation in JWSDP 1.3 using the JAX-RPC
1.1_03 Patch (replacing the jaxrpc-impl.jar file as instructed in the patch
README file) hoping it would solve the problem, but the problem remained the
same.
    When I use the tomcat bundled with jwsdp1.3 the NPE does not occur,
instead I get a java.net.ConnectException( Connection refused: connect) with
30 concurrent clients. With 25 concurrent clients everything runs ok, no NPE
and no java.net.ConnectException. So, the NPE only happens with tomcat
5.0.19 when there are more than 10 simultaneous clients running.
    By the way, I simulate the concurrent running clients using a JUnit
TestCase which runs in a separate JVM from Tomcat.
    I am attaching the exception stack trace and the generated WSDL file in
the end of this email to help you better understand the problem.
    Am I doing something wrong? Is tomcat 5.0.19 the problem? Is there any
tomcat configuration issues I should know? Any help would be really
appreciated.
 Thank you very much for your help.

Thanks,
 Jair Jr

=================
exception stack trace
=================
03/04/2004 11:06:57 com.sun.xml.rpc.server.StreamingHandler handle
SEVERE: serialization error: java.lang.NullPointerException
serialization error: java.lang.NullPointerException
 at
com.sun.xml.rpc.encoding.ObjectSerializerBase.serialize(ObjectSerializerBase
.java:113)
 at
com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.serializeInstance(Refer
enceableSerializerImpl.java:194)
 at
com.sun.xml.rpc.encoding.SOAPSerializationContext.serializeMultiRefObjects(S
OAPSerializationContext.java:94)
 at
com.sun.xml.rpc.server.StreamingHandler.writeResponse(StreamingHandler.java:
603)
 at
com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:282)
 at
com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelega
te.java:316)
 at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:284)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:257)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:245)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:199)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184
)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:149)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:156)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:732)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:688)
 at java.lang.Thread.run(Thread.java:534)

CAUSE:

java.lang.NullPointerException
 at
com.iespa.searchengine.server.SearchResultEntry__IESPASearch__SOAPSerializer
.doSerializeInstance(SearchResultEntry__IESPASearch__SOAPSerializer.java:86)
 at
com.sun.xml.rpc.encoding.ObjectSerializerBase.serialize(ObjectSerializerBase
.java:102)
 at
com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.serializeInstance(Refer
enceableSerializerImpl.java:194)
 at
com.sun.xml.rpc.encoding.SOAPSerializationContext.serializeMultiRefObjects(S
OAPSerializationContext.java:94)
 at
com.sun.xml.rpc.server.StreamingHandler.writeResponse(StreamingHandler.java:
603)
 at
com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:282)
 at
com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelega
te.java:316)
 at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:284)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:257)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:245)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:199)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184
)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:149)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:156)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:732)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:688)
 at java.lang.Thread.run(Thread.java:534)

=============
WSDL File
=============
<?xml version="1.0" encoding="UTF-8"?>

<definitions name="IESPASearchService" targetNamespace="urn:Foo"
xmlns:tns="urn:Foo" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <types>
    <schema targetNamespace="http://java.sun.com/jax-rpc-ri/internal"
xmlns:tns="http://java.sun.com/jax-rpc-ri/internal"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <import namespace="urn:Foo"/>
      <complexType name="collection">
        <complexContent>
          <restriction base="soap11-enc:Array">
            <attribute ref="soap11-enc:arrayType"
wsdl:arrayType="anyType[]"/></restriction></complexContent></complexType></s
chema>
    <schema targetNamespace="urn:Foo" xmlns:tns="urn:Foo"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="http://java.sun.com/jax-rpc-ri/internal"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <import namespace="http://java.sun.com/jax-rpc-ri/internal"/>
      <complexType name="SearchParameter">
        <sequence>
          <element name="entriesCount" type="int"/>
          <element name="firstEntryIndex" type="int"/>
          <element name="search" type="string"/>
          <element name="searchMode"
type="string"/></sequence></complexType>
      <complexType name="SearchResult">
        <sequence>
          <element name="entries" type="ns2:collection"/>
          <element name="firstEntryIndex" type="int"/>
          <element name="lastEntryIndex" type="int"/>
          <element name="next" type="boolean"/>
          <element name="nextFirstEntryIndex" type="int"/>
          <element name="previous" type="boolean"/>
          <element name="previousFirstEntryIndex" type="int"/>
          <element name="totalEntriesCount"
type="int"/></sequence></complexType>
      <complexType name="SearchException">
        <sequence>
          <element name="message" type="string"
nillable="true"/></sequence></complexType>
      <complexType name="SearchResultEntry">
        <sequence>
          <element name="name" type="string"/>
          <element name="url"
type="string"/></sequence></complexType></schema></types>
  <message name="LibraryIF_search">
    <part name="SearchParameter_1" type="tns:SearchParameter"/></message>
  <message name="LibraryIF_searchResponse">
    <part name="result" type="tns:SearchResult"/></message>
  <message name="SearchException">
    <part name="SearchException" type="tns:SearchException"/></message>
  <portType name="LibraryIF">
    <operation name="search" parameterOrder="SearchParameter_1">
      <input message="tns:LibraryIF_search"/>
      <output message="tns:LibraryIF_searchResponse"/>
      <fault name="SearchException"
message="tns:SearchException"/></operation></portType>
  <binding name="LibraryIFBinding" type="tns:LibraryIF">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
    <operation name="search">
      <soap:operation soapAction=""/>
      <input>
        <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="encoded" namespace="urn:Foo"/></input>
      <output>
        <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="encoded" namespace="urn:Foo"/></output>
      <fault name="SearchException">
        <soap:fault name="SearchException"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="urn:Foo"/></fault></operation></binding>
  <service name="IESPASearchService">
    <port name="LibraryIFPort" binding="tns:LibraryIFBinding">
      <soap:address
location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net