Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365315 - with JDK 1.5, in test-oxm and test-jaxb, numerous failures with ClassNotFoundException
Summary: with JDK 1.5, in test-oxm and test-jaxb, numerous failures with ClassNotFound...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-01 09:36 EST by Praba Vijayaratnam CLA
Modified: 2022-06-09 10:28 EDT (History)
1 user (show)

See Also:


Attachments
Propsed Test fix (844 bytes, patch)
2011-12-02 11:13 EST, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Praba Vijayaratnam CLA 2011-12-01 09:36:08 EST
test config:
Ant target: test-jaxb/test-oxm
Java Development Kit: jdk15
------------
Sample test failure:

org.eclipse.persistence.testing.jaxb.dynamic.DynamicJAXBContextCreationTestCases.Dynamic JAXB: Context Creation: testNewInstanceString


Local Exception Stack:
Exception [EclipseLink-9002] (Eclipse Persistence Services - 2.4.0.v20111129-r10474): org.eclipse.persistence.exceptions.SessionLoaderException
Exception Description: Unable to load Project class [org.eclipse.persistence.testing.jaxb.xmlmarshaller.EmployeeProject].
Internal Exception: java.lang.ClassNotFoundException: org.eclipse.persistence.testing.jaxb.xmlmarshaller.EmployeeProject
at org.eclipse.persistence.exceptions.SessionLoaderException.failedToLoadProjectClass(SessionLoaderException.java:79)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.loadProjectConfig(SessionsFactory.java:313)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.createSession(SessionsFactory.java:247)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.buildDatabaseSessionConfig(SessionsFactory.java:187)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.buildSession(SessionsFactory.java:176)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.buildSessionConfigs(SessionsFactory.java:125)
at org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader.buildSessionConfigs(XMLSessionConfigLoader.java:261)
at org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:238)
at org.eclipse.persistence.sessions.factories.SessionManager.getSession(SessionManager.java:403)
at org.eclipse.persistence.sessions.factories.SessionManager.getSession(SessionManager.java:338)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext$SessionsXmlContextInput.createContextState(DynamicJAXBContext.java:357)
at org.eclipse.persistence.jaxb.JAXBContext.(JAXBContext.java:180)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.(DynamicJAXBContext.java:70)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContext(DynamicJAXBContextFactory.java:195)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:127)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:248)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:279)
at org.eclipse.persistence.testing.jaxb.dynamic.DynamicJAXBContextCreationTestCases.testNewInstanceString(DynamicJAXBContextCreationTestCases.java:52)
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.testing.jaxb.xmlmarshaller.EmployeeProject
at java.lang.ClassLoader.findClass(ClassLoader.java:359)
at org.eclipse.persistence.dynamic.DynamicClassLoader.findClass(DynamicClassLoader.java:221)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.loadProjectConfig(SessionsFactory.java:310)
Comment 1 Matt MacIvor CLA 2011-12-01 14:41:34 EST
The jdk 1.5 test failures are actually caused by a compile error in the tests:

[echo] Compiling JAXB tests...
    [javac] Compiling 1473 source files to C:\EclipseLink_Clean\moxy\eclipselink.moxy.test\classes
    [javac] C:\EclipseLink_Clean\moxy\eclipselink.moxy.test\src\org\eclipse\persistence\testing\jaxb\dynamic\util\LinkAdapter.java:43: java.lang.Object cannot be dereferenced
    [javac]         StringTokenizer tokenizer = new StringTokenizer(link.get("href").toString(), "&", false);
    [javac]                                                                 ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error 

Because the compile fails, later on many of the test classes aren't there, so a number of ClassNotFoundExceptions are thrown.
Comment 2 Matt MacIvor CLA 2011-12-02 11:13:47 EST
Created attachment 207848 [details]
Propsed Test fix

Fixes the compile error so most tests now run and pass.  There are still several JAXB and OXM failures with 1.5. Will open another bug to track those.
Comment 3 Matt MacIvor CLA 2011-12-06 11:26:33 EST
Attached Patch checked in to SVN.
Reviewed by Blaise Doughan
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:28:51 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink