This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes I did a search, but apparently this has never happened before: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "I did a search, but apparently this has never happened before:" Watch "I did a search, but apparently this has never happened before:" New topic
Author

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

Victor Flores
Greenhorn

Joined: Mar 27, 2006
Posts: 6
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

Joined: Mar 27, 2006
Posts: 6
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

Joined: Jul 20, 2005
Posts: 69
May bethis will help you.
Emanuel Kadziela
Ranch Hand

Joined: Mar 24, 2005
Posts: 186
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

Joined: Mar 27, 2006
Posts: 6
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Victor Flores
Greenhorn

Joined: Mar 27, 2006
Posts: 6
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

Joined: Mar 24, 2005
Posts: 186
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

Joined: Mar 27, 2006
Posts: 6
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

Joined: Mar 27, 2006
Posts: 6
============================================================
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

Joined: Oct 09, 2002
Posts: 294
MSN search quite better, it gives some results:
http://search.msn.com/results.aspx?q=Element+type+web-appxmlns&locale=en-us&FORM=I7AW


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
 
 
subject: I did a search, but apparently this has never happened before: