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 Stadelmann Josef <jo...@winterthur.ch> on 2007/03/14 15:11:28 UTC
AW: [axis2] session management fails with invalidServiceGroupID Exception
Jochen,
my comment in +++> ... <+++ below
-----Ursprüngliche Nachricht-----
Von: Jochen Zink [mailto:jochenlist@web.de]
Gesendet: Mittwoch, 14. März 2007 12:28
An: axis-user@ws.apache.org
Betreff: Re: [axis2] session management fails with invalidServiceGroupID
Exception
I use soapsession scope.
I'm sure that every client invokes a creation of a new ServicesClass. I control it with hashcodes of the instances. Every client talks to another instance. A single client talks, every method call to is own Service Instance.
The Timeout on the service is set to 30000.
After the first method call, the Client waits 40seconds before he calls the next method.
+++> Jochen, can you check that the message sent with the 2nd call of client#1 which has timed-out still sends the ServiceGroupId?
also we migth talk about similar not exactly equal problems.
does your clinet#1 second message look similar like (carry a ServiceGroupID)?
- <soapenv:Header>
<wsa:To>http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
- <wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
- <wsa:ReferenceParameters>
<axis2:ServiceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:AEDE11BE4497D9478F117316759348254</axis2:ServiceGroupId>
</wsa:ReferenceParameters>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:AEDE11BE4497D9478F117316759399760</wsa:MessageID>
<wsa:Action>urn:echo</wsa:Action>
<wsa:RelatesTo wsa:RelationshipType="http://www.w3.org/2005/08/addressing/reply">urn:uuid:C1D5F6754451BC782111731675939823</wsa:RelatesTo>
</soapenv:Header>
if a ServiceGroupID is sent to a timed-out service-object in a ServiceGroup your initial fault should show up.
if no ServiceGroupId is sent, that would explain why no fault "invalid Service Group ID", is raised.
in this case, I would expect that a new ServicegroupID is created and that the old ServiceGroupID is removed and hence destroy() is called on the first service-object. is this the case?
And the question to the developers would remain: is this intended behaviour?
Josef <+++
The servers log messages are:
init de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@18e4593
openTransferSession de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@18e4593
// Here is the client waiting
closetransferSession de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@18e4593
last touching Time 40031
As you can see, it is always the same Instance.
The strange thing is, if I invoke another client, the service Instance of the first client should be destroyed after the 30 seconds.
Example:
Client1.firstMethod:
Client1.wait:
Client2.firstMethod:
Know, the destroy Method is invoked
Client 2.wait:
Client1.secondMethod:
java.lang.NullPointerException
at org.apache.axis2.context.MessageContext.isHeaderPresent(MessageContext.java:1054)
at org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:72)
at org.apache.axis2.engine.Phase.invoke(Phase.java:382)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:522)
at org.apache.axis2.engine.AxisEngine.receiveFault(AxisEngine.java:600)
at org.apache.axis2.description.RobustOutOnlyAxisOperation$RobustOperationClient.send(RobustOutOnlyAxisOperation.java:99)
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)
at de.nepatec.edocbox.comserver.client.DocumentTransferServiceStub.closeTransferSession(DocumentTransferServiceStub.java:561)
at de.nepatec.edocbox.comserver.client.Client.run(Client.java:99)
Client2.secondMethod: Works fine, but the TimeOut is expired.
A session runs only in timeout, if a other client invokes his own Instance. Do you understnad what I mean?!
The log messages on the server wich printent with invoking the above example
init de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@17dc754
openTransferSession de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@17dc754
destroy de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@17dc754
init de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@a95fa3
openTransferSession de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@a95fa3
transferDocument de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@a95fa3
closetransferSession de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton@a95fa3
last touching Time 50016
+++> Yes, I have seen the same sequence, destroy() before init() but on two different service-objects,
in case you reset the axis2 value to 30 then you have nearly constant a time-out condition, as explained by rob, which made my client#n fail as soon as client#n+1 was starting. Since axis2.xml raised this value to 30000 this my problem is gone, and perhaps similra problems too.
Josef <+++
The Client Code is like this:
ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("repos", "repos/conf/axis2.xml");
DocumentTransferServiceStub serviceStub = new DocumentTransferServiceStub(
ctx,
"http://localhost:8080/comchannel/services/DocumentTransferService");
serviceStub._getServiceClient().getOptions().setManageSession(true);
serviceStub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
serviceStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(100000);
DocumentTransferServiceStub.OpenTransferSession open = new DocumentTransferServiceStub.OpenTransferSession();
// ... some stuff
// call first method
serviceStub.openTransferSession(open);
// wait 40 seconds
Thread.sleep(40000);
// call next Method
serviceStub.closeTransferSession();
Thanks!
> -----Ursprüngliche Nachricht-----
> Von: axis-user@ws.apache.org
> Gesendet: 14.03.07 11:32:46
> An: <ax...@ws.apache.org>
> Betreff: AW: [axis2] session management fails with invalidServiceGroupID Exception
> Jochen
>
> **** BTW - what scope= are you using? The original problem I had was with scope=soapsession only.
>
> with scope=application your talking to only one instance of your service-class and not to a statefull-objects.
>
>
>
> The problem with the invalidServiceGroupeContextID is because after timeout the ID is no longer valid!
>
> client-threads calling afterr timeoutn with the same previous used sender-handle will because they send the wrong timed out ID
> client-threads calling with a fresh sender-handle will not fail because the do not pass an ID but receive one in the reply-message
>
>
>
> Regarding Instances of Service Classes (also called statefull-Objects, objects are instances of a class) be sure that you can cleanly
> tell a) when you talk to different instances of a service-object (instance of a service-class) or b) when you talk to the same instance of a service-object (singelton).
>
> Sometimes just a matter of having certain variables defined as static, and since variables in jave defined static are shared among objects!
>
> I was once running into the same trap. Be aware that you know the real instance your talking to, maybe identify each object by unique hash value or UUID.
>
> Josef
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Jochen Zink [mailto:jochenlist@web.de]
> Gesendet: Mittwoch, 14. März 2007 10:40
> An: axis-user@ws.apache.org
> Betreff: Re: [axis2] session management fails with invalidServiceGroupID
> Exception
>
>
> A big Thank you!!!! I don't believe it... in axis2.xml the ConfigContextTimeout are milliseconds and not seconds like the comment tells.
>
> But... there is another thing, which I don't understand.
>
> Know, the ConfigContextTimeout Parameter has the value 30000 (30seconds).
>
> My client invokes the login method, sleeps 60000 milliseconds (1min) and after this wait period, it invokes a second method. It works... but why?! Normally I think, the session run into a timeout. The client has not touch the service over a minute and can successfully call a method. ...
>
> Thanks!
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: axis-user@ws.apache.org
> > Gesendet: 14.03.07 10:19:22
> > An: <ax...@ws.apache.org>
> > Betreff: AW: [axis2] session management fails with invalidServiceGroupID Exception
>
>
> > Hi Jochen,
> >
> > Maybe you have the same problem then I had.
> > For that I have had logged a JIRA and meanwhile it' sfixed. Look at
> >
> >
> > [ https://issues.apache.org/jira/browse/AXIS2-1991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> >
> >
> > and more in the e-mail thread at
> >
> > http://marc.theaimsgroup.com/?l=axis-user&m=117316427720305&w=2
> >
> >
> > I hope for you that it is that easy to fix your problem.
> >
> > Regards
> > Josef
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Jochen Zink [mailto:jochenlist@web.de]
> > Gesendet: Mittwoch, 14. März 2007 10:01
> > An: axis-user@ws.apache.org
> > Betreff: [axis2] session management fails with invalidServiceGroupID
> > Exception
> >
> >
> > Hello at all,
> >
> > I have a session based Webservice with three Methods. A client has 2 threads with 2 different clients, which use the webservice. Only the second client can invoke more than the first method of the service.
> >
> > Example:
> > Client 1 invoke Method login -> everything okay.
> > Client 2 invole Method login -> invoking works fine BUT on the service class, that is created by the call of client 1, the destroy method is called
> >
> > Client 1 invokes method transfer -> The following exception is thrown on client side:
> > org.apache.axis2.AxisFault: Invalid Service Group Id urn:uuid:4489A6CEFA71AF964F1173862161488
> > at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271)
> > at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)
> > at de.nepatec.edocbox.comserver.client.DocumentTransferServiceStub.transferDocument(DocumentTransferServiceStub.java:212)
> > at de.nepatec.edocbox.comserver.client.Client.run(Client.java:84)
> >
> > Client 2 invokes Method transfer -> everything okay
> >
> >
> > It seems that only the last instance of the service class is alive.
> >
> > The service is correct state full. With only one client, all member attributes are available over all method calls.
> >
> > Here is the services.xml:
> > <service name="DocumentTransferService" scope="soapsession">
> >
> > <parameter name="enableMTOM" locked="false">true</parameter>
> >
> >
> > <!-- Message Receivers -->
> >
> > <parameter locked="false" name="ServiceClass">
> > de.nepatec.edocbox.comserver.comchannel.serviceimpl.DocumentTransferServiceSkeleton
> > </parameter>
> >
> > <!-- Operations -->
> >
> >
> > </service>
> > </serviceGroup>
> >
> > In the servers axis2.xml addressing module is engaged.
> >
> > On client side the Sessionmanagement is enabled:
> > serviceStub._getServiceClient().getOptions().setManageSession(true);
> >
> >
> >
> > I found the same problem in the mailinglist ( http://marc.theaimsgroup.com/?t=116282349800006&r=1&w=2) but without a solution.
> >
> > Is this a axis2 Bug or did I something wrong? What can I do, to have a session based webservice that can handle mutltiple clients?
> >
> > Thanks for all!
> >
> >
> >
> > _______________________________________________________________________
> > Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
> > Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222
> >
> >
> > ---------------------------------------------------------------------
> > 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: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> _________________________________________________________________________
> In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten!
> Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114
>
>
> ---------------------------------------------------------------------
> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222
---------------------------------------------------------------------
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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org