tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject How to compile a servlet for Tomcat 5 on IBM JVM
Date Sun, 21 Dec 2008 22:28:49 GMT
Hi.

I just knew it wouldn't be that simple...
Kind of as a follow-up to earliers posts on "Hello World" servlets and 
IBM JDK 1.5, here is the issue :

I have created (ok, copied from Chuck would be more exact) a tiny weeny 
little servlet. It's about 15 lines including comments.
On my Windows PC, where I have a Sun JDK 1.6 and Tomcat 5.5 installed, 
the servlet compiles fine, with the following command :

javac -classpath 
%CLASSPATH%;C:\java6jdk\lib\tools.jar;C:\java6jdk\jre\lib\jsse.jar;C:\Tomcat5.5\common\lib\servlet-api.jar;C:\Tomcat5.5\common\lib\commons-el.jar

%1

Then I move the resulting servlet class to the server where it is 
supposed to run, which has a Tomcat 5.0.x running under an IDM JDK 1.5.

When I call this servlet, I get an error in the tomcat logfile, saying 
essentially that it cannot load this servlet, because the major version 
doesn't match (I guess it means Java's).

"No problema ! Piece o'cake ! I'll just move the source of my servlet to 
the target machine and compile it there with the IBM javac and the 
Tomcat5 libraries", says me.

Well, that gives these errors when compiling :

DumpUser.java:6: package javax.servlet does not exist
import javax.servlet.ServletException;
                      ^
DumpUser.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
                           ^
DumpUser.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;

etc... (about 8 of them above-like messages).

I am not familiar with this kind of exercise, and I have no idea if and 
where IBM or Suse hide the packages and classes needed.
And anyone who has seen the link soup on a SEL 10 system with Tomcat 5 
and IBM Java, throw me the first stone.
And in my naiveté, I thought Java apps were portable !

I looked on the IBM website, to see if I could download an IBM JDK 1.5 
and compile the servlet with it on my PC.
Well, it seems that for that one needs to register and whatnot 
beforehand, and then you get something for Eclipse (which I don't need 
nor have).

So now, what's the recommendation, apart from in that order
- nuking the Tomcat 5.0
- nuking the IBM Java 1.5
- nuking the server (*)
- throwing my laptop out the window (**)
and re-installing everything from scratch, using a nice clean Sun Java 
1.6 JDK, and a true and official Tomcat 5.5 (at least) from the official 
and approved Tomcat site ?
Or just forget about Tomcat and Java altogether, and rewrite this 
application in Pure Perl ?

The re-install-clean-versions above option is at the moment not my 
preferred one, because I have to do it on 4 servers then, and afterward 
take responsibility for maintaining these Tomcats.  While right now the 
quadruplets are in someone else's care.

So, for instance, if I were to re-install a Sun Java 1.5 JDK on my 
laptop, and re-compile with it, would that solve the above issue(z) ?


(*) it's ok, its in another country and the wind blows the other way
(**) it's ok too, it's a very low window and my laptop is supposed to be 
shock-proof; so that would be mainly for the show effect on my co-workers.

TIA for any helpful hints.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message