You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by Jerome Camilleri <je...@bull.net> on 2007/07/02 17:21:07 UTC

Reused of configurationContext : Sandesha2 sequence has been terminated

Hi,

Related to an Axis2-1.2 bugs (corrected is seems) my client try to send 
with Sandesha2-1.2 multiple sequence of message (with MTOM file attached).
Because of the allocation of ressource and to optimised it I try to 
factorize the initialization of the Axis2 context.

So my client try this pseudo code :

configurationContext ctx = factory.get(client-repo); // create during 
the first call
stub factory.get( ctx ); // create during the first call

stub.engageModule(sandesha2);

for (i=0 ; i<=3; i++) {
   if (i==3)
      stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
   stub.sendRequest(putFileRequest);
}

SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(),
                                maxWaitingTimeSequenceCompleted);

For the first call my sequence of 3 message is send correctly but my 
second call is failed with this sandesha exception :

Impossible to call remote service
Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception when 
processing an out message: org.apache.sandesha2.SandeshaException: 
Sandesha2 could not send the message on sequence 
http://localhost:9001/axis2/services/Service1 as the sequence has been 
terminated..
        at 
org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:159)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:383)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433)
        at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:256)
        at 
fr.bull.emetteur.service.Stub.putFileRequestReponse(Stub.java:170)
        at fr.bull.emetteur.Emetteur.Emetteur.send(Emetteur.java:116)
        ... 5 more


Before configurationContext factorization all run well ...

Someone could help me pleased ?


Regards


Jérôme

Re: Reused of configurationContext : Sandesha2 sequence has been terminated

Posted by Jerome Camilleri <je...@bull.net>.
Hi,

Find into Sandesha2 1.2 code that wsaTo and sequence_key identify a 
sequence into the storageManager, I try to generate a sequenceKey for 
eatch sequence and hope that can solve my problem but no luck ;) I have 
another strange exception :

Caused by: java.lang.IllegalThreadStateException
        at java.lang.Thread.start(Thread.java:571)
        at 
org.apache.sandesha2.workers.SandeshaThread.runThreadForSequence(SandeshaThread.java:169)
        at 
org.apache.sandesha2.util.SandeshaUtil.startWorkersForSequence(SandeshaUtil.java:164)
        at 
org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor.addCreateSequenceMessage(ApplicationMsgProcessor.java:488)
        at 
org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor.processOutMessage(ApplicationMsgProcessor.java:251)
        at 
org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:129)


My pseudo client code becomes :
configurationContext ctx = factory.get(client-repo); // create during 
the first call
stub = factory.get( ctx , targetEndPoint); // create during the first call

stub.getOptions().setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID, 
SandeshaUtil.getUUID());
stub.getOptions().setProperty(SandeshaClientConstants.SEQUENCE_KEY, 
SandeshaUtil.getUUID());

for (i=0 ; i<=3; i++) {
  if (i==3)
     stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
  stub.sendRequest(putFileRequest);
}

SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(),
                               maxWaitingTimeSequenceCompleted);

AxisModule moduleDesc = (AxisModule) 
configurationContext.getAxisConfiguration().getModules()
                        .get("sandesha2-1.2");
if (moduleDesc != null) {
      Module sandeshaModule = moduleDesc.getModule();
      if (sandeshaModule != null) {
                                
sandeshaModule.shutdown(configurationContext);
      }
}

Jérôme


Jerome Camilleri wrote:
> Hi,
>
> I try to have a look into the code and it's seems that the second 
> sequence (wich failed) is find into the storageManager (InMemory) by 
> the internalSequenceId (which is the same that the first sequence 
> because it seems that the wsa:To field is used ?)
> So the ApplicationMsgProcess.processOutMessage  [192] test 
> rmsBean.isTerminateAdded() is true because the precedent RM sequence  
> is finished (after the lastMessage send, I used the Submitted WSRM 
> specification ...).
>
> So how force sandesha to create a new sequence ?
>
> On the documentation the only thing about this subject that a found 
> was "Creating a Sequence Without Sending any Messages"...but I want to 
> send messages into my sequence.;)
>
> Someone could help me pleased ?
>
> Regards
>
> Jérôme
>
> Jerome Camilleri wrote:
>> Hi,
>>
>> I confirm that without Sandesha there is no problem to reused  the 
>> configurationContext and send multiple messages with it.
>> So it's a specific problem of RM module with my specific used (but 
>> advise by Axis2 team ;) in my context...)
>>
>> I already had a problem to shutdow the sandesha module at this end of 
>> my client (with Axis2 1.2 MEP IN-OUT synchrone a listener is not 
>> start and sandesha is never shutdown...) is it related ?
>>
>> So how configure the contextContext to re-used it with sandesha 
>> without re-create it pleased ?
>>
>>
>> Regards.
>>
>> Jérôme
>>
>>
>> Jerome Camilleri wrote:
>>> Hi,
>>>
>>> Related to an Axis2-1.2 bugs (corrected is seems) my client try to 
>>> send with Sandesha2-1.2 multiple sequence of message (with MTOM file 
>>> attached).
>>> Because of the allocation of ressource and to optimised it I try to 
>>> factorize the initialization of the Axis2 context.
>>>
>>> So my client try this pseudo code :
>>>
>>> configurationContext ctx = factory.get(client-repo); // create 
>>> during the first call
>>> stub factory.get( ctx ); // create during the first call
>>>
>>> stub.engageModule(sandesha2);
>>>
>>> for (i=0 ; i<=3; i++) {
>>>   if (i==3)
>>>      stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
>>>   stub.sendRequest(putFileRequest);
>>> }
>>>
>>> SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(),
>>>                                maxWaitingTimeSequenceCompleted);
>>>
>>> For the first call my sequence of 3 message is send correctly but my 
>>> second call is failed with this sandesha exception :
>>>
>>> Impossible to call remote service
>>> Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception 
>>> when processing an out message: 
>>> org.apache.sandesha2.SandeshaException: Sandesha2 could not send the 
>>> message on sequence http://localhost:9001/axis2/services/Service1 as 
>>> the sequence has been terminated..
>>>        at 
>>> org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:159) 
>>>
>>>        at org.apache.axis2.engine.Phase.invoke(Phase.java:383)
>>>        at 
>>> org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203)
>>>        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433)
>>>        at 
>>> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:256) 
>>>
>>>        at 
>>> fr.bull.emetteur.service.Stub.putFileRequestReponse(Stub.java:170)
>>>        at fr.bull.emetteur.Emetteur.Emetteur.send(Emetteur.java:116)
>>>        ... 5 more
>>>
>>>
>>> Before configurationContext factorization all run well ...
>>>
>>> Someone could help me pleased ?
>>>
>>>
>>> Regards
>>>
>>>
>>> Jérôme
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Subject:
>>> Too many open file with Axis2 1.2
>>> From:
>>> Jerome Camilleri <je...@bull.net>
>>> Date:
>>> Mon, 18 Jun 2007 16:24:42 +0200
>>> To:
>>> axis-user@ws.apache.org
>>>
>>> To:
>>> axis-user@ws.apache.org
>>>
>>>
>>> Hi,
>>>
>>> I used client Axis2 1.2 to send file attached to my WebService.
>>> On my client, I used the 
>>> ConfigurationContextFactory.createConfigurationContextFromFileSystem 
>>> with a repository containing modules like addressing and sandesha2.
>>> My deamon scan a directory to send the message and create for eatch 
>>> a new configurationContext and a new stub.
>>> After eatch sending I call methods to clear the memory (see the end 
>>> of this mail) but it seems that some files is lock by my deamon 
>>> because after about 300 calls my system is very slow and client stop 
>>> with the message "can't open file : Too many open file" in the 
>>> console (ulimit -n = 1024)
>>>
>>> When I launch the lsof command, I noticed that 4 files is adding for 
>>> one file sending
>>> lsof | grep /tmp/axis2        java      21584    camillej   86r      
>>> REG        3,3   352079      76659 /tmp/axis244513sandesha2-1.2.mar
>>> java      21584    camillej   87r      REG        3,3    37572      
>>> 76658 /tmp/axis244512addressing-1.2.mar
>>> java      21584    camillej   88r      REG        3,3     8379      
>>> 76660 /tmp/axis244514soapmonitor-1.2.mar
>>> java      21584    camillej   89r      REG        3,3     1444      
>>> 76661 /tmp/axis244515version.aar
>>>
>>> So my client finally code :
>>>                HashMap listeModuleDesc = 
>>> configurationContext.getAxisConfiguration().getModules();
>>>                Iterator itListeModuleDesc = 
>>> listeModuleDesc.keySet().iterator();
>>>
>>>                while(itListeModuleDesc.hasNext())
>>>                {
>>>                    String moduleDescId = 
>>> (String)itListeModuleDesc.next();
>>>                    AxisModule moduleDesc = 
>>> (AxisModule)listeModuleDesc.get(moduleDescId);
>>>                    if (moduleDesc != null) {
>>>                        Module module = moduleDesc.getModule();
>>>                        if (module != null) {
>>>                            module.shutdown(configurationContext);
>>>                        }
>>>                        
>>> configurationContext.getAxisConfiguration().disengageModule(moduleDesc); 
>>>
>>>                    }
>>>                }
>>>
>>>                if (stub != null) {
>>>                    stub.cleanup();
>>>                 }
>>>
>>>                if (configurationContext != null) {
>>>                    configurationContext.cleanupContexts();
>>>                    configurationContext.terminate();
>>>                }
>>>
>>>                stub = null;
>>>                configurationContext = null;
>>>
>>> Can someone I have an idea about my problem... ?
>>>
>>> Regards
>>>
>>> Jérôme
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>>
>


Re: Reused of configurationContext : Sandesha2 sequence has been terminated

Posted by Jerome Camilleri <je...@bull.net>.
Thanks for your message Andrew but that don't run ;(

Exception occur during second call  (exactly the same of my previous 
attempt ...) :
Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception when 
processing an out message: java.lang.IllegalThreadStateException.
Caused by: java.lang.IllegalThreadStateException
        at java.lang.Thread.start(Thread.java:571)
        at 
org.apache.sandesha2.workers.SandeshaThread.runThreadForSequence(SandeshaThread.java:169)
        at 
org.apache.sandesha2.util.SandeshaUtil.startWorkersForSequence(SandeshaUtil.java:164)
        at 
org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor.addCreateSequenceMessage(ApplicationMsgProcessor.java:488)
        at 
org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor.processOutMessage(ApplicationMsgProcessor.java:251)
        at 
org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:129)
        ... 13 more


Jérôme

Andrew K Gatford wrote:
> You are hitting exactly the problem you are describing.
>
> The simple solution for you is to add the following,
>
> stub.engageModule(sandesha2); 
>
> SandeshaClient.createSequence(stub._getServiceClient(), false, null);
>
> for (i=0 ; i<=3; i++) { 
>   if (i==3) 
>      stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); 
>   stub.sendRequest(putFileRequest); 
> } 
>
> SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(), 
>                                maxWaitingTimeSequenceCompleted); 
>
>
> The createSequence will cleanup any existing sequences and generate a new 
> one for the next set of messages
>
> Andrew Gatford
>
> Hursley MP211
> Telephone : 
> Internal (7) 245743 
> External 01962 815743
> Internet : gatfora@uk.ibm.com
>
>
>
> Jerome Camilleri <je...@bull.net> 
> 03/07/2007 14:40
> Please respond to
> jerome.camilleri@bull.net
>
>
> To
> sandesha-dev@ws.apache.org
> cc
>
> Subject
> Re: Reused of configurationContext : Sandesha2 sequence has been 
> terminated
>
>
>
>
>
>
> Hi,
>
> I try to have a look into the code and it's seems that the second sequence 
> (wich failed) is find into the storageManager (InMemory) by the 
> internalSequenceId (which is the same that the first sequence because it 
> seems that the wsa:To field is used ?)
> So the ApplicationMsgProcess.processOutMessage  [192] test 
> rmsBean.isTerminateAdded() is true because the precedent RM sequence  is 
> finished (after the lastMessage send, I used the Submitted WSRM 
> specification ...).
>
> So how force sandesha to create a new sequence ?
>
> On the documentation the only thing about this subject that a found was 
> "Creating a Sequence Without Sending any Messages"...but I want to send 
> messages into my sequence.;)
>
> Someone could help me pleased ?
>
> Regards
>
> Jérôme
>
> Jerome Camilleri wrote: 
> Hi,
>
> I confirm that without Sandesha there is no problem to reused  the 
> configurationContext and send multiple messages with it.
> So it's a specific problem of RM module with my specific used (but advise 
> by Axis2 team ;) in my context...)
>
> I already had a problem to shutdow the sandesha module at this end of my 
> client (with Axis2 1.2 MEP IN-OUT synchrone a listener is not start and 
> sandesha is never shutdown...) is it related ?
>
> So how configure the contextContext to re-used it with sandesha without 
> re-create it pleased ?
>
>
> Regards.
>
> Jérôme
>
>
> Jerome Camilleri wrote: 
> Hi, 
>
> Related to an Axis2-1.2 bugs (corrected is seems) my client try to send 
> with Sandesha2-1.2 multiple sequence of message (with MTOM file attached). 
>
> Because of the allocation of ressource and to optimised it I try to 
> factorize the initialization of the Axis2 context. 
>
> So my client try this pseudo code : 
>
> configurationContext ctx = factory.get(client-repo); // create during the 
> first call 
> stub factory.get( ctx ); // create during the first call 
>
> stub.engageModule(sandesha2); 
>
> for (i=0 ; i<=3; i++) { 
>   if (i==3) 
>      stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); 
>   stub.sendRequest(putFileRequest); 
> } 
>
> SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(), 
>                                maxWaitingTimeSequenceCompleted); 
>
> For the first call my sequence of 3 message is send correctly but my 
> second call is failed with this sandesha exception : 
>
> Impossible to call remote service 
> Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception when 
> processing an out message: org.apache.sandesha2.SandeshaException: 
> Sandesha2 could not send the message on sequence 
> http://localhost:9001/axis2/services/Service1 as the sequence has been 
> terminated.. 
>        at 
> org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:159) 
>
>        at org.apache.axis2.engine.Phase.invoke(Phase.java:383) 
>        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203) 
>        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433) 
>        at 
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:256) 
>
>        at 
> fr.bull.emetteur.service.Stub.putFileRequestReponse(Stub.java:170) 
>        at fr.bull.emetteur.Emetteur.Emetteur.send(Emetteur.java:116) 
>        ... 5 more 
>
>
> Before configurationContext factorization all run well ... 
>
> Someone could help me pleased ? 
>
>
> Regards 
>
>
> Jérôme 
>
>
> Subject: Too many open file with Axis2 1.2
> From: Jerome Camilleri <je...@bull.net>
> Date: Mon, 18 Jun 2007 16:24:42 +0200
> To: axis-user@ws.apache.org
>
> To: axis-user@ws.apache.org
>
> Hi, 
>
> I used client Axis2 1.2 to send file attached to my WebService. 
> On my client, I used the 
> ConfigurationContextFactory.createConfigurationContextFromFileSystem with 
> a repository containing modules like addressing and sandesha2. 
> My deamon scan a directory to send the message and create for eatch a new 
> configurationContext and a new stub. 
> After eatch sending I call methods to clear the memory (see the end of 
> this mail) but it seems that some files is lock by my deamon because after 
> about 300 calls my system is very slow and client stop with the message 
> "can't open file : Too many open file" in the console (ulimit -n = 1024) 
>
> When I launch the lsof command, I noticed that 4 files is adding for one 
> file sending 
> lsof | grep /tmp/axis2        java      21584    camillej   86r      REG   
>   3,3   352079      76659 /tmp/axis244513sandesha2-1.2.mar 
> java      21584    camillej   87r      REG        3,3    37572      76658 
> /tmp/axis244512addressing-1.2.mar 
> java      21584    camillej   88r      REG        3,3     8379      76660 
> /tmp/axis244514soapmonitor-1.2.mar 
> java      21584    camillej   89r      REG        3,3     1444      76661 
> /tmp/axis244515version.aar 
>
> So my client finally code : 
>                HashMap listeModuleDesc = 
> configurationContext.getAxisConfiguration().getModules(); 
>                Iterator itListeModuleDesc = 
> listeModuleDesc.keySet().iterator(); 
>
>                while(itListeModuleDesc.hasNext()) 
>                { 
>                    String moduleDescId = (String)itListeModuleDesc.next(); 
>
>                    AxisModule moduleDesc = 
> (AxisModule)listeModuleDesc.get(moduleDescId); 
>                    if (moduleDesc != null) { 
>                        Module module = moduleDesc.getModule(); 
>                        if (module != null) { 
>                            module.shutdown(configurationContext); 
>                        } 
>  configurationContext.getAxisConfiguration().disengageModule(moduleDesc); 
>                    } 
>                } 
>
>                if (stub != null) { 
>                    stub.cleanup(); 
>                 } 
>
>                if (configurationContext != null) { 
>                    configurationContext.cleanupContexts(); 
>                    configurationContext.terminate(); 
>                } 
>
>                stub = null; 
>                configurationContext = null; 
>
> Can someone I have an idea about my problem... ? 
>
> Regards 
>
> Jérôme 
>
>
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org 
> For additional commands, e-mail: axis-user-help@ws.apache.org 
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>
>
>
>
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number 
> 741598. 
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
>
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Re: Reused of configurationContext : Sandesha2 sequence has been terminated

Posted by Andrew K Gatford <GA...@uk.ibm.com>.
You are hitting exactly the problem you are describing.

The simple solution for you is to add the following,

stub.engageModule(sandesha2); 

SandeshaClient.createSequence(stub._getServiceClient(), false, null);

for (i=0 ; i<=3; i++) { 
  if (i==3) 
     stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); 
  stub.sendRequest(putFileRequest); 
} 

SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(), 
                               maxWaitingTimeSequenceCompleted); 


The createSequence will cleanup any existing sequences and generate a new 
one for the next set of messages

Andrew Gatford

Hursley MP211
Telephone : 
Internal (7) 245743 
External 01962 815743
Internet : gatfora@uk.ibm.com



Jerome Camilleri <je...@bull.net> 
03/07/2007 14:40
Please respond to
jerome.camilleri@bull.net


To
sandesha-dev@ws.apache.org
cc

Subject
Re: Reused of configurationContext : Sandesha2 sequence has been 
terminated






Hi,

I try to have a look into the code and it's seems that the second sequence 
(wich failed) is find into the storageManager (InMemory) by the 
internalSequenceId (which is the same that the first sequence because it 
seems that the wsa:To field is used ?)
So the ApplicationMsgProcess.processOutMessage  [192] test 
rmsBean.isTerminateAdded() is true because the precedent RM sequence  is 
finished (after the lastMessage send, I used the Submitted WSRM 
specification ...).

So how force sandesha to create a new sequence ?

On the documentation the only thing about this subject that a found was 
"Creating a Sequence Without Sending any Messages"...but I want to send 
messages into my sequence.;)

Someone could help me pleased ?

Regards

Jérôme

Jerome Camilleri wrote: 
Hi,

I confirm that without Sandesha there is no problem to reused  the 
configurationContext and send multiple messages with it.
So it's a specific problem of RM module with my specific used (but advise 
by Axis2 team ;) in my context...)

I already had a problem to shutdow the sandesha module at this end of my 
client (with Axis2 1.2 MEP IN-OUT synchrone a listener is not start and 
sandesha is never shutdown...) is it related ?

So how configure the contextContext to re-used it with sandesha without 
re-create it pleased ?


Regards.

Jérôme


Jerome Camilleri wrote: 
Hi, 

Related to an Axis2-1.2 bugs (corrected is seems) my client try to send 
with Sandesha2-1.2 multiple sequence of message (with MTOM file attached). 

Because of the allocation of ressource and to optimised it I try to 
factorize the initialization of the Axis2 context. 

So my client try this pseudo code : 

configurationContext ctx = factory.get(client-repo); // create during the 
first call 
stub factory.get( ctx ); // create during the first call 

stub.engageModule(sandesha2); 

for (i=0 ; i<=3; i++) { 
  if (i==3) 
     stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); 
  stub.sendRequest(putFileRequest); 
} 

SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(), 
                               maxWaitingTimeSequenceCompleted); 

For the first call my sequence of 3 message is send correctly but my 
second call is failed with this sandesha exception : 

Impossible to call remote service 
Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception when 
processing an out message: org.apache.sandesha2.SandeshaException: 
Sandesha2 could not send the message on sequence 
http://localhost:9001/axis2/services/Service1 as the sequence has been 
terminated.. 
       at 
org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:159) 

       at org.apache.axis2.engine.Phase.invoke(Phase.java:383) 
       at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203) 
       at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433) 
       at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:256) 

       at 
fr.bull.emetteur.service.Stub.putFileRequestReponse(Stub.java:170) 
       at fr.bull.emetteur.Emetteur.Emetteur.send(Emetteur.java:116) 
       ... 5 more 


Before configurationContext factorization all run well ... 

Someone could help me pleased ? 


Regards 


Jérôme 


Subject: Too many open file with Axis2 1.2
From: Jerome Camilleri <je...@bull.net>
Date: Mon, 18 Jun 2007 16:24:42 +0200
To: axis-user@ws.apache.org

To: axis-user@ws.apache.org

Hi, 

I used client Axis2 1.2 to send file attached to my WebService. 
On my client, I used the 
ConfigurationContextFactory.createConfigurationContextFromFileSystem with 
a repository containing modules like addressing and sandesha2. 
My deamon scan a directory to send the message and create for eatch a new 
configurationContext and a new stub. 
After eatch sending I call methods to clear the memory (see the end of 
this mail) but it seems that some files is lock by my deamon because after 
about 300 calls my system is very slow and client stop with the message 
"can't open file : Too many open file" in the console (ulimit -n = 1024) 

When I launch the lsof command, I noticed that 4 files is adding for one 
file sending 
lsof | grep /tmp/axis2        java      21584    camillej   86r      REG   
  3,3   352079      76659 /tmp/axis244513sandesha2-1.2.mar 
java      21584    camillej   87r      REG        3,3    37572      76658 
/tmp/axis244512addressing-1.2.mar 
java      21584    camillej   88r      REG        3,3     8379      76660 
/tmp/axis244514soapmonitor-1.2.mar 
java      21584    camillej   89r      REG        3,3     1444      76661 
/tmp/axis244515version.aar 

So my client finally code : 
               HashMap listeModuleDesc = 
configurationContext.getAxisConfiguration().getModules(); 
               Iterator itListeModuleDesc = 
listeModuleDesc.keySet().iterator(); 

               while(itListeModuleDesc.hasNext()) 
               { 
                   String moduleDescId = (String)itListeModuleDesc.next(); 

                   AxisModule moduleDesc = 
(AxisModule)listeModuleDesc.get(moduleDescId); 
                   if (moduleDesc != null) { 
                       Module module = moduleDesc.getModule(); 
                       if (module != null) { 
                           module.shutdown(configurationContext); 
                       } 
 configurationContext.getAxisConfiguration().disengageModule(moduleDesc); 
                   } 
               } 

               if (stub != null) { 
                   stub.cleanup(); 
                } 

               if (configurationContext != null) { 
                   configurationContext.cleanupContexts(); 
                   configurationContext.terminate(); 
               } 

               stub = null; 
               configurationContext = null; 

Can someone I have an idea about my problem... ? 

Regards 

Jérôme 


--------------------------------------------------------------------- 
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org 
For additional commands, e-mail: axis-user-help@ws.apache.org 




---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org








Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU







---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Re: Reused of configurationContext : Sandesha2 sequence has been terminated

Posted by Jerome Camilleri <je...@bull.net>.
Hi,

I try to have a look into the code and it's seems that the second 
sequence (wich failed) is find into the storageManager (InMemory) by the 
internalSequenceId (which is the same that the first sequence because it 
seems that the wsa:To field is used ?)
So the ApplicationMsgProcess.processOutMessage  [192] test 
rmsBean.isTerminateAdded() is true because the precedent RM sequence  is 
finished (after the lastMessage send, I used the Submitted WSRM 
specification ...).

So how force sandesha to create a new sequence ?

On the documentation the only thing about this subject that a found was 
"Creating a Sequence Without Sending any Messages"...but I want to send 
messages into my sequence.;)

Someone could help me pleased ?

Regards

Jérôme

Jerome Camilleri wrote:
> Hi,
>
> I confirm that without Sandesha there is no problem to reused  the 
> configurationContext and send multiple messages with it.
> So it's a specific problem of RM module with my specific used (but 
> advise by Axis2 team ;) in my context...)
>
> I already had a problem to shutdow the sandesha module at this end of 
> my client (with Axis2 1.2 MEP IN-OUT synchrone a listener is not start 
> and sandesha is never shutdown...) is it related ?
>
> So how configure the contextContext to re-used it with sandesha 
> without re-create it pleased ?
>
>
> Regards.
>
> Jérôme
>
>
> Jerome Camilleri wrote:
>> Hi,
>>
>> Related to an Axis2-1.2 bugs (corrected is seems) my client try to 
>> send with Sandesha2-1.2 multiple sequence of message (with MTOM file 
>> attached).
>> Because of the allocation of ressource and to optimised it I try to 
>> factorize the initialization of the Axis2 context.
>>
>> So my client try this pseudo code :
>>
>> configurationContext ctx = factory.get(client-repo); // create during 
>> the first call
>> stub factory.get( ctx ); // create during the first call
>>
>> stub.engageModule(sandesha2);
>>
>> for (i=0 ; i<=3; i++) {
>>   if (i==3)
>>      stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
>>   stub.sendRequest(putFileRequest);
>> }
>>
>> SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(),
>>                                maxWaitingTimeSequenceCompleted);
>>
>> For the first call my sequence of 3 message is send correctly but my 
>> second call is failed with this sandesha exception :
>>
>> Impossible to call remote service
>> Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception 
>> when processing an out message: 
>> org.apache.sandesha2.SandeshaException: Sandesha2 could not send the 
>> message on sequence http://localhost:9001/axis2/services/Service1 as 
>> the sequence has been terminated..
>>        at 
>> org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:159) 
>>
>>        at org.apache.axis2.engine.Phase.invoke(Phase.java:383)
>>        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203)
>>        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433)
>>        at 
>> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:256) 
>>
>>        at 
>> fr.bull.emetteur.service.Stub.putFileRequestReponse(Stub.java:170)
>>        at fr.bull.emetteur.Emetteur.Emetteur.send(Emetteur.java:116)
>>        ... 5 more
>>
>>
>> Before configurationContext factorization all run well ...
>>
>> Someone could help me pleased ?
>>
>>
>> Regards
>>
>>
>> Jérôme
>>
>> ------------------------------------------------------------------------
>>
>> Subject:
>> Too many open file with Axis2 1.2
>> From:
>> Jerome Camilleri <je...@bull.net>
>> Date:
>> Mon, 18 Jun 2007 16:24:42 +0200
>> To:
>> axis-user@ws.apache.org
>>
>> To:
>> axis-user@ws.apache.org
>>
>>
>> Hi,
>>
>> I used client Axis2 1.2 to send file attached to my WebService.
>> On my client, I used the 
>> ConfigurationContextFactory.createConfigurationContextFromFileSystem 
>> with a repository containing modules like addressing and sandesha2.
>> My deamon scan a directory to send the message and create for eatch a 
>> new configurationContext and a new stub.
>> After eatch sending I call methods to clear the memory (see the end 
>> of this mail) but it seems that some files is lock by my deamon 
>> because after about 300 calls my system is very slow and client stop 
>> with the message "can't open file : Too many open file" in the 
>> console (ulimit -n = 1024)
>>
>> When I launch the lsof command, I noticed that 4 files is adding for 
>> one file sending
>> lsof | grep /tmp/axis2        java      21584    camillej   86r      
>> REG        3,3   352079      76659 /tmp/axis244513sandesha2-1.2.mar
>> java      21584    camillej   87r      REG        3,3    37572      
>> 76658 /tmp/axis244512addressing-1.2.mar
>> java      21584    camillej   88r      REG        3,3     8379      
>> 76660 /tmp/axis244514soapmonitor-1.2.mar
>> java      21584    camillej   89r      REG        3,3     1444      
>> 76661 /tmp/axis244515version.aar
>>
>> So my client finally code :
>>                HashMap listeModuleDesc = 
>> configurationContext.getAxisConfiguration().getModules();
>>                Iterator itListeModuleDesc = 
>> listeModuleDesc.keySet().iterator();
>>
>>                while(itListeModuleDesc.hasNext())
>>                {
>>                    String moduleDescId = 
>> (String)itListeModuleDesc.next();
>>                    AxisModule moduleDesc = 
>> (AxisModule)listeModuleDesc.get(moduleDescId);
>>                    if (moduleDesc != null) {
>>                        Module module = moduleDesc.getModule();
>>                        if (module != null) {
>>                            module.shutdown(configurationContext);
>>                        }
>>                        
>> configurationContext.getAxisConfiguration().disengageModule(moduleDesc);
>>                    }
>>                }
>>
>>                if (stub != null) {
>>                    stub.cleanup();
>>                 }
>>
>>                if (configurationContext != null) {
>>                    configurationContext.cleanupContexts();
>>                    configurationContext.terminate();
>>                }
>>
>>                stub = null;
>>                configurationContext = null;
>>
>> Can someone I have an idea about my problem... ?
>>
>> Regards
>>
>> Jérôme
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>


Re: Reused of configurationContext : Sandesha2 sequence has been terminated

Posted by Jerome Camilleri <je...@bull.net>.
Hi,

I confirm that without Sandesha there is no problem to reused  the 
configurationContext and send multiple messages with it.
So it's a specific problem of RM module with my specific used (but 
advise by Axis2 team ;) in my context...)

I already had a problem to shutdow the sandesha module at this end of my 
client (with Axis2 1.2 MEP IN-OUT synchrone a listener is not start and 
sandesha is never shutdown...) is it related ?

So how configure the contextContext to re-used it with sandesha without 
re-create it pleased ?


Regards.

Jérôme


Jerome Camilleri wrote:
> Hi,
>
> Related to an Axis2-1.2 bugs (corrected is seems) my client try to 
> send with Sandesha2-1.2 multiple sequence of message (with MTOM file 
> attached).
> Because of the allocation of ressource and to optimised it I try to 
> factorize the initialization of the Axis2 context.
>
> So my client try this pseudo code :
>
> configurationContext ctx = factory.get(client-repo); // create during 
> the first call
> stub factory.get( ctx ); // create during the first call
>
> stub.engageModule(sandesha2);
>
> for (i=0 ; i<=3; i++) {
>   if (i==3)
>      stub.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
>   stub.sendRequest(putFileRequest);
> }
>
> SandeshaClient.waitUntilSequenceCompleted(stub._getServiceClient(),
>                                maxWaitingTimeSequenceCompleted);
>
> For the first call my sequence of 3 message is send correctly but my 
> second call is failed with this sandesha exception :
>
> Impossible to call remote service
> Caused by: org.apache.axis2.AxisFault: Sandesha2 got an exception when 
> processing an out message: org.apache.sandesha2.SandeshaException: 
> Sandesha2 could not send the message on sequence 
> http://localhost:9001/axis2/services/Service1 as the sequence has been 
> terminated..
>        at 
> org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:159) 
>
>        at org.apache.axis2.engine.Phase.invoke(Phase.java:383)
>        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203)
>        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433)
>        at 
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:256) 
>
>        at 
> fr.bull.emetteur.service.Stub.putFileRequestReponse(Stub.java:170)
>        at fr.bull.emetteur.Emetteur.Emetteur.send(Emetteur.java:116)
>        ... 5 more
>
>
> Before configurationContext factorization all run well ...
>
> Someone could help me pleased ?
>
>
> Regards
>
>
> Jérôme
>
> ------------------------------------------------------------------------
>
> Subject:
> Too many open file with Axis2 1.2
> From:
> Jerome Camilleri <je...@bull.net>
> Date:
> Mon, 18 Jun 2007 16:24:42 +0200
> To:
> axis-user@ws.apache.org
>
> To:
> axis-user@ws.apache.org
>
>
> Hi,
>
> I used client Axis2 1.2 to send file attached to my WebService.
> On my client, I used the 
> ConfigurationContextFactory.createConfigurationContextFromFileSystem 
> with a repository containing modules like addressing and sandesha2.
> My deamon scan a directory to send the message and create for eatch a 
> new configurationContext and a new stub.
> After eatch sending I call methods to clear the memory (see the end of 
> this mail) but it seems that some files is lock by my deamon because 
> after about 300 calls my system is very slow and client stop with the 
> message "can't open file : Too many open file" in the console (ulimit 
> -n = 1024)
>
> When I launch the lsof command, I noticed that 4 files is adding for 
> one file sending
> lsof | grep /tmp/axis2        java      21584    camillej   86r      
> REG        3,3   352079      76659 /tmp/axis244513sandesha2-1.2.mar
> java      21584    camillej   87r      REG        3,3    37572      
> 76658 /tmp/axis244512addressing-1.2.mar
> java      21584    camillej   88r      REG        3,3     8379      
> 76660 /tmp/axis244514soapmonitor-1.2.mar
> java      21584    camillej   89r      REG        3,3     1444      
> 76661 /tmp/axis244515version.aar
>
> So my client finally code :
>                HashMap listeModuleDesc = 
> configurationContext.getAxisConfiguration().getModules();
>                Iterator itListeModuleDesc = 
> listeModuleDesc.keySet().iterator();
>
>                while(itListeModuleDesc.hasNext())
>                {
>                    String moduleDescId = 
> (String)itListeModuleDesc.next();
>                    AxisModule moduleDesc = 
> (AxisModule)listeModuleDesc.get(moduleDescId);
>                    if (moduleDesc != null) {
>                        Module module = moduleDesc.getModule();
>                        if (module != null) {
>                            module.shutdown(configurationContext);
>                        }
>                        
> configurationContext.getAxisConfiguration().disengageModule(moduleDesc);
>                    }
>                }
>
>                if (stub != null) {
>                    stub.cleanup();
>                 }
>
>                if (configurationContext != null) {
>                    configurationContext.cleanupContexts();
>                    configurationContext.terminate();
>                }
>
>                stub = null;
>                configurationContext = null;
>
> Can someone I have an idea about my problem... ?
>
> Regards
>
> Jérôme
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org