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 Rob Henley <ro...@freeuk.com> on 2006/05/03 13:09:15 UTC

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" <ro...@freeuk.com>
To: <ax...@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" <ru...@gmail.com>
> To: <ax...@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 <ro...@freeuk.com> 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" <ru...@gmail.com>
>> To: <ax...@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 <ro...@freeuk.com> 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>
>> >         <items>Timestamp</items>
>> >       </action>
>> >     </parameter>
>> >     <parameter name="OutflowSecurity">
>> >       <action>
>> >         <items>Timestamp</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 ...
>> >
>> > org.apache.axis2.AxisFault: WSDoAllReceiver: Request does not contain
>> > required Security header
>> >         at
>> > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:286)
>> >         at org.apache.axis2.PurchasingStub.purchaseOrder(Unknown 
>> > Source)
>> >         at samples.purchasing1.ClientTest.main(Unknown Source)
>> > Caused by: java.lang.Exception: org.apache.axis2.AxisFault:
>> > WSDoAllReceiver:
>> > Request does not contain required Security header
>> >         at
>> > org.apache.axis2.security.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:186)
>> >         at
>> > org.apache.axis2.security.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:82)
>> >         at org.apache.axis2.engine.Phase.invoke(Phase.java:378)
>> >         at 
>> > org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:471)
>> >         at 
>> > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:441)
>> >         at
>> > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:283)
>> >         at
>> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:130)
>> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> >         at
>> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> >         at
>> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> >         at
>> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> >         at
>> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> >         at
>> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> >         at
>> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> >         at
>> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> >         at
>> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> >         at
>> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>> >         at
>> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
>> >         at
>> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> >         at
>> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> >         at
>> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> >         at java.lang.Thread.run(Unknown Source)
>> >         at org.apache.axis2.AxisFault.<init>(AxisFault.java:159)
>> >
>> > ----- Original Message -----
>> > From: "Deepal Jayasinghe" <de...@opensource.lk>
>> > To: <ax...@ws.apache.org>
>> > Sent: Friday, April 28, 2006 5:17 PM
>> > Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not
>> > available : addressing
>> >
>> >
>> > > Try following
>> > > 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");
>> > >
>> > > Rob Henley wrote:
>> > >
>> > >> I am having problems getting a client to work with security (RC2
>> > >> build). My most promising attempt so far is with the following 
>> > >> client
>> > >> code:
>> > >>
>> > >> ConfigurationContext ctx =
>> > >> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
>> > >>
>> > >> "C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF\\conf\\axis2.xml");
>> > >> PurchasingStub stub = new PurchasingStub(ctx,
>> > >> "http://localhost:8081/axis2/services/Purchasing");
>> > >>
>> > >> Other combinations of parameters to
>> > >> createConfigurationContextFromFileSystem() have all resulted in
>> > >> either 'Request does not contain required Security header' from the
>> > >> server (implying to me that the client didn't use the specified
>> > >> axis2.xml) or a NullPointerException.
>> > >>
>> > >> With the above code I get:
>> > >>
>> > >> org.apache.axis2.deployment.DeploymentException: Trying to engage a
>> > >> module which is not available :addressing;
>> > >> nested exception is:
>> > >>   org.apache.axis2.AxisFault: Trying to engage a module which is not
>> > >> available : addressing
>> > >>   at
>> > >> org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:132)
>> > >>
>> > >> addressing.mar etc are available in the modules directory and axis2 
>> > >> is
>> > >> picking these up ok when I start tomcat. The problem is that the
>> > >> client is not finding the module. This probably means that the 
>> > >> client
>> > >> has (at last :-) found my axis2.xml, so is a step forward. I've 
>> > >> tried
>> > >> adding all the 'mar' files explicitly to the client classpath but 
>> > >> this
>> > >> doesn't seem to help.
>> > >>
>> > >> Possibly I need an environment variable? Any idea gratefully 
>> > >> received!
>> > >> Rob
>> > >>
>> > >
>> > >
>> > > --
>> > > Thanks,
>> > > Deepal
>> > > ................................................................
>> > > ~Future is Open~
>> > >
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>> >
>>
>>
>>
>>
>>
>
>
>
>
>
>
> 



Re: Fw: [Axis2] WSS4J - Trying to engage a module which is not available : addressing

Posted by Rob Henley <ro...@freeuk.com>.
Unfortuantely the NullPointerexception is thrown before I can get a 
ServiceClientInstance. In my case the exception is thrown at this line in 
the generated stub constructor ...

 _serviceClient = new 
org.apache.axis2.client.ServiceClient(configurationContext,_service);

Cheers
Rob
----- Original Message ----- 
From: "Ruchith Fernando" <ru...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Wednesday, May 03, 2006 12:30 PM
Subject: 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 <ro...@freeuk.com> 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" <ro...@freeuk.com>
> To: <ax...@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" <ru...@gmail.com>
> > To: <ax...@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 <ro...@freeuk.com> 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" <ru...@gmail.com>
> >> To: <ax...@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 <ro...@freeuk.com> 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>
> >> >         <items>Timestamp</items>
> >> >       </action>
> >> >     </parameter>
> >> >     <parameter name="OutflowSecurity">
> >> >       <action>
> >> >         <items>Timestamp</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 ...
> >> >
> >> > org.apache.axis2.AxisFault: WSDoAllReceiver: Request does not contain
> >> > required Security header
> >> >         at
> >> > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:286)
> >> >         at org.apache.axis2.PurchasingStub.purchaseOrder(Unknown
> >> > Source)
> >> >         at samples.purchasing1.ClientTest.main(Unknown Source)
> >> > Caused by: java.lang.Exception: org.apache.axis2.AxisFault:
> >> > WSDoAllReceiver:
> >> > Request does not contain required Security header
> >> >         at
> >> > org.apache.axis2.security.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:186)
> >> >         at
> >> > org.apache.axis2.security.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:82)
> >> >         at org.apache.axis2.engine.Phase.invoke(Phase.java:378)
> >> >         at
> >> > org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:471)
> >> >         at
> >> > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:441)
> >> >         at
> >> > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:283)
> >> >         at
> >> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:130)
> >> >         at 
> >> > javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >> >         at 
> >> > javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >> >         at
> >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> >> >         at
> >> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> >> >         at
> >> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> >> >         at
> >> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> >> >         at
> >> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> >> >         at
> >> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> >> >         at
> >> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> >> >         at
> >> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> >> >         at
> >> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
> >> >         at
> >> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
> >> >         at
> >> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> >> >         at
> >> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> >> >         at
> >> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> >> >         at java.lang.Thread.run(Unknown Source)
> >> >         at org.apache.axis2.AxisFault.<init>(AxisFault.java:159)
> >> >
> >> > ----- Original Message -----
> >> > From: "Deepal Jayasinghe" <de...@opensource.lk>
> >> > To: <ax...@ws.apache.org>
> >> > Sent: Friday, April 28, 2006 5:17 PM
> >> > Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not
> >> > available : addressing
> >> >
> >> >
> >> > > Try following
> >> > > 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");
> >> > >
> >> > > Rob Henley wrote:
> >> > >
> >> > >> I am having problems getting a client to work with security (RC2
> >> > >> build). My most promising attempt so far is with the following
> >> > >> client
> >> > >> code:
> >> > >>
> >> > >> ConfigurationContext ctx =
> >> > >> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> >> > >>
> >> > >> "C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF\\conf\\axis2.xml");
> >> > >> PurchasingStub stub = new PurchasingStub(ctx,
> >> > >> "http://localhost:8081/axis2/services/Purchasing");
> >> > >>
> >> > >> Other combinations of parameters to
> >> > >> createConfigurationContextFromFileSystem() have all resulted in
> >> > >> either 'Request does not contain required Security header' from 
> >> > >> the
> >> > >> server (implying to me that the client didn't use the specified
> >> > >> axis2.xml) or a NullPointerException.
> >> > >>
> >> > >> With the above code I get:
> >> > >>
> >> > >> org.apache.axis2.deployment.DeploymentException: Trying to engage 
> >> > >> a
> >> > >> module which is not available :addressing;
> >> > >> nested exception is:
> >> > >>   org.apache.axis2.AxisFault: Trying to engage a module which is 
> >> > >> not
> >> > >> available : addressing
> >> > >>   at
> >> > >> org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:132)
> >> > >>
> >> > >> addressing.mar etc are available in the modules directory and 
> >> > >> axis2
> >> > >> is
> >> > >> picking these up ok when I start tomcat. The problem is that the
> >> > >> client is not finding the module. This probably means that the
> >> > >> client
> >> > >> has (at last :-) found my axis2.xml, so is a step forward. I've
> >> > >> tried
> >> > >> adding all the 'mar' files explicitly to the client classpath but
> >> > >> this
> >> > >> doesn't seem to help.
> >> > >>
> >> > >> Possibly I need an environment variable? Any idea gratefully
> >> > >> received!
> >> > >> Rob
> >> > >>
> >> > >
> >> > >
> >> > > --
> >> > > Thanks,
> >> > > Deepal
> >> > > ................................................................
> >> > > ~Future is Open~
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
> >
>
>
>





Re: Fw: [Axis2] WSS4J - Trying to engage a module which is not available : addressing

Posted by Ruchith Fernando <ru...@gmail.com>.
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 <ro...@freeuk.com> 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" <ro...@freeuk.com>
> To: <ax...@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" <ru...@gmail.com>
> > To: <ax...@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 <ro...@freeuk.com> 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" <ru...@gmail.com>
> >> To: <ax...@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 <ro...@freeuk.com> 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>
> >> >         <items>Timestamp</items>
> >> >       </action>
> >> >     </parameter>
> >> >     <parameter name="OutflowSecurity">
> >> >       <action>
> >> >         <items>Timestamp</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 ...
> >> >
> >> > org.apache.axis2.AxisFault: WSDoAllReceiver: Request does not contain
> >> > required Security header
> >> >         at
> >> > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:286)
> >> >         at org.apache.axis2.PurchasingStub.purchaseOrder(Unknown
> >> > Source)
> >> >         at samples.purchasing1.ClientTest.main(Unknown Source)
> >> > Caused by: java.lang.Exception: org.apache.axis2.AxisFault:
> >> > WSDoAllReceiver:
> >> > Request does not contain required Security header
> >> >         at
> >> > org.apache.axis2.security.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:186)
> >> >         at
> >> > org.apache.axis2.security.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:82)
> >> >         at org.apache.axis2.engine.Phase.invoke(Phase.java:378)
> >> >         at
> >> > org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:471)
> >> >         at
> >> > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:441)
> >> >         at
> >> > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:283)
> >> >         at
> >> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:130)
> >> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >> >         at
> >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> >> >         at
> >> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> >> >         at
> >> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> >> >         at
> >> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> >> >         at
> >> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> >> >         at
> >> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> >> >         at
> >> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> >> >         at
> >> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> >> >         at
> >> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
> >> >         at
> >> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
> >> >         at
> >> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> >> >         at
> >> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> >> >         at
> >> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> >> >         at java.lang.Thread.run(Unknown Source)
> >> >         at org.apache.axis2.AxisFault.<init>(AxisFault.java:159)
> >> >
> >> > ----- Original Message -----
> >> > From: "Deepal Jayasinghe" <de...@opensource.lk>
> >> > To: <ax...@ws.apache.org>
> >> > Sent: Friday, April 28, 2006 5:17 PM
> >> > Subject: Re: [Axis2] WSS4J - Trying to engage a module which is not
> >> > available : addressing
> >> >
> >> >
> >> > > Try following
> >> > > 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");
> >> > >
> >> > > Rob Henley wrote:
> >> > >
> >> > >> I am having problems getting a client to work with security (RC2
> >> > >> build). My most promising attempt so far is with the following
> >> > >> client
> >> > >> code:
> >> > >>
> >> > >> ConfigurationContext ctx =
> >> > >> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> >> > >>
> >> > >> "C:\\Progra~1\\Apache\\Tomcat5.5\\webapps\\axis2\\WEB-INF\\conf\\axis2.xml");
> >> > >> PurchasingStub stub = new PurchasingStub(ctx,
> >> > >> "http://localhost:8081/axis2/services/Purchasing");
> >> > >>
> >> > >> Other combinations of parameters to
> >> > >> createConfigurationContextFromFileSystem() have all resulted in
> >> > >> either 'Request does not contain required Security header' from the
> >> > >> server (implying to me that the client didn't use the specified
> >> > >> axis2.xml) or a NullPointerException.
> >> > >>
> >> > >> With the above code I get:
> >> > >>
> >> > >> org.apache.axis2.deployment.DeploymentException: Trying to engage a
> >> > >> module which is not available :addressing;
> >> > >> nested exception is:
> >> > >>   org.apache.axis2.AxisFault: Trying to engage a module which is not
> >> > >> available : addressing
> >> > >>   at
> >> > >> org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:132)
> >> > >>
> >> > >> addressing.mar etc are available in the modules directory and axis2
> >> > >> is
> >> > >> picking these up ok when I start tomcat. The problem is that the
> >> > >> client is not finding the module. This probably means that the
> >> > >> client
> >> > >> has (at last :-) found my axis2.xml, so is a step forward. I've
> >> > >> tried
> >> > >> adding all the 'mar' files explicitly to the client classpath but
> >> > >> this
> >> > >> doesn't seem to help.
> >> > >>
> >> > >> Possibly I need an environment variable? Any idea gratefully
> >> > >> received!
> >> > >> Rob
> >> > >>
> >> > >
> >> > >
> >> > > --
> >> > > Thanks,
> >> > > Deepal
> >> > > ................................................................
> >> > > ~Future is Open~
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
> >
>
>
>