Win a copy of Head First Android this week in the Android forum!

Jaime Lannister

Greenhorn
+ Follow
since Mar 30, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jaime Lannister

Something I forgot to mention. I searched for anything called "jsp.class" or "jsp.java" using the find command, but found nothing. I did find several files called "jsp.*" or "*jsp.*" with different beginnings and endings, such as several "jsp.vim" files and a few "jsptoservlet.jsp" files. Still, doesn't the error message imply that the offending servlet is there, but something has gone wrong in loading it???
16 years ago
Thanks Ben and Ulf, your suggestions and explanations worked.
16 years ago
Got back to working on Tomcat again after several day's haitus. The last problem is gone but now Tomcat is encountering a new one: On startup,
Tomcat seems to successfully go through the first part of its starup routine - it deploys the JAR files in its own WEB-INF/library directory to my site's library directory, then it starts following the script in the web.xml file in its own directory, and successfully loads something called container servlet default and container servlet invoker. Then it gets hung up trying to load the JSP servlet. I get the following error message in the error log:

StandardWrapper[:jsp]: Marking servlet jsp as unavailable
StandardContext[]: Servlet threw load() exception: javax.servlet.ServletException: Error instantiating servlet class org.apache.jasper.servlet.JspServlet
javax.servlet.ServletException: Error instantiating servlet class org.apache.jasper.servlet.JspServlet

The script in the web.xml file related to this is:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>WARNING</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

The comment lines above it state:

"The JSP page compiler and execution servlet, which is the mechanism used by Tomcat to support JSP pages. Traditionally, this servlet is mapped to URL patterh "*.jsp". This servlet supports the following initialization parameters (default values are in square brackets:"
Then it goes on to give a bunch of initialization parameters.

I have not been able to find any answers to the same problem using Google, etc. There was one post on this site at https://coderanch.com/t/81863/Tomcat/WEB-INF-breaking-Context-root
where someone prevented a similar load error by removing another file called servlet.jar (or preventing it from being deployed) in
his web.xml file. But that error wasn't occuring on startup.

For what it's worth I'm running Tomcat 4 on Linux.
16 years ago
Thanks for your suggestion. I have two web.xml files. One is in the Tomcat home directory in Tomcat4/conf/. This file was installed by the web host with Tomcat and has not been changed since to my knowlege. It does not have a listener entry.

The other one is in my site directory under /var/www/html/WEB-INF/. It is an example web.xml file that I copied into that directory and to which I added <servlet> references to the servlets I want to test. It does have listener entry:
<!-- Define example application events listeners -->
<listener>
<listener-class>listeners.ContextListener</listener-class>
</listener>
<listener>
<listener-class>listeners.SessionListener</listener-class>
</listener>

I'm looking into this further. I take it there should be a listener defined in the Tomcat directory web.xml too?
16 years ago
When I start Tomcat, I get the following two error statements within cataline.out:

StandardContext[]: Error configuring application listener of class listeners.ContextListener: java.lang.ClassNotFoundException: listeners.ContextListener java.lang.ClassNotFoundException: listeners.ContextListener

Then it goes through a list of statements like:
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3155)
.
.
. etc.etc. through 18 statements like that (I presume its looking for the missing thing it can't find)

Then it prints the other error statement:
StandardContext[]: Error configuring application listener of class listeners.SessionListener: java.lang.ClassNotFoundException: listeners.SessionListener
java.lang.ClassNotFoundException: listeners.SessionListener

and another bunch of statements like:
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3155)
.
.
.
etc. etc.

Then finally it says that it skipped installing application listeners and that the context startup failed due to those errors.

Anyone know what those "application listeners" in the error statements are and possible reasons why why Tomcat might not be able to configure them? I can print out the whole Cataline.out file if anyone wants to see it.
16 years ago
See my response to your similar question in my last post.

"mydomainame" currently is registered to (or whatever you call it) another server with another numerical (XX.X.XXX.XXX) address at the same web host. When you type in http://mydomainame/, you get the first page of my website, which is currently sitting on that other server. The other server is a shared server that, among other things, does not support Tomcat or Java servlets.

Thus I have rented a new dedicated server, but do not want to transfer the website over to it until I get certain things working properly on it. This new server has a different address (YY.Y.YYY.YYY), and a test version of the website exists as a virtual site on it. If you type in http://YY.Y.YYY.YYY/mydomainame, you get sent down to the test copy of the first web page.

A program called "Ensim" takes care of setting this up. Ensim is a site admin program with a GUI interface that lets you do things like set up new sites, start and stop Apache and other programs, etc. You create a site by
typing info into fields and it automcatically sets up the right directory structure in the right place, and directs things to it. I believe that this
all done by automatically adding info to files that are appended (via include statements?) to Apache's configuration files, but I don't know the ins and outs of it yet.

My question still is, ASSUMING for now that /myURLnumber/mydomainame is the correct syntax to use, what goes in the other parts of the <host> statement -

name = "______________"
appbase="_____________"
Context path="_______________"
docBase="________________"

Thanks.
16 years ago
Well, I think I have either the right syntax or very close to the right syntax in my Tomcat Server.xml host section. Based on what the Catalina.out file is saying, Tomcat seems to be recognizing where the webapp that contains my Java servlets is located. It says it is "deploying" all of the .jar files in its own default directory library to the WEB-INF/lib directory in my site directory. However, things still aren't working (Apache doesn't seem to recognize that "/servlet/" means "send this request over to Tomcat!" instead of a directory named "/servlet" and is not calling on Tomcat.) I am hoping that someone can verify that I have everything right in the <host> section of servlet.xml before I go look at Apache's files:

The relevant information for my server and the test site I am running on it is:
I am using a dedicated server set up by my web host (which doesn't provide tech support related to Tomcat or Apache).
I am running Tomcat 4.06 with Apache 2.0.(X) under Linux.
I am trying to get Tomcat to handle servlets.
My domain name is registered, but not yet assigned to the URL number of the server, so I have to type in http://myURLnumber/mydomainname.com/ to access the site. I apparently have to use the same within the server.xml file, at least, it seems to work.
The complete pathname to my site, which is a name based virtual site, is /home/virtual/site1/fst/var/www/html
Within that directory are all the elements that are considered a "web application" including all my html files, a web.xml file, and a WEB-INF folder which contains lib, jsp,and classes folders (the servlet class fiels are in the latter).

This is what I currently have in this <host> section of the server.xml NOTE: If there are any "<" and ">" tags missing it's because I had to take them out - this bulletin board rejects messages with certain html or javascript in it.

<Host name="myURLnumber/mydomainname" appbase="/home/virtual/site1/fst/">
<Context path="myURLnumber/mydomainname" docBase="/home/virtual/site1/fst/var/www/html" />
</host>

Is this right? If not, can someone please fill in the blanks, given the path to the webapp given above?

name = "______________"
appbase="_____________"
Context path="_______________"
docBase="________________"

I've read the Tocmat documentation and several other explanations of this and I'm still not absolutely certain what is supposed to go in each part.
16 years ago
"/myURLnumber/mydomainame" is what I have to type in the browser to get to my dedicated server. The reason for that is that "mydomainame" is not yet registered with that server. "Mydomainame" is currently registered with a different, shared server (which doesn't support Tomcat, Java, etc.), which is where my active site currently resides. I don't want to change the registration until I have everything working properly on, and everything transferred to, the new serever.
16 years ago
Re: The Host name - in the first line of the host element,

Host name="_________" appbase="__________"

(Again, I've taken out the "<" ">" symbols because the software running this bulletin board likes to reject things with html tags).

Is the name supposed to be "/myURLnumber/mydomainame"?
If so, what is the Context path=______ supposed to be on the next line?

Re: Apache not calling Tomcat - That may be the case, and I'm trying to find out why. Tomcat's error logs in Catalina.out don't report on anything other than the fact that I turned Tomcat off and on again. I noticed that and the statements in Apache error logs before, and thought maybe the fact that the Tomcat server.xml and web.xml files weren't set up to do anyting with my webbb app were causing it to ignore Apche's requests or something. Anyone have any ideas?
16 years ago
After reading more explanations and documentation about what to put in the server.xml file, and the answer to my last post below (see "Confused on a higher plane - Tomcat"), I STILL can't seem to make head nor tail of specifically what goes where in the <host> section of the server.xml file.

The relevant facts about my site are:
I am running on a dedicated server set up by my web host (which doesn't provide tech support related to Tomcat or Apache).
I am running Tomcat 4.06 with Apache 2.0.(X) under Linux.
I am trying to get Tomcat to handle servlets.
My domain name is registered, but not yet assigned to the URL number of the server, so I have to type in http://myURLnumber/mydomainname/ to access the site (don't know if this effects anyting in server.xml or not).
The complete pathname to my site, which is a name based virtual site, is /home/virtual/site1/fst/var/www/html
Within that directory are, as a far as I know, all the elements that are considered a "web application" including all my html files, a web.xml file, and a WEB-INF folder which contains lib,jsp,and classes folders (the servlet class fiels are in the latter).

Based on my uncertain understanding of various documentation and tutorials, this is what I put in the <host> sections of the server.xml file. NOTE: I took the tag "<" and ">" marks out so that this bb doesn't reject my post for fear of accepting evil html and javascript stuff.


Host name="defaultHost" appbase="/var/www/html"
Context path="" docBase="" /
/Host

Host name="mysite" appbase="/home/virtual/site1/fst/var/www/html"
Context path="myURLnumber/mydomainname" docBase="/home/virtual/site1/fst/var/www/html" /
/host

The first host - /host section was there already, it was my understanding that this had to stay there to define a default host for Tomcat to try in the absence of anything else (there is another webapp directory structure there in /var/www/html with a default placemarker html page in it, put there by the web host).

The second host - /host section is my attempt to tell Tomcat where I want it
to go to get the servlets. I also tried Context path="/mydomainname" (left off the URL number) and a few other minor variations with no luck. I am trying to get a helloworld servlet by typing in http://myURLnumber/mydomainname/servlet/helloworld

The web.xml file seems to be set up OK, the helloworld servlet is listed in there and I am using the correct name for it.

All I get are error messages in the browser that say:
The requested URL /~admin1/servlet/HelloWorldExample was not found on this server.

The Apache logs read "File does not exist: /home/virtual/site1/fst/var/www/html/servlet

What am I getting wrong?
16 years ago
I've been reading several online explanations about how to handle the server.xml file for Tomcat, and am still not sure what I'm supposed to put where in certain places.

I am using Tomcat 4.06 with Linux. To get to my site I type in http://myURLnumber/mydomainame/ (the domain is registered but isn't assigned to the new URL yet on the new server yet, hence the need to type in the URLnumber first).

The site is a name based virtual site with all the files stored under /home/virtual/site1/fst/var/www/html

The web host has apparently installed a server.xml file with all the right stuff in it except for some "fill in" parts where it says to replace things like "defaulthost" with your host name.

Right now in the "Engine" section it has the statement defaulthost = "defaulthost"
in the "Host" section is has the statements name="defaulthost", context path ="", and docBase="" I'm sorry that I couldn't just copy the section in, but this bulletin board thinks its some sort of evil code or javascript even when I take the tags out, and won't let me post it.

Anyway, I'm pretty sure that I'm supposed to replace "defaulthost" with
"mydomainame", or else "myURLnumber/mydomainame"?

From what I've read, context path may be "/", but I'm not sure, and I don't know what docBase should be. Anyone have a clue?
16 years ago
Ignore - test post testing for problem at my end.
16 years ago
It looks to me like the server.xml file is to blame. It supposedly had the right info in it, but it doesn't. See my next post above, titled "confused on a higher plane" if you're interested.
16 years ago
Whenever I start up Tomcat I get an error message amongst many other lines
of startup stuff that says: "ContextConfig[]: Missing application web.xml, using defaults only". Trouble is I HAVE a web.xml file in the WEB-INF folder within the catalina_home tree at catalina_home/webapps/ROOT/WEB-INBF. I have another one in the WEB-INF folder under the virtual name based site that I am trying to get Tomcat to handle servlets for. What could be causing tomcat not to find a web.xml file in the WEB-INF folder??? I am using Tomcat 4.06 running on Linux.
16 years ago
I'm trying to get Tomcat to work with Apache to handle servlets, and I want to look at the Tomcat error log. Is Catalina.out (the only thing in my log folder) a general error log? So far all it does is print stuff when I turn Tomcat off and on. If there there is another error log, what is it called and where is it likely to be? Thanks in advance.
16 years ago