Hi, the J2EE WAR excludes OpenJPA by default
(http://rollerweblogger.org/roller/entry/roller_5_and_glassfish_3), but
deploying this WAR on (latest) GlassFish returns this error:
[#|2013-05-25T17:44:25.973-0400|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=92;_ThreadName=admin-thread-pool-4848(7);|WebModule[/roller]PWC1270:
Exception starting filter RequestMappingFilter
java.lang.NoClassDefFoundError:
org/apache/openjpa/enhance/PersistenceCapable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at
org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:927)
at
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1476)
at
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at
org.apache.roller.weblogger.ui.rendering.filters.RequestMappingFilter.init(RequestMappingFilter.java:86)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
Roller won't operate on GlassFish due to this bug. I guess we hardcoded
a dependency on OpenJPA in the code someplace? I can't find it in the
class in question, and grepping the source code isn't helping much.
If I use the Tomcat WAR, which includes OpenJPA, this problem goes away,
but I get off-and-on deployment errors (maybe 25-33% fail) when I enable
& disable or deploy & undeploy the webapp. It invariably returns this
error message: Exception while loading the app
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.RuntimeException:
java.lang.ClassCastException:
org.apache.roller.weblogger.pojos.RuntimeConfigProperty cannot be cast
to org.apache.roller.weblogger.pojos.RuntimeConfigProperty
Googling has shown the immediately above RuntimeConfigProperty error
message to be sometimes an issue with the database config (I'm running
on MySQL), but the database is updating fine when I'm not getting this
deployment error. I guess we need to code JPA generically in Roller
(i.e., remove the OpenJPA references?) I'm a MyBatis fan, so I don't
know much about JPA. :)
Glen