jaxb
  1. jaxb
  2. JAXB-623

Resolver not called for a schema location

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.9
    • Fix Version/s: not determined
    • Component/s: xjc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      623

      Description

      I've installed a CatalogResolver into my compiler object via setEntityResolver.

      I try to parse some schemas with associated customization.

      Internalizer.buildTargetNodeMap does not use the resolver on the schemaLocation,
      so it remains unresolved and so not found.

      org.apache.cxf.tools.common.ToolException: Thrown by JAXB :
      "http://www.company.com/extra.xsd" is not a part of this compilation. Is this a
      mistake for
      "file:/Users/benson/cxf/trunk/tools/wsdlto/test/target/test-classes/wsdl2java_wsdl/cxf1112/extra.xsd"?
      at
      org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:34)
      at
      com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:285)
      at
      com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:504)
      at
      com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:495)
      at
      com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:205)
      at
      com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:134)
      at
      com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:96)
      at com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:448)
      at
      com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:221)
      at
      com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
      at
      org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:255)
      at
      org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:525)
      at
      org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:176)
      at
      org.apache.cxf.tools.wsdlto.jaxws.CodeGenBugTest.testJaxbCatalog(CodeGenBugTest.java:881)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
      at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
      at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
      at
      org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
      at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
      at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
      at
      org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
      at
      org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      at
      org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: com.sun.istack.SAXParseException2: "http://www.company.com/extra.xsd"
      is not a part of this compilation. Is this a mistake for
      "file:/Users/benson/cxf/trunk/tools/wsdlto/test/target/test-classes/wsdl2java_wsdl/cxf1112/extra.xsd"?
      at
      com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:501)
      ... 33 more

        Activity

        Hide
        Pavel Bucek added a comment -

        Can you provide reproducible test case?

        JAXB only part would be best.

        Thanks,
        Pavel

        Show
        Pavel Bucek added a comment - Can you provide reproducible test case? JAXB only part would be best. Thanks, Pavel
        Hide
        Martin Grebac added a comment -

        Please feel free to reopen with a simple testcase.

        Show
        Martin Grebac added a comment - Please feel free to reopen with a simple testcase.
        Hide
        bimargulies added a comment -

        Pavel,

        I read the source code before filing this report, and observer that
        Internalizer.buildTargetNodeMap doesn't call the necessary resolver in the
        necessary spot. I can probably build a test case, but I'd like to know if you
        really have counter-evidence.

        Show
        bimargulies added a comment - Pavel, I read the source code before filing this report, and observer that Internalizer.buildTargetNodeMap doesn't call the necessary resolver in the necessary spot. I can probably build a test case, but I'd like to know if you really have counter-evidence.
        Hide
        bimargulies added a comment -

        Created an attachment (id=325)
        test case

        Show
        bimargulies added a comment - Created an attachment (id=325) test case

          People

          • Assignee:
            Martin Grebac
            Reporter:
            bimargulies
          • Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: