tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Collins" <Ch...@ThatOne.com>
Subject RE: Repeat: Can Tomcat be used with non-webapps?
Date Mon, 14 Jun 2004 21:21:05 GMT
David,
I appreciate your attempts to help me, but I am still having the same
issue: my application is not, for whatever reason, using the correct
context(it says the context's name is "").  I am pretty sure I have
exhausted every option I can think of based on what you've told me, the
only thing I might need clarified is what you meant by this line:

	docBase="<doc root on your hd>"

You do mean the directory in which my application is running, correct?
I've tried that and it is still not working correctly.

Has anyone ever tried to use Tomcat with a non-webapp before, and can
offer some tips?

Thank you,
Chris



-----Original Message-----
From: Keene, David [mailto:dkeene@soe.sony.com] 
Sent: Monday, June 14, 2004 1:33 PM
To: Tomcat Users List
Subject: RE: Repeat: Can Tomcat be used with non-webapps?

I haven't read the code for this, so if I'm off anyone out there, feel
free to correct me.  But, that being said, I'm pretty sure this will
answer your questions.

1. tomcat loads *.xml in the conf/localhost/ directory and cats them
together inside the host(localhost) node of your conf/server.xml.  so
basically, by putting a context file in this directory it gets parsed in
the config.

2. It does not matter what you name your context name.  this is just the
name it will show up in the tomcat manager app.

3. yes, if you are going to use a non-standard JNDI Dir for your
resourceloader, you should add a resource element inside this context
tag.  This is not needed in 99% of the installs I've seen.  The default
setup is to just put your apps directory in the docBase attribute and
the FileContextDir will use that as your docbase.**

Dave

** Speaking of FileContextDir!!  I am really looking for someone who has
already made a FileContextDir that can load from more than one DocRoot
(commons directories).  I know there was some talk about this earlier
this year on this list.  If anyone has access to the source for this and
knows its licensing, please let me know!



-----Original Message-----
From: Chris Collins [mailto:Chris@ThatOne.com]
Sent: Monday, June 14, 2004 1:13 PM
To: Tomcat Users List
Subject: RE: Repeat: Can Tomcat be used with non-webapps?

-----Original Message-----
For tomcat 5:
In your <apachedir>/conf/Catalina/localhost/ directory add a
<contextname>.xml file  with the following contents:

<Context path="" docBase="<doc root on your hd>" >
          <Logger className="org.apache.catalina.logger.FileLogger"
                prefix="localhost_log." suffix=".txt"
              	timestamp="true"/>
</Context>
---------------------------


Thank you for your response, Dave, and I apologize for not specifying
ahead of time which version of Tomcat I am using(5.0.24)

Unfortunately I am still a little confused.  How is my application
supposed to know to specifically use context <contextname>?  In the
tests I've done after reading your e-mail and following its
instructions, the context being initialized still has name "", and
naturally it fails to look up a data source when told to do so.  I've
tried my best to boil this down into the few most-relevant questions
that I can think of:

1. Should Tomcat automatically know to use the context I just created
based only on the empty path that I supplied in its XML file?  Do I have
to explicitly specify somewhere that my application should use this
particular context?

2. Does it matter what I choose for <contextname>?  Does it have to be
the name of the application?

3. Should I add the context's associated datasource(<resource.../>) in
<contextname>.xml or somewhere in server.xml (or somewhere else)?

Again, all responses are greatly appreciated, Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message