Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-232

JAXBContext.newInstance() throws NullPointerException with org.drools.core.xml.jaxb.util.JaxbObjectObjectPair

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Minor Minor
    • None
    • 6.x.x
    • Business Central
    • None

      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

              kverlaen@redhat.com Kris Verlaenen
              rhn-support-tkobayas Toshiya Kobayashi
              Ivo Bek Ivo Bek
              Ivo Bek Ivo Bek
              Kris Verlaenen, Marek Baluch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: