The Setup:-
- OpenCMS running on TomCat5.5
- System running on FreeBSD with the DiabloJVM
The OpenCMS system was working then after a restart of TomCat it stopped loading. The Database server (postgres) running on a different host has been rebooted and responds correctly.
Any suggestions to get it running?
When TomCat starts the following errors are in the stdout:
org.apache.openejb.OpenEJBException: org.apache.xbean.recipe.ConstructionException: Error invoking constructor: public org.apache.openejb.tomcat.catalina.TomcatSecurityService(): Error invoking constructor: public org.apache.openejb.tomcat.catalina.TomcatSecurityService()
...
6/12/09 10:11:29 AM (I) WebappClassLoader.validateJarFile : validateJarFile(/usr/local/tomcat5.5/webapps/opencms/WEB-INF/lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
`
6/12/09 9:21:08 AM (S) HostConfig.deployDirectory : Error deploying web application directory opencms
java.lang.ArrayIndexOutOfBoundsException: 26
at org.apache.openejb.asm.ClassReader.readClass(Unknown Source)
at org.apache.openejb.asm.ClassReader.accept(Unknown Source)
at org.apache.openejb.asm.ClassReader.accept(Unknown Source)
at org.apache.openejb.util.AnnotationFinder.readClassDef(AnnotationFinder.java:251)
at org.apache.openejb.util.AnnotationFinder.find(AnnotationFinder.java:157)
at org.apache.openejb.config.DeploymentLoader.discoverModuleType(DeploymentLoader.java:1090)
at org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:540)
at org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.start(TomcatWebAppBuilder.java:234)
at org.apache.openejb.tomcat.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:58)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
I faced with that exception too, when trying to deploy OpenCMS and OpenEJB on the same Tomcat instance. It seems that OpenCMS and OpenEJB doesn't like each other.
However, I found a workaround: After deploying OpenCMS on Tomcat startup, I used The Manager webapp to upload and get OpenEJB running. It worked fine for me.
Looks like you application files are corrupt:
The app server might be keeping an old work/temp directory. Try deleting while it's stopped and redeploying.
This error appears to have been caused by another faulting application. Likely loaded after the server had already started so it wasn't until a reset that OpenCMS was affected. The likely culprit was openjb.
It was solved by removing all the webapps and replacing them one by one until all essential servers had come online.
Regrettably I cannot test more to find out the exact error at this time.
This is a fairly common warning for java applications. Because the web application container's classloader provides both the api and implementation for the servlet specification, a web application is prohibited from providing its own version.
However, as a developer of wep applications, it makes it a bit hard to compile your classes without tooling support, so it's tempting to include this the
servlet.jar
in yourlib/
directory. This makes it pretty easy to accidentally ship a.war
with it as well.Because of this, Tomcat scans all classes as they are loaded, and if found, it blocks loading of the class presents this error.