kink80 / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

Consumer in EE6 Container (eg Jboss 7) #252

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We need to use an ODATA consumer in a Jboss 7 application which already comes 
with its own JAX-RS and JAX-WS implementation.   I am guessing any EE6 
container will have the same issue.   IT is trying to force the CXF as the 
implementation which causes classloader conflicts.  We were able to get it to 
work in Jboss 7 by commenting out the following code in ODataCxfConsumer .

Maybe there needs to be just a generic OdataJaxRsClient to be run inside EE6 
Containers?

public class ODataCxfConsumer extends AbstractODataConsumer {

   private final ODataCxfClient client;

   private ODataCxfConsumer(FormatType type, String serviceRootUri, OClientBehavior... behaviors) {
      super(serviceRootUri);

      // // ensure that the correct JAX-RS implementation (CXF) is loaded
      // if (!(RuntimeDelegate.getInstance() instanceof
      // org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl))
      // RuntimeDelegate.setInstance(new
      // org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl());

      this.client = new ODataCxfClient(type, behaviors);
   }

…
}

Original issue reported on code.google.com by mellowaredev on 3 Apr 2013 at 2:44