Results 1 to 8 of 8
Thread: jdk jre tomcat conflict
- 09-28-2009, 06:27 AM #1
Member
- Join Date
- Dec 2008
- Posts
- 50
- Rep Power
- 0
jdk jre tomcat conflict
Hi i am running eclipse and i have built a servlet (hello world ) which runs fine on the tomcat version that i have on my laptop
apache-tomcat-6.0.18...
i am running sdk 1.6 and jre 1.6
when i add the servlet to the appropriate place on my online account i get the following error..
i have found out that the problem is that the web hosting site is running jdk 1.5Java Code:java.lang.UnsupportedClassVersionError: Bad version number in .class file
and apache 5.0.2.7
both older versions
so i recompiled in eclipse using jdk 1.5
and set the jre to 1.5.05
but when i lodge the servlet online i still get the same error which indicates..
that the web hosting has an earlier version of java than the one i am compiling in ???
any suggestions would be greatly appreciated
- 09-28-2009, 07:42 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Contact your site and ask them what the correct version should be. No need to guess it.
- 09-28-2009, 09:29 AM #3
Member
- Join Date
- Dec 2008
- Posts
- 50
- Rep Power
- 0
thanks for the response .. they told me
jdk 1.5
jre 1.4.2.07 or older
jre 1.5.0_02 or older were supported
so i tried compiling down to 1.4 standard and using the jre 1.4.2_07 ...
still no joy same error...
the only other thing that i can think of is the servlet jar that i have on the build path ...
javax.servlet_2.5.0v200806031605.jar...
is it possible that there is a conflict here ??
thanks
- 09-28-2009, 10:44 AM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You should not have any servlet API jars on your class path. The server has it's own.
- 09-29-2009, 01:34 AM #5
Member
- Join Date
- Dec 2008
- Posts
- 50
- Rep Power
- 0
thanks for the response
this is getting tricky....
ok so i downloaded the servlet ide for eclipse and rebuilt my helloWorld servlet..
to their specs jdk 1.5 ....... however, using this ide it links to my version of apache tomcat which is v 6....
now if eclipse is linking to that,,,. and that's where the call to the javax.servlet
library is being called . there is still going to be a potential problem...
i reloaded the page on my hosting and its not throwing any errors but unfortunately its also not displaying anything ??? ( when i go to view source code of the html) it shows nothing...
so the only last thing i can think of doing is trying to get a copy of the older version of tomcat and install it on my system...
link that to eclipse and then the class will be calling the right versions of the libraries ?
the only place i could find it was
apache ---->archive.apache.org/dist/tomcat/tomcat-5/archive/v5.0.27/]Index of /dist/tomcat/tomcat-5/archive/v5.0.27<----
but im not sure what to do with these files...
any help would be appreciated
- 09-29-2009, 08:17 AM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Did you check the error logs to see what the problem was when nothing was being displayed?
You also need to understand that JDK version != Servlet API version.
- 09-29-2009, 08:34 AM #7
Member
- Join Date
- Dec 2008
- Posts
- 50
- Rep Power
- 0
yes thanks i understand that ( now... reading installing tomcat v5 ->6 ,jdk..)
as i understand it the servlet api comes from the tomcat server ??
time to fess up though and ouch ( see above postings )...
just checked the url and the page loaded... sigh ...
thanks for everyone who contributed... that was quite the journey...
and at least now i gota pretty good idea what tomcat is about :)
sorry for the stupidity
- 09-29-2009, 08:44 AM #8
Member
- Join Date
- Dec 2008
- Posts
- 50
- Rep Power
- 0
and just for others who have this problem this is what i actually did....
i got exactly the same version of apache tomcat v 5.0.2.7 from
Index of /dist/tomcat
i had no idea what i was doing but i re assembled all of the files into the same folder structure and order as my correctly installed and working apache tomcat v6 .... got it run from the command line .. testing with localhost:8080 etc..
i then linked my version of eclipse to the old version v 5.0.2.7 and lowered the compilation from 1.5 to 1.4
i then rebuilt the servlets
transferred the new class files and web.xml docs to the host sites WEB-INF folder and viola ....
after 6 hrs the server reloaded and all was well :)
hope this helps someone
Similar Threads
-
Help with TOMCAT
By necroninja in forum Advanced JavaReplies: 0Last Post: 08-04-2009, 09:52 PM -
[SOLVED] Windows Linux conflict - TrayIcon image not display in Linux
By Eranga in forum Advanced JavaReplies: 6Last Post: 04-08-2009, 04:05 AM -
About Tomcat
By sindhuri in forum JavaServer Pages (JSP) and JSTLReplies: 21Last Post: 04-25-2008, 10:13 AM -
Tomcat In Eclipse - Sysdeo Tomcat Plug-in
By JavaForums in forum EclipseReplies: 1Last Post: 02-13-2008, 10:33 AM -
tomcat xml
By Ed in forum XMLReplies: 2Last Post: 07-04-2007, 05:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks