OutOfMemory while deploying war on tomcat - java

i get the following error when i try to deploy a war (built with 'grails war') on a tomcat server. Unfortunately there is no other message in the logfile except this:
Nov 25, 2013 3:44:54 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke
SEVERE: Exception invoking method check
java.lang.OutOfMemoryError: Java heap space
at java.io.DataInputStream.readUTF(DataInputStream.java:661)
at java.io.DataInputStream.readUTF(DataInputStream.java:564)
at org.apache.tomcat.util.bcel.classfile.ConstantUtf8.<init>(ConstantUtf8.java:47)
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:125)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2118)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1994)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1960)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1945)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1319)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:541)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1445)
How can i get more information about this error?
Notes:
the grails app is working locally without any issues
other grails apps are working on the same server without problems (all with version 2.2.0, the new one is on 2.3)
i already tried to extend the memory heap ... no improvement
Thank you

What Tomcat version you use? If you for example run Debian Wheezy box, the version available from packages is 7.0.28. It has some serious bugs about traversing classpaths for scanning for annotations (at least that's what I noticed after reading few other questions on SO and bug reports). I think it was fixed somewhere ~ 7.0.34. I had an exactly same problem and noticed that everything runs fine on newer versions.

1- Create setenv.sh in Tomcat(8||9)/bin/setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=256m"
2- chamod a+x setenv.sh
3- execute ./setenv.sh
4- ./startup.sh

Add to setenv.sh the following option in CATALINA_OPTS -XX:+HeapDumpOnOutOfMemoryError it will print heap dump when your deploy will fall down with OOM, which you can analyze by such utilities as JVisualVM or MemoryAnalyzer. After investigation of heap dump you can make decision:
Fix an issue which produce OutOfMemory
Increase heap size (by setting -Xmx in CATALINA_OPTS) in case you can't fix an issue.

Related

FTB Infinity Evolved server not starting with JDK 8

I have downloaded and unzipped the FTB Infinity server from CurseForge on my Arch Linux machine and run both the install and run scripts, and I am presented with this error:
Starting server
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=256M; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12)
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Level
at net.minecraft.launchwrapper.Launch.launch(Launch.java:94)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Level
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 8 more
My directory listing:
changelogs FTBserver.jar ServerStart.sh
config libraries settings.bat
eula.txt minecraft_server.1.7.10.jar settings.sh
FTBInstall.bat modpack version.json
FTBInstall.sh mods
FTBServer-1.7.10-1614.jar ServerStart.bat
I looked at all of the questions online, and most of them said to install jdk 8, but I am already using it. Any ideas?
Okay, so this is pretty dumb of the install script. It downloaded an XML file saying that the jar could not be found instead of the actual jar. (laughs) I should probably report that.

TomEE startup error: Cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder

While starting up my application from within IntelliJ 14 the app server TomEE 7.0.62 gives following error message:
cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder
at org.apache.openejb.assembler.DeployerEjb.<clinit>(DeployerEjb.java:109)
System:
OSX, IntelliJ 14, TomEE-Plume 7.0.62 (homebrew), Java 8 (homebrew cask)
Java version:
/usr/libexec/java_home -V
Matching Java Virtual Machines (1):
1.8.0_60, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Deployment: The basic Hello World sample app from Vaadin Framework 7
Infos:
TomEE startup over Terminal with startup.sh works ok, default tomcat welcome screen is shown on localhost:8080
Tried to add JVM option to set java.io.tmpdir to a different directory with chmod 777 privileges. VM options: -Djava.io.tmpdir=<new temp dir>
Tried to export env variable with export _JAVA_OPTIONS=-Djava.io.tmpdir=<new temp dir>
With Tomcat 8 hello world app works ok
Full error log:
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.openejb.util.Classes.forName(Classes.java:64)
at org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:151)
at org.apache.openejb.config.rules.CheckMethods.check_unusedCreateMethods(CheckMethods.java:318)
at org.apache.openejb.config.rules.CheckMethods.validate(CheckMethods.java:55)
at org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:50)
at org.apache.openejb.config.AppValidator.validate(AppValidator.java:101)
at org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:38)
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971)
at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:526)
at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:591)
at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:459)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:438)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:298)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:256)
at org.apache.tomee.catalina.ServerListener.install(ServerListener.java:168)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:55)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: org.apache.openejb.OpenEJBRuntimeException: cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder
at org.apache.openejb.assembler.DeployerEjb.<clinit>(DeployerEjb.java:109)
... 32 more
Thank you all..
you can add openejb.system.apps=false in conf/system.properties or just export CATALINA_TMPDIR to a "new tmp dir value"

java newrelic agent throwing classnotfound exception

I am trying to install newrelic on a linux machine with tomcat 7. This installation does not have a catalina.sh so cannot use the newrelic installer.
I tried the manula approach of adding the newrelic.jar to the javaagent like:
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/share/tomcat7/newrelic/newrelic.jar"
But whenever I start the tomcat I get the following classnotfoundexception:
Unable to start New Relic agent: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:106)
at com.newrelic.agent.extension.dom.ExtensionDomParser.getTransformerFactory(ExtensionDomParser.java:360)
at com.newrelic.agent.extension.dom.ExtensionDomParser.fixNamespace(ExtensionDomParser.java:337)
at com.newrelic.agent.extension.dom.ExtensionDomParser.parseDocument(ExtensionDomParser.java:167)
at com.newrelic.agent.extension.dom.ExtensionDomParser.readFile(ExtensionDomParser.java:152)
at com.newrelic.agent.extension.ExtensionParsers$3.parse(ExtensionParsers.java:46)
at com.newrelic.agent.extension.JarExtension.<init>(JarExtension.java:59)
at com.newrelic.agent.extension.JarExtension.<init>(JarExtension.java:104)
at com.newrelic.agent.extension.ExtensionService.initializeBuiltInExtensions(ExtensionService.java:388)
at com.newrelic.agent.extension.ExtensionService.doStart(ExtensionService.java:145)
at com.newrelic.agent.service.AbstractService.start(AbstractService.java:54)
at com.newrelic.agent.service.ServiceManagerImpl.doStart(ServiceManagerImpl.java:124)
at com.newrelic.agent.service.AbstractService.start(AbstractService.java:54)
at com.newrelic.agent.Agent.premain(Agent.java:208)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:343)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:358)
Caused by: java.lang.ClassNotFoundException: org/apache/xalan/processor/TransformerFactoryImpl
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at javax.xml.transform.FactoryFinder.getProviderClass(FactoryFinder.java:124)
at javax.xml.transform.FactoryFinder.newInstance(FactoryFinder.java:179)
I have tried everything I could for this, but nothing works. I have even added the xalan jar manually to the tomcat lib but no luck
You need to make sure you have xalan.jar installed. If it is installed, it may be in the wrong place. You probably need it at the container level, here is a blog post that discusses this issue (tomcat5 but most of the advice should still apply).
http://doookstechstuff.blogspot.com/2010/04/how-to-fix-tomcat5-on-rhel5.html
Make sure that the location where you put the xalan.jar is in the classpath and that the user account you're running tomcat under has access to it. If you have dropped it in the tomcat /lib folder make sure the perms for the .jar file match the other objects in the folder.
Let us know if this helps. If you need additional information it might be best to create a ticket with New Relic Support (http://support.newrelic.com).

PermGen Space error when deploying tomcat 7? [duplicate]

This question already has answers here:
How to clear PermGen space Error in tomcat
(11 answers)
Closed 9 years ago.
I installed tomcat 7 to upgraded my JIRA projeect version from 5.0 to 6. After I place the project folder in tomcat's webapps. I run this localhost:8080/jira
after long time running, it throws some error message. Please help us to fix this problem thanks in advance
java.lang.RuntimeException: PermGen space
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1.execute(AsynchronousAbleEventDispatcher.java:32)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:60)
at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)
at com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:84)
at com.atlassian.plugin.manager.DefaultPluginManager.addPlugins(DefaultPluginManager.java:768)
at com.atlassian.plugin.manager.DefaultPluginManager.init(DefaultPluginManager.java:200)
at com.atlassian.jira.plugin.JiraPluginManager.start(JiraPluginManager.java:63)
at com.atlassian.jira.ComponentManager$PluginSystem.start(ComponentManager.java:635)
at com.atlassian.jira.ComponentManager.startJIRA(ComponentManager.java:214)
at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:208)
at com.atlassian.jira.ComponentManager.start(ComponentManager.java:193)
at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:23)
at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:107)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:323)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:211)
at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:100)
at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:27)
at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:66)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:33)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:61)
at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:54)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: PermGen space
More helpful solution is to increase values in JAVA_OPTS variable.
Add next line to your Catalina.bat/Catalina.sh file in bin directory
For Windows (Catalina.bat)
set JAVA_OPTS="-Xms1024m -Xmx10246m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m"
For Unix (Catalina.sh)
export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m"
More solutions you can find in this article
Sometimes after re-deployments the Garbage Collector can't destroy some objects on Tomcat and run out of space.
There are many reasons for these case:
If you use some CRUD-Objects - check if there are all closed after using.
If your app used other libs - sometimes the Objects from these libs cant also be destroyed, like MysqlConnector, Hibernate/C3p0 or other - try to put these libs on the tomcat/lib folder
Check the Tomcat with the "Java VisualVM" and check the permGen after re-deployment.
The default value for the permGen Space are often also very low you can increase them with the following javaVM parameter
-XX:PermSize=64M -XX:MaxPermSize=256m
You can follow these tutorial
http://www.mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-space/
UPDATE
other solution maybe found here : what to do with tomcat PermGen space
add -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC to the javaVM options
Tweak the value of the permgen using -XX:PermSize={value} and -XX:MaxPermSize={value} via the JAVA_OPTS variable where 'value' is a string like 256m.

Tomcat 6.0 on Mac OS X

Hey, I'm trying to run Apache Tomcat 6.0.26 on Mac OS X - Snow Leopard, but with no luck :(
I've downloaded Tomcat core from: http://tomcat.apache.org/download-60.cgi unarchived it at /Livrary/Tomcat directory, but when I'm trying to run it using ./bin/startup.sh command from log/catalina.out logs it seem's that it can't find servlet-api:
SEVERE: Error deploying configuration descriptor host-manager.xml
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at org.apache.catalina.core.StandardHost$MemoryLeakTrackingListener.lifecycleEvent(StandardHost.java:561)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4462)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
During startup it logs in console CLASSPATH it's using:
Using CLASSPATH: /Library/Tomcat/bin/bootstrap.jar
I've not tried to deploy my own application (*.war) it's just "clean" Tomcat.
Probably your system classpath somehow get polluted with pre-2.5 servlet API jar.
You may check it by running java javax.servlet.http.HttpServlet - it should throw NoClassDefFound. If it throws NoSuchMethodError, check your classpath (especially CLASSPATH environment variable and lib/ext subfolder of JRE installation).
EDIT: Try the following code - at least it will show the location of the offending jar:
public class Test {
public static void main(String[] args) throws Exception {
System.out.println(
Test.class.getClassLoader().getResource("javax/servlet/http/HttpServlet.class"));
}
}
Are your CATALINA_BASE and CATALINA_HOME variables correct?
(they should be printed along with the CLASSPATH on startup).
I just tried exactly what you did (downloaded a fresh tomcat 6.0.26 on OS X 10.6.3), unzipped it (I downloaded the core/zip), then set all the .sh files to executable:
(in the bin folder):
chmod a+x *.sh
After that, running startup.sh worked without a hitch.
I can only think that prior CATALINA variables are conflicting?

Categories