bootdelegation to com.sun.* seems to block com.sun.codemodel package from 
jaxb-xjc
----------------------------------------------------------------------------------

                 Key: KARAF-860
                 URL: https://issues.apache.org/jira/browse/KARAF-860
             Project: Karaf
          Issue Type: Bug
          Components: karaf-core
    Affects Versions: 2.2.2
         Environment: JDK 1.6.0_26, Equinox
            Reporter: Chris Dolan
            Priority: Minor


This may be just user error or configuration error. If so I apologize in 
advance...

In etc/config.properties, the org.osgi.framework.bootdelegation property 
includes com.sun.*. I'm using CXF+JAXB for my JAX-RS implementation via Talend 
Service Factory. The jaxb feature is like this:

    <feature name='cxf-jaxb' version='2.2.1.1_1' resolver='(obr)'>
        <feature version="2.4.2">cxf-specs</feature>
        <bundle 
start-level='20'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.1.1_1</bundle>
        <bundle 
start-level='20'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc/2.2.1.1_1</bundle>
    </feature>

The problem is that jaxb-xjc includes classes in com.sun.*, specifically the 
one that I need: com.sun.codemodel.JCodeModel

If I look at the bundle console for CXF 
(http://localhost:8080/system/console/bundles/160) I see this: 
"com.sun.codemodel,version=0.0.0 from org.apache.servicemix.bundles.jaxb-xjc 
(123) -- Overwritten by Boot Delegation"

That leads to this failure in my CXF code generator:

...
Caused by: java.lang.reflect.UndeclaredThrowableException: null
        at $Proxy106.build(Unknown Source) ~[na:na]
        at 
org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.generateClassesFromSchema(SourceGenerator.java:821)
 ~[bundlefile:2.4.2]
        ... 42 common frames omitted
Caused by: java.lang.NoSuchMethodException: 
com.sun.codemodel.JCodeModel.build(java.lang.Object)
        at java.lang.Class.getMethod(Class.java:1605) ~[na:1.6.0_26]
        at 
org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:50)
 ~[bundlefile:2.4.2]
        ... 44 common frames omitted

I tried to test removing "com.sun.*" from bootdelegation, but I got other 
problems so I couldn't verify if that change would resolve the problem.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to