Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deploy servlet head foot book p. 31

 
timo corn
Ranch Hand
Posts: 68
MyEclipse IDE PHP Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried the example and get the following error:
type Status report

message /ch1/Serv1

description The requested resource is not available.

This is my webxml in the Tomcat Web-Inf dir.:


I have a ch1Servlet.class file in the Tomcat webApps ch1 webinf classes folder:


I am running another servlet site in eclipse, which works. The eclipse files are in my eclipse workspace, but not in the tomcat folder. I thought that eclipse copies automatic the files to Tomcat (Webxml and servlet classes)?

Maybe something is wrong with Tomcat folder?

The servlet from chapter 1 of the book runs on port 8080?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I invariably advise beginners not to use the Eclipse/Tomcat integration, but instead to run Tomcat as a standalone server. Many issues that tend to confuse beginners (like the ones you describe) can be avoided that way.
 
Ishan Pandya
Ranch Hand
Posts: 226
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addtion to what Ulf said,

Your servlet is in default package. You may find a better description of this in Servlet FAQ's.
 
timo corn
Ranch Hand
Posts: 68
MyEclipse IDE PHP Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The eclipse Tomcat is stopped, so there should be no conflicts with my tomcat web app without ide (--> core webapp).
I again enclose the web.xml:


When I start tomcat, I get the following message:SEVERE: Parse error in application web.xml file at jndi:/localhost/ch1/WEB-INF/w
eb.xml... ch1 startup failed

When I copy the web.xml to eclipse and try to save: Error-Character encoding 8851 - 1 is not supported.
In my editor, I use ANSI.

If i switch tu Ansi as Utf8, I get the same parse error, but server startup.

There is one exception java.io.UnsupportedEncodingException: ISO-8851-1
at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:71)
at java.io.InputStreamReader.<init>(InputStreamReader.java:100)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.createReader
.....
these are all methods? They seem all related to xml ? InputStreamReader is a class, but there is <init> which seems a method?

I have to delete these errors before continuing? My goal is to start the web app ch1 with Servlet serv1
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2278
81
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this thread.

Regards,
Frits
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic