Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I did a search, but apparently this has never happened before:

 
Victor Flores
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a search, but apparently this has never happened before:
I am doing the head first jsp and servlets book
chapter 3, the mini-mvc tutorial

i am at the point where i test my servlet, BeerSelect

My browser looks good at
http://localhost:8080/Beer-v1/form.html

I get the beer selection page,
i can even pick a color.
When i pick brown (or any color), then click 'submit query',
nothing happens!


it says there, on page 81, that i should get something like
'beer selection advice' 'got beer color brown'

but in fact, nothing happens.

I've double checked all my stuff, and everything seems to be in the
right places. i got this far, didnt i?

I stop and start tomcat.

this is what the logs tell me, is this a bad thing?

the log is c:\tomcat\logs\localhost.2006-03-27

here it is,

Mar 27, 2006 5:09:37 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class listeners.ContextListener
java.lang.ClassFormatError: Extra bytes at the end of class file listeners/ContextListener


any clues?
 
Victor Flores
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, the book keeps saying to start tomcat like this:
cd tomcat
bin/startup.sh


i do not have a file called startup.sh
i am on windows xp.
i downloaded and reinstalled tomcat a bunch of times, till i realized
that the sh files must be for another os.

i am in xp, all i have to do is start and stop from here:
C:\tomcat\bin\tomcat5w.exe

i know my stop/start works, because when i stop it, i dont get the
'beer selection' page in my browser, and when i start it, then
i do get my beer selection page.
My problem seems to be that i am just not invoking the servlet
at all!
 
Lalitha Vydyula
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May bethis will help you.
 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem has, in fact, been reported and discussed on this very forum in the apache/tomcat section. Here is the link http://www.coderanch.com/t/84426/Tomcat/Error-configuring-application-listener-class

(I just googled the error and got that page as the first response)
 
Victor Flores
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Lalitha and Emanuel, i have tried everything in your links,
and still my problem is not fixed. I will keep trying and post back
when i figure it out (IF i figure it out).

I think my problem can now be summarized as follows:

i have installed Apache Tomcat/5.5.16
i point my browser to http://localhost:8080/, which works fine: it
brings me to the tomcat home page.

The page has a link on the left side to 'JSP Examples'
If i click on it, i get this:
===========================================================================
HTTP Status 404 - /jsp-examples/
description The requested resource (/jsp-examples/) is not available.
===========================================================================

I dont think i am missing anything in my install,
in fact i see a bunch of directories under:
c:\tomcat\webapps\jsp-examples

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the logs in the tomcat/logs directory.
If you've been trying for a while, they could be long.
You might want to: stop tomcat, delete all the logs from that directory, restart, and try hitting it again. Then look at the logs for a stack trace that might point you to the error.
 
Victor Flores
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i stopped the tomcat service
i deleted all the logs
i restarted the tomcat service
these are the first 5 lines of the 'localhost' log (it goes downhill from here)

Mar 29, 2006 10:02:10 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain:

[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com],

[org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue /

Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:

http://jakarta.apache.org]]
Mar 29, 2006 10:02:10 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class listeners.ContextListener
java.lang.ClassFormatError: Extra bytes at the end of class file listeners/ContextListener

 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I googled the second line of your error and got this interesting tidbit:
http://www.nabble.com/tomcat-examples-t1307951.html

According to some people responding to the above, the 5.5.16 executable release is broken. Try the zip installation or an earlier version.
 
Victor Flores
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. THAT WORKED!

I guess there is a problem with the tomcat 5.1.16 binary distribution Windows executable, which is in fact the install i had done numerous times!

I did the zip instead, and now i can see the examples, click on them.
they appear to be working.

Thank you emanuel for pointing that link. I swear it wasnt there just the other day. It is a pretty recent event.

 
Victor Flores
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
============================================================
ok, now i can do click the examples, and that's fine....
but that's not what i wanted to do. (i even played "guess what
number")

What i really want to do, is just the first example in the
book, and i cant do it!

example from hf servlets & jsp, page 31
i should type http://localhost:8080/Ch1/Serv1

and what i get is this:
=============================================================
HTTP Status 404 - /Ch1/Serv1
The requested resource (/Ch1/Serv1) is not available.
Apache Tomcat/5.5.16
=============================================================

i have web.xml in
c:\tomcat\webapps\ch1\WEB-INF

and i have Ch1Servlet.class in
c:\tomcat\webapps\ch1\WEB-INF\classes

i have stopped and started tomcat


When i look at the logs, i can see that as soon as i start tomcat,
i get this error logged in the catalina log:

Mar 29, 2006 4:38:24 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 1 column 14: Element type "web-appxmlns" must be followed by either attribute specifications, ">" or "/>".
org.xml.sax.SAXParseException: Element type "web-appxmlns" must be followed by either attribute specifications, ">" or "/>".



What is that?


i did a google on "Element type web-appxmlns"
and i get nothing....(what do you call that???when you google something
and you get ABSOLUTELY NOTHING?)


 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MSN search quite better, it gives some results:
http://search.msn.com/results.aspx?q=Element+type+web-appxmlns&locale=en-us&FORM=I7AW
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic