Question

I'm trying to add an OpenCmis client to web application which already has other clients using CXF. It will be deployed on Weblogic. I have the OpenCMIS client working based on http://chemistry.apache.org/java/opencmis-client-bindings.html

The problem is when I put it together with the other client implementations. For the CXF I had to modify the weblogic-application.xml with some preferred packages and with that the OpenCMIS client doesn't work. The exception I get is this:

Caused By: java.lang.ClassCastException: com.sun.proxy.$Proxy136 cannot be cast to com.sun.xml.ws.developer.WSBindingProvider
    at org.apache.chemistry.opencmis.client.bindings.spi.webservices.SunRIPortProvider.createPortObject(SunRIPortProvider.java:84)
    at org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getPortObject(AbstractPortProvider.java:458)
    at org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getRepositoryServicePort(AbstractPortProvider.java:280)
    at org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:69)
    at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)

Is there some way to make it work together?

Was it helpful?

Solution

To answer my own question. I just needed to add a binding library for opencmis:

    <dependency>
        <groupId>org.apache.chemistry.opencmis</groupId>
        <artifactId>chemistry-opencmis-client-bindings</artifactId>
        <version>${version.opencmis}</version>
    </dependency>

And then add this to initialization:

parameter.put(SessionParameter.WEBSERVICES_PORT_PROVIDER_CLASS, CXFPortProvider.class.getName());

OTHER TIPS

Check the version of the provided CXF-jars and those needed by openCMIS. I needed to downgrade to openCMIS-0.8.0, so I could use CXF-2.2.12 (Version restrictions do to other framework dependencies).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top