geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josef.Eis...@bgs-ag.de
Subject Antwort: Re: WS-Stack Apache CXF asks for Axis2-Classes
Date Wed, 23 Jul 2008 11:24:58 GMT
Hi Kevin, Lin, Daniel, Glen,

@Daniel: Your VM-Parameters solved this problem. Thank you very much for 
your help.

@Lin: I start my Geronimo with this script:
export JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre"
export JAVA_OPTS="-javaagent:"/home/mypath/geronimo/bin/jpa.jar" 
-Djava.ext.dirs="/home/mypath/geronimo/lib/ext:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/ext"

-Djava.endorsed.dirs="/home/mypath/geronimo/lib/endorsed:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/endorsed"

-Xms128m -Xmx512m -XX:MaxPermSize=256m"
export GERONIMO_HOME=/home/mypath/geronimo
export GERONIMO_OPTS="-Dorg.apache.geronimo.jaxws.provider=cxf 
-Dorg.apache.geronimo.saaj.provider=sun" 
/home/mypath/geronimo/bin/geronimo.sh jpda start

@Kevin: We use Geronimo 2.1.1 with Tomcat. Because of 
https://issues.apache.org/jira/browse/AXIS2-3808 und 
http://www.nabble.com/JAX-WS-2.1-WebService-inside-Geronimo-2.0.1-td17088122s134.html#a17328111

we want to use Apache CXF.

@Glen: Thank you very much for your tipp, we will wait for Geronimo 2.1.2 
and then we have Apache CXF2.0.6...

@All: Now I have two new issues ;-) 
1) The client is written like described in 
http://cwiki.apache.org/CXF20DOC/ws-security.html. For the server part - 
because of JavaEE5 - we choose 
http://depressedprogrammer.wordpress.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/
. 
In the first run I added 
@InInterceptors(interceptors={   "de.myapp.WSSecurityInterceptor" })  to 
the WS-Implementation-Class and nothing happend. Afterwards I had a try 
with the interface class and added the same 
@InInterceptors(interceptors={   "de.myapp.WSSecurityInterceptor" }). 
After this changed the class de.myapp.WSSecurityInterceptor was accessed. 
Why do I have to add @... in implementation AND interface?
2) In the handleMessage(Message message) I receive after:
...
                props.put(WSHandlerConstants.PASSWORD_TYPE, 
WSConstants.PW_TEXT);
                props.put(WSHandlerConstants.PW_CALLBACK_CLASS, 
ServerPasswordCallback.class.getName());

                WSS4JInInterceptor wss4jInHandler = new 
WSS4JInInterceptor(props);
...

the exception:
[DEBUG] [MyWSImpl] >> Webservice-Methode 'receiveData' wird aufgerufen.
23.07.2008 11:07:53 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
        at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:191)
        at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:56)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
        at 
org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at 
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
        at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
        at 
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
        at $Proxy21.receiveData(Unknown Source)
        at de.myproject.ws.MyWSImpl.callWebservice(MyWSImpl.java:156)
        at de.myproject.ws.MyWSImpl.readData(MyWSImpl.java:58)
        at de.myproject.ws.MyWSImplTest.testreadData(MyWSImplTest.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
        at 
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
        at 
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at 
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
        at 
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
        at 
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
        at 
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
        at 
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
        at 
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at 
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
        at 
com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
        at 
com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
        at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:85)
        .. 37 more
javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
        at $Proxy21.receiveData(Unknown Source)
        at de.myproject.ws.MyWSImpl.callWebservice(MyWSImpl.java:156)
        at de.myproject.ws.MyWSImpl.readData(MyWSImpl.java:58)
        at de.myproject.ws.MyWSImplTest.testreadData(MyWSImplTest.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
        at 
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
        at 
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at 
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
        at 
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
        at 
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
        at 
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
        at 
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
        at 
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at 
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading 
XMLStreamReader.
        at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:191)
        at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:56)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
        at 
org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at 
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
        at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
        at 
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
        .. 24 more
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
        at 
com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
        at 
com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
        at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:85)
        .. 37 more


Any suggestions for this problem?!

-Josef




Kevan Miller <kevan.miller@gmail.com> 
18.07.2008 18:50
Bitte antworten an
user@geronimo.apache.org


An
user@geronimo.apache.org
Kopie

Thema
Re: WS-Stack Apache CXF asks for Axis2-Classes







On Jul 18, 2008, at 11:51 AM, Lin Sun wrote:

Looks like it is still using Axis2's saaj impl even if you set to use 
Sun's.

I wonder if your GERONIMO_OPTS configuration is picked up correctly.
How are you starting the server?

Lin
On Fri, Jul 18, 2008 at 10:22 AM,  <Josef.Eisele@bgs-ag.de> wrote:

Hi all,

Step for Step I created a webservice for Apache CXF under Geronimo 2.1.1.
After implementing and testing I wanted to go on with the implementation 
of
WS-Security Features. I tried to do my best using the howto under
http://cwiki.apache.org/CXF20DOC/ws-security.html

I had to add some more libraries into my WAR-File like
cxf-rt-ws-security-2.0.2-incubator.jar
wss4j-1.5.1.jar
xmlsec-1.3.0.jar

I start Geronimo with the VM-Parameter:
export GERONIMO_OPTS="-Dorg.apache.geronimo.jaxws.provider=cxf
-Dorg.apache.geronimo.saaj.provider=sun"

And now after if I call my webservice-method, I get the error:
..
Provider org.apache.axis2.saaj.MessageFactoryImpl not found
Provider org.apache.axis2.saaj.SOAPFactoryImpl not found

Pretty sure that the problem is we're picking up two resource files from 
the axis2-saaj jar file. In particular:

META-INF/services/javax.xml.soap.SOAPConnectionFactory
META-INF/services/javax.xml.soap.MessageFactory

Can you remind me of your configuration/setup?

You're running on Geronimo 2.1.1. 
Are you using Tomcat? 
Which default web services provider are you using? Axis2 would be the 
default... 
You are attempting to deploy your own CXF libraries with your .war file?
Finally, the reason you are deploying with hidden-classes is to avoid -- 
https://issues.apache.org/jira/browse/GERONIMO-4029 ?

--kevan


BGS Beratungsgesellschaft 
Software Systemplanung AG 
  
  
  
  
Niederlassung Rhein/Main 
Robert-Koch-Straße 41 
55129 Mainz 
Fon: +49 (0) 6131 / 914-0 
Fax: +49 (0) 6131 / 914-400 
www.bgs-ag.de 
Geschäftssitz Mainz 
Registergericht 
Amtsgericht Mainz 
HRB 62 50 
  
Aufsichtsratsvorsitzender 
Klaus Hellwig 
Vorstand 
Hanspeter Gau 
Hermann Kiefer 
Nils Manegold 


  
Mime
View raw message