1

I am having problems triying to create a WS client in java.

The libraries I'm using is apache-cxf 2.12. This is an old version but I want the web service to be added to a JBoss application that is already running and uses Spring 2.5.6, so this org.apache.cxf version uses same spring version.

But the question is (I know is quite generic, is related to maven, netbeans and apache-cxf)

When I execute my client project (maven proyect) from netbeans, it works sort of Ok. When I try to run this class with a script (bot windows an linux) it gives me this error:

"Invocation failed with the following: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied."

Java versions are the same, I've copied all the dependency jar into lib dir and added then to %classpath%

So, what can be different that when I execute my sample program with maven org.codehaus.mojo:exec-maven-plugin:1.2.1:exec it works and it doesn't when I run it with a srcipt? (I have checked all dependencies, java version, ... )

I guess it has to be related to JAX-WS o JCE (Java Cryptography Architecture) initialization.

¿Is there a way to see what %classpath maven is creating when in runs java.exe?

Maven script that works:

JAVA_HOME=D:\\LOCAL\\Java\\jdk1.5.0_15 
D:\\LOCAL\\apache-maven-2.0.9\\bin\\mvn.bat 
-Dexec.classpathScope=runtime 
-DskipTests=true 
"-Dexec.args=-Djavax.net.debug=all -classpath %classpath es.webservice.aaTest TESTFILE" 
-Dexec.executable=D:\\LOCAL\\Java\\jdk1.5.0_15\\bin\\java.exe 
-Dmaven.repo.local=D:\\bsrepo\\.m2 process-classes 
org.codehaus.mojo:exec-maven-plugin:1.2:exec

Thanks

ibonso
  • 31
  • 5

0 Answers0