chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <florian.muel...@alfresco.com>
Subject Re: [OpenCMIS] Incompatibility with CXF
Date Mon, 17 Jan 2011 19:13:43 GMT
It still picks up RI. 
Try to force it to CXF with -Djavax.xml.ws.spi.Provider=org.apache.cxf.jaxws22.spi.ProviderImpl

- Florian

On 17/01/2011 18:12, R.WILBERT@akka.eu wrote:
> Florian,
> 
> I compiled and added the modified PortProvider to my classpath. I have 
> now an issue related to WS-Security :
> 
> Caused by: javax.xml.ws.soap.SOAPFaultException: An error was discovered 
> processing the <wsse:Security> header
> at 
> com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)
> at 
> com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
> at 
> com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
> at 
> com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
> at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
> at $Proxy119.getRepositoryInfo(Unknown Source)
> at 
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:100)
> 
> this is how I set the binding parameters :
> 
> /**
> * Binding Web-Services OpenCMIS
> */
> private Map<String, String> createWebServiceParameters() {
> Map<String, String> sessionParameters = new HashMap<String, String>();
> sessionParameters.put(SessionParameter.BINDING_TYPE,
> BindingType.WEBSERVICES.value());
> sessionParameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE,
> cmsWebserviceURL + "/ACLService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
> cmsWebserviceURL + "/DiscoveryService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
> cmsWebserviceURL + "/MultiFilingService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> cmsWebserviceURL + "/NavigationService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
> cmsWebserviceURL + "/ObjectService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
> cmsWebserviceURL + "/PolicyService?wsdl");
> sessionParameters.put(
> SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
> cmsWebserviceURL + "/RelationshipService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
> cmsWebserviceURL + "/RepositoryService?wsdl");
> sessionParameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
> cmsWebserviceURL + "/VersioningService?wsdl");
> 
> sessionParameters.put(SessionParameter.USER, cmsUser);
> sessionParameters.put(SessionParameter.PASSWORD, cmsPassword);
> 
> return sessionParameters;
> }
> 
> My project depends on cxf-rt-ws-security.jar, I tried to remove this 
> dependency but I have the same error.
> 
> I also tried to play with SessionParameters AUTH_SOAP_USERNAMETOKEN & 
> AUTH_HTTP_BASIC with no luck.
> 
> If I look into requestContext, Soap header are correctly filled by 
> authentication provider...
> 
> 
> Any idea ?
> 
> -----Florian Müller <florian.mueller@alfresco.com> a écrit : -----
> 
>     A : R.WILBERT@akka.eu, chemistry-dev@incubator.apache.org
>     De : Florian Müller <florian.mueller@alfresco.com>
>     Date : 17/01/2011 16:47
>     Objet : Re: [OpenCMIS] Incompatibility with CXF
> 
>     All changes are in the trunk (0.3-INCUBATING-SNAPSHOT) and only there.
>     You have rebuild OpenCMIS from the sources in order to use it.
> 
>     It's not very convenient, I know...
> 
> 
>     @all: How big is the interest to support CXF?
>     The implementation is basically done, but setting up the build
>     environment with all the dependencies and RI/CXF collisions could
>     become a nightmare. We would also have to run the FIT tests twice.
> 
> 
>     - Florian
> 
> 
>     On 17/01/2011 15:40, R.WILBERT@akka.eu wrote:
>      > Florian,
>      >
>      > I saw you made several changes to the opencmis-client-bindings
>     classes.
>      > Can you confirm I have to use this with the trunk version
>      > (0.3-INCUBATING-SNAPSHOT) ? Do I have to rebuild openCMIS from
>     sources
>      > or will it be generated tomorrow on the snapshot repository ?
>      >
>      > thank you
>      >
>      >
>      >
>      > -----Florian Müller <florian.mueller@alfresco.com> a écrit : -----
>      >
>      > A : R.WILBERT@akka.eu
>      > De : Florian Müller <florian.mueller@alfresco.com>
>      > Date : 17/01/2011 16:08
>      > cc: chemistry-dev@incubator.apache.org
>      > Objet : Re: [OpenCMIS] Incompatibility with CXF
>      >
>      > There seems to be no reasonable way to make that work with class
>      > loader magic.
>      >
>      > So, I added a class that makes the OpenCMIS client work with CXF. I
>      > ran a few smoke tests and it seems to work but consider it untested.
>      > You also have to build the class yourself as we don't have CXF in
>      > our build environment.
>      >
>      >
>      > Here are the details:
>      >
>      > - The following directory contains now a file
>     "PortProvider.java-cxf":
>      >
>     /chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices
>      >
>      > - Get the file, rename it to "PortProvider.java" and compile it.
>      > You'll need the OpenCMIS jars and CXF jars in the classpath.
>      >
>      > - When you run your application, make sure that the new class will
>      > be found in the classpath before the OpenCMIS jars.
>      > Or, replace the class in the chemistry-opencmis-client-bindings jar.
>      >
>      >
>      > Florian
>      >
>      >
>      > On 17/01/2011 13:21, R.WILBERT@akka.eu wrote:
>      > > Indeed it may happen if there are any other explicit references to
>      > > jax-ws classes.
>      > >
>      > >
>      > >
>      > > -----Florian Müller <florian.mueller@alfresco.com> a écrit : -----
>      > >
>      > > A : R.WILBERT@akka.eu, chemistry-dev@incubator.apache.org
>      > > De : Florian Müller <florian.mueller@alfresco.com>
>      > > Date : 17/01/2011 12:39
>      > > Objet : Re: [OpenCMIS] Incompatibility with CXF
>      > >
>      > > That's an interesting approach. I'll give it a try.
>      > > But I assume it will only defer the problem. I guess we will see
>      > > other ClassCastException later.
>      > >
>      > > - Florian
>      > >
>      > >
>      > > On 17/01/2011 11:38, R.WILBERT@akka.eu wrote:
>      > > > Maybe somthing like this would do the trick :
>      > > >
>      > > >
>      > > > ClassLoader cl = new URLClassLoader(new URL[0],
>      > > > Thread.currentThread().getContextClassLoader()) {
>      > > > public InputStream getResourceAsStream(String s) {
>      > > > if
>      > > >
>      > >
>      >
>     ("*META*-*INF*/*services*/*javax*.*xml*.*ws*.*spi*.*Provider*".equals("s"))
>      > >
>      > > > {
>      > > > //return IS to com.sun.xml.ws.spi.ProviderImpl
>      > > > }
>      > > > return super.getResourceAsStream(s);
>      > > > }
>      > > > public URL getResource(String s) {
>      > > > if
>      > > >
>      > >
>      >
>     ("*META*-*INF*/*services*/*javax*.*xml*.*ws*.*spi*.*Provider*".equals("s"))
>      > >
>      > > > {
>      > > > //return URL to com.sun.xml.ws.spi.ProviderImpl
>      > > > }
>      > > > return super.getResource(s);
>      > > > }
>      > > > };
>      > > >
>      > > > //replace classloader
>      > > > Thread.currentThread().setContextClassLoader(cl);
>      > > >
>      > > > // initialize openCMIS Services
>      > > > [...]
>      > > >
>      > > > //restore default classloader
>      > > > Thread.currentThread().setContextClassLoader(cl.getParent());
>      > > >
>      > > >
>      > > >
>      > > >
>      > > > Romain WILBERT
>      > > > Ingénieur développement
>      > > > AKKA Informatique & Systèmes
>      > > >
>      > > > -----Florian Müller <florian.mueller@alfresco.com> a écrit
:
>     -----
>      > > >
>      > > > A : chemistry-dev@incubator.apache.org, R.WILBERT@akka.eu
>      > > > De : Florian Müller <florian.mueller@alfresco.com>
>      > > > Date : 17/01/2011 11:48
>      > > > Objet : Re: [OpenCMIS] Incompatibility with CXF
>      > > >
>      > > > Hi Romain,
>      > > >
>      > > > It is possible to force the use of
>     com.sun.xml.ws.spi.ProviderImpl
>      > > > by setting this system property:
>      > > > javax.xml.ws.spi.Provider = com.sun.xml.ws.spi.ProviderImpl
>      > > >
>      > > > But that would probably interfere with your CXF Web Services.
>     It's
>      > > > not possible to use both with the same class loader.
>      > > >
>      > > > I'll try to add some class loader magic to OpenCMIS, but I can't
>      > > > promise that this will work eventually.
>      > > >
>      > > >
>      > > > - Florian
>      > > >
>      > > >
>      > > > On 14/01/2011 16:27, R.WILBERT@akka.eu wrote:
>      > > > > Hi !
>      > > > >
>      > > > > Same problem as Erwan (apache CXF cohabitation...) =>
>      > > >
>      > >
>      >
>     (http://mail-archives.apache.org/mod_mbox/incubator-chemistry-dev/201101.mbox/browser)
>      > > > >
>      > > > > Since my project exposes CXF WebServices, I have an error while
>      > > > initializing OpenCMIS WebService client :
>      > > > >
>      > > > >
>      > > >
>      > >
>      >
>     org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException:
>      > > > Cannot initalize Web Services port object: $Proxy340 cannot
>     be cast
>      > > > to com.sun.xml.ws.developer.WSBindingProvider
>      > > > > at
>      > > >
>      > >
>      >
>     org.apache.chemistry.opencmis.client.bindings.spi.webservices.PortProvider.createPortObject(PortProvider.java:325)
>      > > > >
>      > > > > This happens because the first found provider on classloader
is
>      > > > org.apache.cxf.jaxws22.spi.ProviderImpl
>     (cxf-rt-frontend-jaxws.jar
>      > > > precedes jaxws-rt in classloader). My Proxy is a
>      > > > org.apache.cxf.jaxws.JaxWsClientProxy, which causes the
>      > > > ClassCastException.
>      > > > >
>      > > > >
>      > > > > Any workaround for this ? Why don't you force the use of
>      > > > com.sun.xml.ws.spi.ProviderImpl from jaxws-rt as it is anyway a
>      > > > Maven dependency of opencmis-client ?
>      > > > >
>      > > > > Thanks.
>      > > > >
>      > > > > Romain WILBERT
>      > > > > Ingénieur développement
>      > > > > AKKA Informatique& Systèmes
>      > > > >
>      > > > >
>      > > >
>      > > >
>      > > >
>      > >
>      > >
>      > >
>      >
>      >
>      >
> 
> 
> 


Mime
View raw message