Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 23rd, 2009, 02:01 PM
EndianX EndianX is offline
C# Cultist
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Sterling, VA
Posts: 93 EndianX User rank is Corporal (100 - 500 Reputation Level)EndianX User rank is Corporal (100 - 500 Reputation Level)EndianX User rank is Corporal (100 - 500 Reputation Level)EndianX User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 2 h 9 m 52 sec
Reputation Power: 7
Send a message via AIM to EndianX Send a message via Yahoo to EndianX
Tomcat Java Classes

I am trying to get a simple JSP page working under Tomcat and failing miserably.

Error message:
Code:
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 6 in the generated java file
Only a type can be imported. bll.User resolves to a package

An error occurred at line: 3 in the jsp file: /index.jsp
User cannot be resolved to a type
1: <%@page import="bll.User"%>
2: <%
3: 	User x = new User();
4: 	x.setFirstName("Some");
5: 	x.setLastName("Guy");
6: %>


An error occurred at line: 3 in the jsp file: /index.jsp
User cannot be resolved to a type
1: <%@page import="bll.User"%>
2: <%
3: 	User x = new User();
4: 	x.setFirstName("Some");
5: 	x.setLastName("Guy");
6: %>


Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:616)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.

The JSP page (index.jsp):
Code:
<%@page import="bll.User"%>
<%
	User user = new User();
	user.setFirstName("Some");
	user.setLastName("Guy");
%>
<html>
	<head>
		<title>test</title>
	</head>
	<body>
		<p><%= u.getFullName() %></p>
	</body>
</html>

The User class:
Code:
package bll;

public class User
{
	private String firstName;
	private String lastName;

	public User()
	{
	}

	public String getFirstName()
	{
		return this.firstName;
	}

	public void setFirstName(String value)
	{
		this.firstName = value;
	}

	public String getLastName()
	{
		return this.lastName;
	}

	public void setLastName(String value)
	{
		this.lastName = value;
	}

	public String getFullName()
	{
		return this.getFirstName() + " " + this.getLastName();
	}
}


web.xml:
Code:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
</web-app>

File and directory structure:
Code:
dtucker@dtucker-vm:/usr/share/tomcat6/webapps/test$ ls -lR
.:
total 12
drwxr-xr-x 3 root root 4096 2009-06-23 10:59 classes
-rw-r--r-- 1 root root  207 2009-06-23 13:47 index.jsp
drwxr-xr-x 2 root root 4096 2009-06-23 10:45 WEB-INF

./classes:
total 4
drwxr-xr-x 2 root root 4096 2009-06-23 11:00 bll

./classes/bll:
total 8
-rw-r--r-- 1 root root 788 2009-06-23 13:32 User.class
-rw-r--r-- 1 root root 470 2009-06-23 10:59 User.java

./WEB-INF:
total 4
-rw-r--r-- 1 root root 152 2009-06-23 10:45 web.xml

CLASSPATH and JAVA_HOME:
Code:
dtucker@dtucker-vm:~$ echo $CLASSPATH
/usr/share/tomcat6/webapps/test/classes
dtucker@dtucker-vm:~$ echo $JAVA_HOME
/usr/lib/jvm/java-6-openjdk


Does anybody have any ideas? I can provide any other information that might be needed.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Tomcat Java Classes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT