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 "Salman A. Kagzi" <sa...@s7software.com> on 2009/04/28 10:30:22 UTC

Error communicating between two websevice

Hi All,

 

I am working on a web service which acts as a client as well as server.

I am trying to deploy two instances of this web service on separate servers
and try and setup a communication link between them.

 

On M/C-1 I have installed axis2 1.3 under JBoss 4.2.2 and have deployed my
web service.

On M/C-2 I have installed a standalone axis2 1.3 server and have my service
deployed there.

Both deployments are successful and no error/exception is seen.

 

I have a client running on M/C-3, this is a simple java program to call my
webservice deployed on M/C-1 which will in turn call the webservice on
M/C-2.

Webservice on M/C-2 returns some data through callback to M/C-1 which in
turn does performs some database related task based on the response
received.

 

When I invoke the client to kick off the communication process by invoking
WS on M/C-1

 

Following exception is seen on M/C-1 (Axis2 1.3 under JBoss 4.2.2)

[ERROR] Received an internal server error : Internal Server Error

Exception in thread "HttpCoreNIOSender"

java.lang.NullPointerException

     at
org.apache.axis2.transport.nhttp.ClientHandler.inputReady(ClientHandler.java
:236)

     at
org.apache.axis2.transport.nhttp.LoggingNHttpClientHandler.inputReady(Loggin
gNHttpClientHandler.java:113)

     at
org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNH
ttpClientConnection.java:111)

     at
org.apache.axis2.transport.nhttp.PlainClientIOEventDispatch.inputReady(Plain
ClientIOEventDispatch.java:71)

     at
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:6
8)

     at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIORe
actor.java:160)

     at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOR
eactor.java:145)

     at
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor
.java:127)

     at
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(Abs
tractMultiworkerIOReactor.java:162)

     at java.lang.Thread.run(Thread.java:595)

 

 

And following exception is seen on M/C-2 (Axis2 1.3 Standalone server)

[ERROR] Error processing POST request

org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation
not found is http://192.168.1.28:9000/axis2/services/Service2 and the WSA
Action = null

        at
org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java
:86)

        at org.apache.axis2.engine.Phase.invoke(Phase.java:308)

        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)

        at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
TPTransportUtils.java:275)

        at
org.apache.axis2.transport.nhttp.ServerWorker.processPost(ServerWorker.java:
207)

        at
org.apache.axis2.transport.nhttp.ServerWorker.run(ServerWorker.java:171)

        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run
Task(ThreadPoolExecutor.java:665)

        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:690)

        at java.lang.Thread.run(Thread.java:595)

 

If I replace M/C-1 setup with one similar to on M/C-2 i.e. if I use Axis2
standalone server in place of one Axis2 in JBoss, then everything starts
working fine, without any exception or anything.

 

To configure JBoss I have made following changes to server.xml in
jb0ss-web.deployer: 

<Connector port="8080" address="${jboss.bind.address}"    

         maxThreads="250" maxHttpHeaderSize="8192"

         emptySessionPath="true"
protocol="org.apache.coyote.http11.Http11NioProtocol"

         enableLookups="false" redirectPort="443" acceptCount="100"

         connectionTimeout="20000" disableUploadTimeout="true" />

 

 

To Configure Axis2 I have made following changes to Axis2.xml:

<transportReceiver name="http"
class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">

                <parameter name="port" locked="false">9000</parameter>

                <parameter name="non-blocking"
locked="false">true</parameter>

    </transportReceiver>

 

 

To demonstrate this issue I have created a sample webserice and client, and
have attached the source files for same.

 

Using the sample:

1.	Download the sample and unzip it. 
2.	Place Axis2 1.3 and its supporting jars in the lib folder
3.	Deploying webservice 

a.	To build web service archive use command *ant create.sample.dist*
from the unzipped folder. 
b.	sampleService.aar will be created in the DIST directory. 
c.	To deploy this web service, place the sampleService.aar file in
"repository/service" folder of Axis2 

4.	Invoking client 

a.	Build the web service if not already built. 
b.	Use command "script/ExecuteClient.sh" or "script/ExecuteClient.bat"
$param1 $param2 

                                                              i.      Where,
$param1 = <IP>:<port> system hosting service 1

                                                            ii.      And,
$param2 = <IP>:<port> system hosting service 2

 

I have been fighting to get through this for quite a long time, please help
me resolve this.

 

Thanks,

-Salman


RE: Error communicating between two websevice

Posted by "Salman A. Kagzi" <sa...@s7software.com>.
Hi Asankha,

 

The reason I am going with the nhttp transport, is that I have these
services running over HTTPS as well and I am not sure if there is any other
way to use HTTPS with Axis2 without using nio connectors.

 

Please do let me know if there is an alternative available.

 

Thanks,

-Salman

 

 

  _____  

From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of Asankha
C. Perera
Sent: Wednesday, April 29, 2009 7:44 AM
To: axis-user@ws.apache.org
Subject: Re: Error communicating between two websevice

 

Hi Salman



I am working on a web service which acts as a client as well as server. 

I am trying to deploy two instances of this web service on separate servers
and try and setup a communication link between them.

.... 

[ERROR] Received an internal server error : Internal Server Error

Exception in thread "HttpCoreNIOSender"

java.lang.NullPointerException

     at
org.apache.axis2.transport.nhttp.ClientHandler.inputReady(ClientHandler.java
:236)

.... 

To Configure Axis2 I have made following changes to Axis2.xml:

<transportReceiver name="http"
class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">

                <parameter name="port" locked="false">9000</parameter>

                <parameter name="non-blocking"
locked="false">true</parameter>

    </transportReceiver>

The "org.apache.axis2.transport.nhttp" transports are no longer bundled with
vanilla Axis2. Unless you have any specific requirement, please switch over
to the normal http transports, and possibly your problems would go away.

cheers
asankha



-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org
 
http://esbmagic.blogspot.com
 
 
 

Re: Error communicating between two websevice

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Salman
> I am working on a web service which acts as a client as well as server.
>
> I am trying to deploy two instances of this web service on separate 
> servers and try and setup a communication link between them.
>
> ....
>
> [ERROR] Received an internal server error : Internal Server Error
>
> Exception in thread "HttpCoreNIOSender"
>
> java.lang.NullPointerException
>
>      at 
> org.apache.axis2.transport.nhttp.ClientHandler.inputReady(ClientHandler.java:236)
>
> ....
>
> To Configure Axis2 I have made following changes to Axis2.xml:
>
> <transportReceiver name="http" 
> class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">
>
>                 <parameter name="port" locked="false">9000</parameter>
>
>                 <parameter name="non-blocking" 
> locked="false">true</parameter>
>
>     </transportReceiver>
>
The "org.apache.axis2.transport.nhttp" transports are no longer bundled 
with vanilla Axis2. Unless you have any specific requirement, please 
switch over to the normal http transports, and possibly your problems 
would go away.

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com