*
The moose likes Web Services and the fly likes Axis2 - Unable to engage rampart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 - Unable to engage rampart" Watch "Axis2 - Unable to engage rampart" New topic
Author

Axis2 - Unable to engage rampart

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
In the client axis2.xml, I have added the following line

<module ref="rampart" />

I have also copied, "rahas-1.5.mar" and "rampart-1.5.mar" to the modules directory.

Now when I try to run the client, it gives me the following error message
Exception in thread "main" org.apache.axis2.AxisFault: Unable to engage module : rampart
at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:357)
at com.examples.www.wsdl.resumeservice_wsdl.ResumeClient.main(ResumeClient.java:44)

Please help me resolve this.
thank you
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Have you specified your repository path while creating configuration context if not pass it as param -Daxis2.repo="your axis module dir". I have responded to your post related to axis handlers you can have a look.


SCJP 1.5(97%) My Blog
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
shivendra tripathi wrote:Have you specified your repository path while creating configuration context if not pass it as param -Daxis2.repo="your axis module dir". I have responded to your post related to axis handlers you can have a look.


Can you please let me know where I need to specify this?

Thank you
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Create configuration context as follows


Then pass this config context while creating the ServiceClient. If you don't want to do that then create as "new ServiceClient()" and pass repo path as jvm argument while running the client. If you are using eclipse you have got run configurations where you can mention jvm arguments.
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
shivendra tripathi wrote:
Then pass this config context while creating the ServiceClient. If you don't want to do that then create as "new ServiceClient()" and pass repo path as jvm argument while running the client. If you are using eclipse you have got run configurations where you can mention jvm arguments.



Thank you

I am using Eclipse. In the "Run Configuration" of the client, I did the following
1. Go to "Arguments" tab
2. In "VM Arguments" text area, type the following
-Daxis2.repo="C:\ServiceTest\WebContent\WEB-INF\modules"

But I am still getting the same error.

Thank you
Jagdish Hatagale
Ranch Hand

Joined: Apr 07, 2010
Posts: 33
kindly check out you are classpath you need to put all the requrire file in classpath you did not place the files on correct location that is the reson such error is showing.
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Sorry I forgot to mention one more thing.

mention your axis2 config file with rampart enable as following in jvm parameter.

-Daxis2.xml="location of axis2 xml with rampart engaged".

I hope axis/lib is already in your class path.
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
shivendra tripathi wrote:Sorry I forgot to mention one more thing.

mention your axis2 config file with rampart enable as following in jvm parameter.

-Daxis2.xml="location of axis2 xml with rampart engaged".

I hope axis/lib is already in your class path.


Thank you.

Axis lib is already in the classpath.

I have added the following to VM parameters

-Daxis2.repo="C:\ServiceTestClient1\WebContent\WEB-INF\modules"
-Daxis2.xml="C:\ServiceTestClient1\WebContent\WEB-INF\conf\axis2.xml"

I have verfied that the above path is valid.
But I am still getting the following error



If I comment the line engaging addressing module, then it says that Rampart module is not available. It is not able to find any of the modules.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41101
    
  45
Does the "modules" directory contain the addressing, rahas and rampart .mar files?


Ping & DNS - my free Android networking tools app
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
Ulf Dittmer wrote:Does the "modules" directory contain the addressing, rahas and rampart .mar files?


Yes, it contains the following
addressing-1.5
rahas-1.5
rampart-1.5

mex-1.5
mtompolicy-1.5
ping-1.5
scripting-1.5
soapmonitor-1.5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41101
    
  45
That looks like the contents of the server-side modules directory; what about the client-side modules directory?
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
Ulf Dittmer wrote:That looks like the contents of the server-side modules directory; what about the client-side modules directory?


These are the contents of client side module directory.
I generated client using Eclipse plugin. It created all these modules (except rampart and rahas). Rampart and rahas I copied later on.
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
After adding the VM parameters the error has changed slightly

Earlier it was

Exception in thread "main" org.apache.axis2.AxisFault: Unable to engage module : rampart

After putting the VM paramters, it changes to

Exception in thread "main" org.apache.axis2.AxisFault: The system is attempting to engage a module that is not available: addressing

When there are no VM parameters, it does not give any error for addressing module (which comes before rampart module in axis2.xml). When VM parameters are put, it is not even able to find addressing module.
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Can you post your axis2.xml
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
shivendra tripathi wrote:Can you post your axis2.xml


This is axis2.xml at the client side

shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
I probably got the problem. I tried following and it worked.


so in case of repo you have to give the dir which contains modules dir.
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
One more thing you can remove if you are engaging module in your program i.e. by calling engage module. This is needed for global setting. I am planning a blog on this discussing different ways to engage a module in axis2.
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
shivendra tripathi wrote:I probably got the problem. I tried following and it worked.


so in case of repo you have to give the dir which contains modules dir.


Thanks a lot.
You are absolutely correct.
I changed the VM parameter to -Daxis2.repo="C:\ServiceTestClient1\WebContent\WEB-INF", now I am able to get past that error. This means it is able to engage the module.

thank you
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Welcome :-)
 
jQuery in Action, 2nd edition
 
subject: Axis2 - Unable to engage rampart
 
Similar Threads
webservice using Eclipse Europa, for JBoss 4.0.5 GA using Java5, JAX-WS, WS-Security
Axis2, client handler not getting called
Rampart at the client side
rampart security issue
can't run rampart client