3
votes

I've generated a web service client using cxf-codegen-plugin, and locally I'm running this code just fine and it connects to the web service.

The trouble arises when I try to deploy my application to our WebLogic server. When my *ServiceImplService class is attempted instantiated, the following exception is thrown:

Caused by: javax.xml.bind.JAXBException: property "supressAccessorWarnings" is not supported

From what I have gathered, this might stem from WebLogic supplying an older version of some jaxb related classes. I've (separately) tried adding com.sun.xml.bind.*, javax.xml.*, javax.jws.* and in desperation even com.sun.* to the prefer-application-packages element of weblogic-application.xml, but still the same result.

Anyone know what might fix this, or have suggestions for forther debugging?


Some additional information, in case it is relevant

  • CXF version: 2.6.1
  • WebLogic version: 10.3.4.0

weblogic-application.xml, without any of the modifications I've tried:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wls:weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-application.xsd">
    <wls:prefer-application-packages>
        <wls:package-name>org.hibernate.*</wls:package-name>
        <wls:package-name>antlr.*</wls:package-name>
        <wls:package-name>org.springframework.*</wls:package-name>
        <wls:package-name>net.bull.*</wls:package-name>   
        <wls:package-name>org.apache.commons.*</wls:package-name>
    </wls:prefer-application-packages>
</wls:weblogic-application>

The exception thrown:

Caused by: javax.xml.bind.JAXBException: property "supressAccessorWarnings" is not supported
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:118)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
    at sun.reflect.GeneratedMethodAccessor391.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:128)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:277)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
    at weblogic.wsee.jaxws.tubeline.ConfigReaderTubelineDeploymentListener.readConfigFile(ConfigReaderTubelineDeploymentListener.java:164)
    at weblogic.wsee.jaxws.tubeline.ConfigReaderTubelineDeploymentListener.init(ConfigReaderTubelineDeploymentListener.java:52)
    at weblogic.wsee.jaxws.spi.WLSServiceDelegate$WLSTubelineDeploymentListenerRepository.<init>(WLSServiceDelegate.java:323)
    at weblogic.wsee.jaxws.spi.WLSServiceDelegate.<init>(WLSServiceDelegate.java:94)
    at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:586)
    at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)
    at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)
    at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)
    at javax.xml.ws.Service.<init>(Service.java:56)
    at <my package name>.PutSituationServiceImplService.<init>(PutSituationServiceImplService.java:47)
    ... 7 more
2

2 Answers

1
votes

Should anyone come along with a better answer I'll mark it as the selected one, but for now:

It seems this stems from the fact that WebLogic supplies supplies JAXB 2.0 and JAXB 2.1, while this version of CXF makes use of JAXB 2.2 functionality.

From what I understand, it is not possible to use prefer-package-elements to prefer 1) classes that have been imported into the JDK or 2) sun internal classes using. You have the option of putting the jar files in the JDK/JRE's endorsed foldes, but I did not want to go this route.

Currently I've downgraded CXF to v.2.2.12, which is the last CXF version to make use of JAXB 2.1.

0
votes

The same error is caused by the METRO 2.0 library. This library is added to the NetBeans project automatically when you try to create web service from wdsl.

Since I don't need this library, I removed it from the project.