Bug 1170409 - JAXBContext.newInstance() throws NullPointerException with org.drools.core.xml.jaxb.util.JaxbObjectObjectPair
Summary: JAXBContext.newInstance() throws NullPointerException with org.drools.core.xm...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Shelly McGowan
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-04 02:21 UTC by Toshiya Kobayashi
Modified: 2020-03-27 20:01 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:01:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Toshiya Kobayashi 2014-12-04 02:21:35 UTC
Description of problem:

JAXBContext.newInstance(org.drools.core.xml.jaxb.util.JaxbObjectObjectPair.class) throws NullPointerException. You can simply check with this test code:

====
    public void testJaxb() throws Exception {
            JAXBContext jaxbContext = JAXBContext.newInstance(org.drools.core.xml.jaxb.util.JaxbObjectObjectPair.class);
            System.out.println(jaxbContext);
    }
====

Actually, it was found when a user click "build&deploy" in business-central and the user happened to include org.drools.core.xml.jaxb.util.JaxbObjectObjectPair in their dependent pojo jar.

====
 Caused by: java.lang.NullPointerException
               at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:169) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.property.AttributeProperty.<init>(AttributeProperty.java:91) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:108) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:181) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:326) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:141) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1163) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145) [jaxb-impl-2.2.5-redhat-5.jar:2.2.5-redhat-5]
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_71]
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_71]
               at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_71]
               at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
               at javax.xml.bind.ContextFinder.find(ContextFinder.java:392) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
               at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
               at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:565) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
               at org.kie.remote.services.rest.jaxb.DynamicJaxbContext.setupDeploymentJaxbContext(DynamicJaxbContext.java:221) [kie-services-remote-6.0.3-redhat-6.jar:6.0.3-redhat-6]
               at org.kie.remote.services.rest.jaxb.DynamicJaxbContext.setupDeploymentJaxbContext(DynamicJaxbContext.java:152) [kie-services-remote-6.0.3-redhat-6.jar:6.0.3-redhat-6]
               at org.kie.remote.services.rest.jaxb.DynamicJaxbContext$Proxy$_$$_WeldClientProxy.setupDeploymentJaxbContext(DynamicJaxbContext$Proxy$_$$_WeldClientProxy.java) [kie-services-remote-6.0.3-redhat-6.jar:6.0.3-redhat-6]
...
               at org.jbpm.kie.services.impl.AbstractDeploymentService.commonDeploy(AbstractDeploymentService.java:106) [jbpm-kie-services-6.0.3-redhat-6.jar:6.0.3-redhat-6]
               at org.jbpm.kie.services.impl.KModuleDeploymentService.deploy(KModuleDeploymentService.java:110) [jbpm-kie-services-6.0.3-redhat-6.jar:6.0.3-redhat-6]
               at org.jbpm.kie.services.impl.KModuleDeploymentService$Proxy$_$$_WeldClientProxy.deploy(KModuleDeploymentService$Proxy$_$$_WeldClientProxy.java) [jbpm-kie-services-6.0.3-redhat-6.jar:6.0.3-redhat-6]
               at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.deploy(DeploymentManagerEntryPointImpl.java:113) [jbpm-console-ng-business-domain-backend-6.0.3-redhat-6.jar:6.0.3-redhat-6]
               ... 50 more
====

The customer is fine to remove the class from the pojo jar so it's not an issue actually. But I think org.drools.core.xml.jaxb.util.JaxbObjectObjectPair is designed to be JAXB aware so I filed this BZ with low priority as a potential bug.

Steps to Reproduce:
1. Run the test code
    public void testJaxb() throws Exception {
            JAXBContext jaxbContext = JAXBContext.newInstance(org.drools.core.xml.jaxb.util.JaxbObjectObjectPair.class);
            System.out.println(jaxbContext);
    }

Actual results:

Throws NullPointerException

Expected results:

Run successfully

Comment 1 Toshiya Kobayashi 2014-12-04 02:24:08 UTC
Sorry about not sending a unit test. I'm not very confident if this is a bug. If needed, please let me know and I will send a unit test as PR.


Note You need to log in before you can comment on or make changes to this bug.