Fw: [Axis2] WSS4J - Trying to engage a module which is not available : addressing
Hi guys I've been trying for a while now to get the security module to work (either using my own code or the security sample). I was encouraged when I was told that 0.95 had a known problem which was addressed in RC2, but I get the same problem(s) in RC2 (described below). I'm currently using: axis2.war, std-bin from and http://people.apache.org/~deepal/axis2/1.0-RC2/ security, addressing modules from http://people.apache.org/~deepal/maven/ws/axis2/mars/ I have a (working) client and server, generated from WSDL. These work fine without security. I'm pretty sure the client sees the correct axis2.xml (where the security module is engaged and the required security settings are specified). I can do this either by specifying -Daxis2.xml=... on the java command line or by supplying the axis2.xml path as the 2nd parameter to createConfigurationContextFromFileSystem in the client source. I think my problem is that the client is not finding a 'repository'. If I don't specify a repository I get the Trying to engage a module ... errors, which seems reasonable since I haven't told the client where to look. If I specify the repository as the 1st parameter to createConfigurationContextFromFileSystem then I get a NullPointerException from ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59) On the face of it this looks like a bug in Axis2. Can anyone tell me: - have I missed something (e.g. did I get the security module from the wrong place? Am I missing some environment settings?) - how I might get any more information about the cause of the problem - whether I should try RC4 - if anyone could send me any simple client code which works for them? Many thanks Rob - Original Message - From: Rob Henley [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, April 30, 2006 9:33 PM Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not available : addressing Hi Ruchith thanks - but with -Daxis2.xml=...\conf\axis2.xml I get the same error as before ... org.apache.axis2.deployment.DeploymentException: Trying to engage a module which is not available : addressing; nested exception is: ... So the question is why can't the client find the modules when the server can? I guess the problem is that the client doesn't know where the 'repository' is, where it would expect to find modules\*.mar. But if I try to specify the repository as the first parameter to createConfigurationContextFromFileSystem .. ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem( C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF, C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF\\conf\\axis2.xml); then I get java.lang.NullPointerException at org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59) at org.apache.axis2.client.ServiceClient.init(ServiceClient.java:98) at org.apache.axis2.PurchasingStub.init(Unknown Source) at samples.purchasing1.ClientTest.main(Unknown Source) I also tried adding the 'mar' files directly to the classpath (clutching at straws :-), but that doesn't help. Cheers Rob - Original Message - From: Ruchith Fernando [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, April 30, 2006 7:54 AM Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not available : addressing Hi Rob, Can you please try specifying the path to the axis2.xml as shown below: java . -Daxis2.xml=path/to/axis2.xml Thanks, Ruchith On 4/30/06, Rob Henley [EMAIL PROTECTED] wrote: Hi Ruchith yes, I specify the module in axis2.xml. See below for relevant section of the axis2.xml. Cheers Rob - Original Message - From: Ruchith Fernando [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Saturday, April 29, 2006 7:15 AM Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not available : addressing Hi Rob, Does your axis2.xml has the entry : module ref=security / . (If you are using RC4 this is module ref=aegis /) OR Do you call engageModule() on the ServiceClient instance? You MUST do either ONE of these to engage the module. Thanks, Ruchith On 4/29/06, Rob Henley [EMAIL PROTECTED] wrote: Hi Deepal I tried your version, but I get an error from the server Request does not contain required Security header. This suggests to me that the client isn't using my axis2.xml, which includes: module ref=security/ parameter name=InflowSecurity action itemsTimestamp/items /action /parameter parameter name=OutflowSecurity action itemsTimestamp/items /action /parameter By replacing the repo directory with null in the call, the client at least appeared to be attempting to use the security module. Can you think of anything else I could try? Many thanks Rob Here is the full exception I get with the parameters you suggest
Re: Fw: [Axis2] WSS4J - Trying to engage a module which is not available : addressing
Hi Rob, If your client's axis2.xml (with the module ref=security / entry) is picked up properly _and_ if axis2 cannot pickup the proper repository where the security module is available it will throw an exception saying that the security module is missing. If you don't get this error either : - your client side security module is properly engaged OR - the axis2.xml you specified is not pickedup by axis2 When you specify both _configured_ axis2.xml and the repository in ConfigurationContextFactory.createConfigurationContextFromFileSystem() then you can check whether the security module is really engaged, by trying to engage it again in the client code: ServiceClientInstance.engageModule(new QName(security)); This _will_ throw an exception and complain that the security module is already engaged if it is engaged in the axis2.xml and if it is available in the repo. If all these tests passes ... then your security module is properly engaged AND to get the security module to work on the request/response message to apply/verify security actions, you _must_ provide the security module configuration in the client side axis2.xml [1]. Thanks, Ruchith [1] http://ws.apache.org/axis2/0_95/security-module.html On 5/3/06, Rob Henley [EMAIL PROTECTED] wrote: Hi guys I've been trying for a while now to get the security module to work (either using my own code or the security sample). I was encouraged when I was told that 0.95 had a known problem which was addressed in RC2, but I get the same problem(s) in RC2 (described below). I'm currently using: axis2.war, std-bin from and http://people.apache.org/~deepal/axis2/1.0-RC2/ security, addressing modules from http://people.apache.org/~deepal/maven/ws/axis2/mars/ I have a (working) client and server, generated from WSDL. These work fine without security. I'm pretty sure the client sees the correct axis2.xml (where the security module is engaged and the required security settings are specified). I can do this either by specifying -Daxis2.xml=... on the java command line or by supplying the axis2.xml path as the 2nd parameter to createConfigurationContextFromFileSystem in the client source. I think my problem is that the client is not finding a 'repository'. If I don't specify a repository I get the Trying to engage a module ... errors, which seems reasonable since I haven't told the client where to look. If I specify the repository as the 1st parameter to createConfigurationContextFromFileSystem then I get a NullPointerException from ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59) On the face of it this looks like a bug in Axis2. Can anyone tell me: - have I missed something (e.g. did I get the security module from the wrong place? Am I missing some environment settings?) - how I might get any more information about the cause of the problem - whether I should try RC4 - if anyone could send me any simple client code which works for them? Many thanks Rob - Original Message - From: Rob Henley [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, April 30, 2006 9:33 PM Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not available : addressing Hi Ruchith thanks - but with -Daxis2.xml=...\conf\axis2.xml I get the same error as before ... org.apache.axis2.deployment.DeploymentException: Trying to engage a module which is not available : addressing; nested exception is: ... So the question is why can't the client find the modules when the server can? I guess the problem is that the client doesn't know where the 'repository' is, where it would expect to find modules\*.mar. But if I try to specify the repository as the first parameter to createConfigurationContextFromFileSystem .. ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem( C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF, C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF\\conf\\axis2.xml); then I get java.lang.NullPointerException at org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59) at org.apache.axis2.client.ServiceClient.init(ServiceClient.java:98) at org.apache.axis2.PurchasingStub.init(Unknown Source) at samples.purchasing1.ClientTest.main(Unknown Source) I also tried adding the 'mar' files directly to the classpath (clutching at straws :-), but that doesn't help. Cheers Rob - Original Message - From: Ruchith Fernando [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, April 30, 2006 7:54 AM Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not available : addressing Hi Rob, Can you please try specifying the path to the axis2.xml as shown below: java . -Daxis2.xml=path/to/axis2.xml Thanks, Ruchith On 4/30/06, Rob Henley [EMAIL PROTECTED] wrote: Hi Ruchith yes, I specify the module in axis2.xml. See below for relevant section of the