Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 4.0.4

 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running Tomcat 4.0.4 with jdk 1.4.2_04 at first I was receiving an error that said: org.apache.jasper.JasperException: Unable to compile class for JSPerror: Invalid class file format...

I went thru some of the posting on this site and found some information that stated I should change my jdk so I did that but now the application will not start at all.

Can someone please help me?

Thanks.
Tonya
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What does "the application will not start" mean? How are you trying to start Tomcat? Is there some kind of error message, or any message, actually?
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the welcome and the reply.

Now when I run the application this is the error.

Apache Tomcat/4.0.4 - HTTP Status 404 - /app1099/login.jsp

--------------------------------------------------------------------------------

type Status report

message /app1099/login.jsp

description The requested resource (/app1099/login.jsp) is not available.


Also this application is running from a Unix server that I upload the war files to. So Tomcat is actually on that server.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so Tomcat does start up,just not your app. You might try to hit the URL "/app1099", but if you usually access "/app1099/login.jsp" that's probably not going to make much of a difference.

It's likely that some error message would have found its way into the log files (which are inside the TOMCAT_HOME/logs directory). I'd take a look at those to see if anything jumps out at you.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked at the logs and it seems that some of the old .jar files are trying to be deployed. Is that normal? Should I remove these files from the server and then upload my war file and try again?

Thanks for any help you can provide.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I deleted all of the old files off of the Unix server and left the .war file that I need. The following is the error that came up in the log:

Exception starting filter LoginFilter
java.lang.UnsupportedClassVersionError: com/wwe/apps/app1099/common/util/filters/LoginFilter (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1643)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:937)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1372)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:252)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3077)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3408)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

2008-02-05 13:20:24 StandardContext[/app1099]: Context startup failed due to previous errors

Please help!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow. If it can't handle class file version 48.0 (which is used by Java 1.4), then that's an indication it's using an even earlier JDK (i.e., 1.3).

Which brings me back to the first question: how are you starting Tomcat? The scripts normally used for that select a JDK based on the JAVA_HOME environment variable. What is that set to?
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have only been given the commands needed for shutting down and restarting the service. Our shutdown command is: /opt/local/webusr/jakarta-tomcat-4.0.4/bin/shutdown.sh and the start command is /etc/rc2.d/S96tomcat start

Again, this is on a Unix box.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you execute other commands? What is the result of "echo $JAVA_HOME"? And of "java -version"?
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what I got when I typed in your commands:

bash-2.05$ echo $JAVA_HOME
/usr/j2se
bash-2.05$ java -version
java version "1.3.1_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_04-b02)
Java HotSpot(TM) Client VM (build 1.3.1_04-b02, mixed mode)
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the system is indeed running Java 1.3, while the code needs at least Java 1.4. You mentioned earlier that you installed a different/newer Java version - it looks like you will need to point Tomcat specifically to that new version. One way of doing that would be to set the $JAVA_HOME variable to the directory of the new version. You could test if that works from the command line, but for a more permanent solution you may need to get the sys admin involved.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have other applications running in Tomcat on that server that we don't want to affect with this change. Would it be possible for me to uninstall 1.4.2 and install 1.3.1 and recomplie the program then upload? I know this seems like a lot but they are adament about not changing things on the server.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. I somehow assumed that this was a 3rd-party library, and so hadn't realized that recompiling was an option. That'll only work if the code doesn't use Java 1.4 features, of course. (You don't have to uninstall 1.4 to do this.)

As an aside, while I sympathize with sys admins wanting to keep things stable, Java 1.3 is seriously old stuff, as is Tomcat 4. Those aren't even the latest patch releases by a long shot (1.3.1_16 is the latest, I think, and Tomcat 4.0.6 and 4.1.36).
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tonya Johnson:
We have other applications running in Tomcat on that server that we don't want to affect with this change. Would it be possible for me to uninstall 1.4.2 and install 1.3.1 and recomplie the program then upload? I know this seems like a lot but they are adament about not changing things on the server.


If your code will compile under 1.3, you can also use the version you have but specify that the compiled code needs to be able to run in a 1.3 JVM.
You do this by using the -source switch when compiling.

javac -source 1.3 MyJavaFile.java
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I agree with Ulf.
Those are very old versions of Tomcat and Java.
The folks at Apache do a good job keeping older (major) versions patched but if you don't take advantage of those patches you may not be getting all the important security fixes. A lot has changed in web development since 4.0 and a lot of vulnerabilities have been found and patched (cross site scripting comes to mind but there are others, I'm sure).

4.1.36 is the latest 4x version.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I totally agree with you both but it is not my call. I have tried time and time again to have management agree to an upgrade but I can't seem to get approval.

Because we use NetBeans to compile I am going to reinstall 1.3 and recomplie everything. I will rebuild the .war files and upload them to the server. Hopefully this will work. I really appreciate all of your help and hope that I can write again if this doesn't work. I'll post either way.

Thanks again.
Tonya
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so I went back to 1.3 and pointed everything to 1.3 and now I am getting the original error again:

2008-02-06 11:06:11 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSPerror: Invalid class file format in /opt/local/webusr/jakarta-tomcat-4.0.4/work/Standalone/localhost/app1099/WEB-INF/classes/com/wwe/apps/app1099/common/util/FormsBase.class. The major.minor version '8238.8224' is too recent for this tool to understand.


An error occurred at line: 1 in the jsp file: /code/forms.jsp

Generated servlet error:
/opt/local/webusr/jakarta-tomcat-4.0.4/work/Standalone/localhost/app1099/code/forms$jsp.java:20: Superclass com.wwe.apps.app1099.common.util.FormsBase of class org.apache.jsp.forms$jsp not found.
public class forms$jsp extends com.wwe.apps.app1099.common.util.FormsBase {
^
2 errors

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at com.wwe.apps.app1099.common.util.filters.LoginFilter.doFilter(LoginFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:479)


Any suggestions?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The major.minor version '8238.8224' is too recent for this tool to understand.

That's a bogus error message. Class file versions are in the order of 45 to 50, not 8000. Something else is going wrong. Try cleaning out the /opt/local/webusr/jakarta-tomcat-4.0.4/work/Standalone/localhost/app1099/ directory. Sometimes something gets stuck in there that messes things up. It's safe to just delete its contents.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried clearing out that directory and I am still getting the same error. I don't know what else to do. Can someone else please help?
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried to upgrade the jre on the server to 1.4.2_04 and I compiled the code in that same version. When I put the .war file up on the server I am still getting this error. Is there something else that I should be looking at for this issue?

Please help!!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
So the system is indeed running Java 1.3,...


It's possible that Tomcat, on that machine is configured to use a different JAVA_HOME than what's on the system. One way to be sure is to read the system properties from a JSP.


Drop that in a JSP and run it..
You'll find out exactly what JVM version Tomcat is using.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again,

The powers at be finally decided to upgrade to the latest version of tomcat which was 5.5.26. How do I get the application to now look there versus looking in the 4.0.4 folders for the code?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tonya Johnson:
The powers at be finally decided to upgrade to the latest version of tomcat which was 5.5.26. How do I get the application to now look there versus looking in the 4.0.4 folders for the code?

What do you mean by "look there"? You will need to install the application in the TC 5.5 webapps directory.
 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have uploaded the war file to the webapps folder of Tomcat 5.5.26 but when I run the app it is still pulling from 4.0.4. I'm not sure what needs to change to get it to look at the new folder.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, are you certain that TC 5.5 is running and not TC 4? Or are you running them both on different ports? The root page of the installation tells you which version it is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic