| Summary: | EclipseLink-7198: java.lang.ClassNotFoundException: Class was not found while converting from class names to classes | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Mikael Nousiainen <mikael.nousiainen> | ||||||
| Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P2 | CC: | michael.f.obrien, mikael.nousiainen, tom.ware | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| URL: | http://www.eclipse.org/forums/index.php?t=msg&th=170950&start=0 | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | 266912, 303063, 322585 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Mikael Nousiainen
Created attachment 184935 [details]
Stack traces in GlassFish logs with EcliseLink logging level set to FINEST
Particularly one line is interesting - just before the exception there is:
[#|2010-12-10T12:13:49.238+0200|FINEST|glassfish3.0.1|org.eclipse.persistence.default|_ThreadID=29;_ThreadName=Thread-1;ClassName=null;MethodName=null;|The metamodel TypeImpl.javaClass field should not be set to null for the Type [EntityTypeImpl@302525333 [ javaType: null descriptor: null]].|#]
Created attachment 184936 [details]
A small test case to reproduce the exception
The test case requires Maven 2.2 to compile and it can be deployed in GlassFish 3.0.1.
You have to create a connection pool in GlassFish using name jdbc/TestConnectionPool
It seems that there is a workaround for this bug. If you execute any simple select query using regular JPQL query (NOT CriteriaBuilder) before using CriteriaBuilder, the application works. So apparently something does not get initialized properly when using CriteriaBuilder or it uses an incorrect ClassLoader at some point. Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines >This issue is very likely a reproduction of the unitialized javaClass from javaClassNam that we would like to narrow down with a good test case. There are 2 details to be aware of... 1) in SVN rev# 8141 v20100904 a change for bug # 322485 was put in to force initializeDescriptors() on an early predeploy() (and set the javaClass preemptively) in case a getMetamodel() or getCriteriaBuilder() is called on an EntityManagerFactory before we have an EntityManager session running. https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8142 https://bugs.eclipse.org/bugs/show_bug.cgi?id=322585 2) If you are still seeing a an issue after upgrading past the 8141 revision of EclipseLink then either this or bug # 303063 or bug # 322585 should be reopened. https://bugs.eclipse.org/bugs/show_bug.cgi?id=303063#c25 The message "The metamodel TypeImpl.javaClass field should not be set to null for the Type" warning is a final catch-all to track any instances of bug # 303063 that still occur after a forced EMF predeploy() of the metamodel >I am not duplicating this bug at this point to bug # 303063 until post rev # 8142 testing is done My initial tests (using the test case provided as attachment to this bug) confirm that this bug is resolved in EclipseLink 2.1.2. Closing based on above comments >Mickael, thank for verifying post rev 8141 in bug # 322585
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |