Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Building and Running a Web Application
Building and Running a Web Application [message #168597] Thu, 04 May 2006 21:13 Go to next message
Eclipse User
Originally posted by: cedmail.comcast.net

Eclipse - Version: 3.1.2 Build id: M20060118-1600
Updated about every week.

OK, I have been trying for two days to get the "Building and Running a Web
Application" to work. I found the bug for the / in the
req.getRequestDispatcher("showBrowser.jsp").forward(req,resp);
but all that did was get me a java.lang.StackOverflowError by just running
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.eclipse.wtp.tutorial.SnoopServlet.doGet(SnoopServlet.jav a:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.eclipse.wtp.tutorial.SnoopServlet.doGet(SnoopServlet.jav a:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

repeatedly..

I copied the code from the tutorial and use
http://localhost:8080/tutorial/snoop/* when I run it from Run From -->
Run from server. I am using jdk1.4.3... and have tried it on both tomcat
5.0 & 5.5 to no avail.

Any help would be appreciated.
Thanks
Calvin
Re: Building and Running a Web Application [message #168689 is a reply to message #168597] Fri, 05 May 2006 15:14 Go to previous messageGo to next message
Eclipse User
Originally posted by: cedmail.comcast.net

I decided to try another example, the SchoolSchedule. I can get the
Schedule.jsp to run if I add Schedule.jsp to the end of the
http://localhost:8080/SchoolSchedule/ which is all that appears in the
link window when I choose Run on Server. When I try to add a class with
the button on the window, I get:

HTTP Status 404 - /SchoolSchedule/Schedule
------------------------------------------------------------ --------------------
type Status report
message /SchoolSchedule/Schedule
description The requested resource (/SchoolSchedule/Schedule) is not
available.
------------------------------------------------------------ --------------------
Apache Tomcat/5.5.17

When I move my code to the webapps directory of Tomcat, the initial window
opens but when I try and add a class I get:

type Exception report

message

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

exception

java.lang.IllegalArgumentException: setAttribute: Non-serializable
attribute
org.apache.catalina.session.StandardSession.setAttribute(Sta ndardSession.java:1251)
org.apache.catalina.session.StandardSessionFacade.setAttribu te(StandardSessionFacade.java:129)
org.eclipse.wtp.sample.classschedule.ScheduleServlet.doPost( ScheduleServlet.java:78)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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

Thanks
Calvin
Re: Building and Running - update [message #168718 is a reply to message #168689] Sat, 06 May 2006 07:24 Go to previous messageGo to next message
Eclipse User
Originally posted by: cedmail.comcast.net

How I managed to get the project to work:

Create new project:
Web --> Dynamic Web Project
Next
Name --> SchoolSchedule
Target runtime --> Apache Tomcat 5.5
(Then finish off remainder of screens using defaults)

Switch to J2EE perspective (Not sure why but I clicked OK)

Files:

Put the .java files in the src folder
Put the Schedule.jsp in the WebContents folder
The .class files will automatically be placed in the build folder
Put the jstl.jar and standard.jar int WEB-INF --> lib folder

All .java files must implement Serializable and have a serialVersionUID

The web.xml file is automatically built and has stuff in it for XDoclet
and I have no idea what that does yet.

Issues still to resolve:
When I run the code using Run AS --> Run on servier or export a .war file
and publish it to my webapps folder I still have to add the /Schedule.jsp
after the http://localhost:8080/SchoolSchedule/
Re: Building and Running - update [message #168816 is a reply to message #168718] Tue, 09 May 2006 12:47 Go to previous messageGo to next message
Eclipse User
Originally posted by: gmatyi.freemail.hu

Hi, I have the same problem. I'd like to build and run "helloworld" web
applications. Does know anybody any place where I can download such project
from and can be build and run well?

Thanks Gabor Matyi

Calvin Deiterich wrote:

> How I managed to get the project to work:
>
> Create new project:
> Web --> Dynamic Web Project
> Next
> Name --> SchoolSchedule
> Target runtime --> Apache Tomcat 5.5
> (Then finish off remainder of screens using defaults)
>
> Switch to J2EE perspective (Not sure why but I clicked OK)
>
> Files:
>
> Put the .java files in the src folder
> Put the Schedule.jsp in the WebContents folder
> The .class files will automatically be placed in the build folder
> Put the jstl.jar and standard.jar int WEB-INF --> lib folder
>
> All .java files must implement Serializable and have a serialVersionUID
>
> The web.xml file is automatically built and has stuff in it for XDoclet
> and I have no idea what that does yet.
>
> Issues still to resolve:
> When I run the code using Run AS --> Run on servier or export a .war file
> and publish it to my webapps folder I still have to add the /Schedule.jsp
> after the http://localhost:8080/SchoolSchedule/
Re: Building and Running - update [message #169295 is a reply to message #168718] Fri, 12 May 2006 12:53 Go to previous message
Chris Gage is currently offline Chris Gage
Messages: 73
Registered: July 2009
Member
Calvin,

Not _all_ java files need to implement Serializable. But servlets do.
And the serialVersionUID is just a warning. Although it's not
recommended to ignore it, you may - the code will still work without it.

You can assign a default jsp to execute, it is also defined in the
web.xml file that is what the <welcome-file-list> stanza is for. If
your initial jsp were called index.jsp it would work out of the box with
the initial web.xml installed with a new web project.

Chris
Previous Topic:Is there plans for another type of EJB wizard than XDoclet?
Next Topic:Stumped by Tomcat startup error
Goto Forum:
  


Current Time: Wed Aug 27 17:22:28 EDT 2014

Powered by FUDForum. Page generated in 0.01677 seconds