Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Axis2 Rampart Error WSPasswordCallback cannot be resolved to a type

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I had been struggling with this for about a week with the same issue so I thought I would contribute back to help anyone with the same issue now I have solved it.

Essentially I implemented the Basic Rampart Sample02 which is included in the rampart distribution.

to do this I created a simple Java project in eclipse added the Service class and also the Password Callback Handler.
After adding all the dependencies I used the Axis2 plugin to create a service.aar file and in the wizard selecting the services.xml file to be included from the rampart sample02 folder
and deployed it to the axis2 using the front end admin console usually found at http://localhost:8080/axis2/ if deployed to a local server.

then I needed to add the rampart.mar files to the \axis2\WEB-INF\modules\ folder of the axis2.war that is deployed from the rampart modules folder when you unpack the rampart download
and also copy the contents of the lib folder from for example C:\Rampart\rampart-dist-1.6.0-bin\rampart-1.6.0\lib\ to \axis2\WEB-INF\lib\ and restart the server

I then created another simple java project called client and added the Client.java file from the rampart samples02 added all the dependencies (essentially just the axis2 lib folder) and ran the client.
(In the client I had to find the endpoint I was using and also the axis2.xml config file which is located in the rampart sample02 folder called client.axis2.xml so I swapped this one out for the real one and referenced it)


At this point I had been following tutorials and expected it to run.

The client started outputting this error



which I could not figure out what the problem was as axis2 has the wss4j.jar in the lib folder and the service.aar file had both the service and PWCBHandler.java which was the password callback class.

so after changing from glassfish 3.1 to tomcat 7 and going through the same process and still no luck I eventually stumbled across a post about wrapping the PWCBHandler.class in a jar a putting it into the axis2 lib folder.
this worked great news hope this helps someone as when whacking WSPasswordCallback cannot be resolved to a type into google there really is nothing.

(Apologies if I have missed any steps)
feel free to ask any questions and I will try to answer them.

cheers Kris

cheers Kris

 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic