Issue Details (XML | Word | Printable)

Key: OPENJPA-256
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Bernd Bohmann
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
OpenJPA

java.lang.ClassNotFoundException: org.apache.openjpa.util.CacheMap in a jetty spring environment

Created: 09/Jun/07 12:08 PM   Updated: 21/Aug/07 03:46 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File OPENJPA-256.error.log 2007-06-09 12:10 PM Bernd Bohmann 10 kB
Text File Licensed for inclusion in ASF works OPENJPA256.patch 2007-08-13 08:40 PM Bernd Bohmann 2 kB
Environment: jetty 6.1.3 jdk 1.5 spring 2.0.5 openjpa 1.0.0-SNAPSHOT maven 2.0.5

Resolution Date: 21/Aug/07 03:22 PM


 Description  « Hide
Get a ClassNotFoundException: org.apache.openjpa.util.CacheMap.

I think the java.util.Map in Line 1405

queryCompilationCachePlugin.instantiate(Map.class, this);

of OpenJPAConfigurationImpl cause the error.

The classloader in this enviroment is a sun.misc.Launcher$AppClassLoader for java.util.Map not a WebAppClassLoader.

Changing the Map.class to CacheMap.class solves the problem (the right ClassLoader is used)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Bernd Bohmann made changes - 09/Jun/07 12:10 PM
Field Original Value New Value
Attachment OPENJPA-256.error.log [ 12359326 ]
Patrick Linskey added a comment - 09/Jun/07 04:12 PM
How is OpenJPA configured in your environment? How are you bootstrapping it?

Bernd Bohmann added a comment - 10/Jun/07 08:02 AM
OpenJPA is configured by spring and part of the webapp.
The classes are enhanced at build time.

You can see the complete example at:

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/addressbook/

the 9.6-incubating version works but any newer version shows this error.

If you want to play with it you can use this version

http://svn.apache.org/repos/asf/myfaces/tobago/tags/tobago-1.0.11/example/addressbook/

this is using a released version of tobago. You don't need to build the whole project :-).

Please change the property openjpa.version to a newer version in the pom and start the application with

mvn jetty:run-exploded and open a browser with the url http://localhost:8080


Bernd Bohmann made changes - 10/Jun/07 08:04 AM
Environment jetty 6.1.3 jdk 1.5 spring 2.0.5 openjpa 1.0.0-SNAPSHOT jetty 6.1.3 jdk 1.5 spring 2.0.5 openjpa 1.0.0-SNAPSHOT maven 2.0.5
Marc Prud'hommeaux added a comment - 02/Aug/07 03:53 AM
The QueryCompilationCacheValue class differs from most plugins in that th
e plugin type is the standard java interface Map.class (rather than an openjpa-s
pecific interface), which means that the ClassLoader used to load the implementa
tion will be the system class loader; this presents a problem if OpenJPA is not
in the system classpath, so work around the problem by catching the IllegalArgum
entException (which is what we wrap the ClassNotFoundException in) and try again.

This is fixed as of revision 562011. The only workaround of earlier versions of OpenJPA is to set the "openjpa.QueryCompilationCache" property to "none" (thereby disabling the query compilation cache).

Marc Prud'hommeaux made changes - 02/Aug/07 03:53 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.0.0 [ 12312341 ]
Bernd Bohmann added a comment - 13/Aug/07 08:37 PM
In my case

Configurations.newInstance wraps the Exception with a ParseException.

I will attach a patch with also catch the ParseException.

Bernd Bohmann made changes - 13/Aug/07 08:37 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Bernd Bohmann added a comment - 13/Aug/07 08:40 PM
patch attached

Bernd Bohmann made changes - 13/Aug/07 08:40 PM
Attachment OPENJPA256.patch [ 12363719 ]
Marc Prud'hommeaux added a comment - 21/Aug/07 02:57 PM
Bumping to release 1.0.1 since 1.0.0 is being released.

Marc Prud'hommeaux made changes - 21/Aug/07 02:57 PM
Fix Version/s 1.0.1 [ 12312687 ]
Fix Version/s 1.0.0 [ 12312341 ]
Repository Revision Date User Message
ASF #568164 Tue Aug 21 15:21:50 UTC 2007 pcl OPENJPA-256. Applied patch supplied by Bernd.
Files Changed
MODIFY /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/QueryCompilationCacheValue.java

Patrick Linskey added a comment - 21/Aug/07 03:22 PM
Applied the patch, but sadly not until after the 1.0.0 deadline.

Patrick Linskey made changes - 21/Aug/07 03:22 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Patrick Linskey added a comment - 21/Aug/07 03:46 PM
Looks like we're doing another 1.0.0 retry, so this is now in.

Patrick Linskey made changes - 21/Aug/07 03:46 PM
Fix Version/s 1.0.1 [ 12312687 ]
Fix Version/s 1.0.0 [ 12312341 ]
Repository Revision Date User Message
ASF #568173 Tue Aug 21 15:47:11 UTC 2007 mprudhom OPENJPA-256 fixed for 1.0.0 branch
Files Changed
MODIFY /openjpa/branches/1.0.0/openjpa-kernel/src/main/java/org/apache/openjpa/conf/QueryCompilationCacheValue.java
MODIFY /openjpa/branches/1.0.0/openjpa-project/CHANGES.txt
MODIFY /openjpa/branches/1.0.0/openjpa-project/RELEASE-NOTES.html