aspose file tools*
The moose likes Servlets and the fly likes Tomcat can't find java.util.List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat can Watch "Tomcat can New topic
Author

Tomcat can't find java.util.List

Jonathan Whitehead
Greenhorn

Joined: Jun 13, 2001
Posts: 10
Hi all
Suddenly when I view my JSP page in TOMCAT, it says it can't find various classes which I think are built into Java (in rt.jar maybe).
I put "echo %JAVA_HOME%" in the Tomcat startup script and it says "C:\jdk1.3" like I expected. I don't have any problems using this installation of JDK in other contexts e.g. compiling with Forte.
Any ideas of where I might investigate further?
Thanks
Jonathan
org.apache.jasper.JasperException: No se puede compilar la clase para JSP
C:\Archivos de programa\jakarta-tomcat-3.2\work\localhost_8080%2Ftelenet\_0002fhome_0002ejsphome_jsp_52.java:166: Class java.util.List not found in type declaration.
java.util.List courseList = myCourses.getRegisteredCourses();
^
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

They are built into java, but you must still import them. The only packages that java automatically imports are java.lang.* (and I think another one?).

So at the top of your JSP you must do this:Notice the syntax for multiple imports (comma separated)
Jonathan Whitehead
Greenhorn

Joined: Jun 13, 2001
Posts: 10
Thanks Mike, but that isn't it. I was already importing java.util.*, now, to remove that doubt I'm using the fully qualified name java.util.List in the JSP code fragment so that the import is not necessary (but I still have it).
<%@page import="com.telenet_platform.ltc.course.*,java.util.*" %>
<% java.util.List courseList = myCourses.getRegisteredCourses(); %>
org.apache.jasper.JasperException: No se puede compilar la clase para JSP
Class java.util.List not found in type declaration
J
Jonathan Whitehead
Greenhorn

Joined: Jun 13, 2001
Posts: 10
I might add that the same code worked two days ago, so my assumption is that something else has changed
jay Rotti
Greenhorn

Joined: Apr 05, 2001
Posts: 9
Hi,
I feel this is because of JDK version. Above Jdk1.2 support java.util.List. By any chance if you have installed earlier version then make sure you have jdk1.2 or above. This is same for NT as well as Unix platforms.
On solaris you have more problems based on which version of solaris and JDK you are using.
if you install jdk1.2 or above on Solaris 2.6 then you need to down load some patch from sun and install on solaris then it works fine.
I thought what i faced may solve some problem,if above situation is not yours ignore this.
Thanks
Jay
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat can't find java.util.List