Community
Participate
Working Groups
When bootstrapping with, say: properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY, inputStream); there is no proper error message given if the 'package-name' element is missing from the OXM file. Instead you will see: Local Exception Stack: Exception [EclipseLink-50069] (Eclipse Persistence Services - 2.2.0.qualifier): org.eclipse.persistence.exceptions.JAXBException Exception Description: (There is no English translation for this exception.) at org.eclipse.persistence.exceptions.JAXBException.packageNotSetForBindingException(JAXBException.java:326) at org.eclipse.persistence.jaxb.JAXBContextFactory.processBindingFile(JAXBContextFactory.java:482) at org.eclipse.persistence.jaxb.JAXBContextFactory.getXmlBindingsFromProperties(JAXBContextFactory.java:461) at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.initializeFromOXM(DynamicJAXBContext.java:257) at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromOXM(DynamicJAXBContextFactory.java:323) at org.eclipse.persistence.testing.jaxb.dynamic.DynamicJAXBFromOXMTestCases.testXmlClassExtractor(DynamicJAXBFromOXMTestCases.java:1047) 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:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
The JAXBExceptionResource message for this exception has the wrong key. It is 50068 but should be 50069. When running the JUnit tests I now see the following message when the package-name attribute is not specified for a non-Map bindings format: Exception Description: A package was not specified for the provided XML metadata file. The package can be specified by passing in Map<String, Object> (where String = package, Object = handle to XML metadata file) or by setting the package-name attribute on the xml-bindings element in the XML metadata file.
Created attachment 183771 [details] Contains proposed fix
Reviewed by: rick.barkhouse@oracle.com Tests: all unit tests pass as expected Revision: 8554
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink