Hi Jonathan,

First of all understand that I am not as expert as some on the list but I learn reasonably well by example. Yes, you can put context's where ever you like (as far as I know). I have locations defined in my current setup.

I notice that you ended the context statement with a "/>" does this mean that you have removed the logger statement & all the rest of the stuff that is there by default (including the closing </context>)? I ask this because you seemed to be trying to re-define the root context (and maybe that is the problem). If that is not the case maybe you need to set the path to something sensible ("C:/" ain't).

So to answer to http://localhost:8080/my-context maybe do something like:

<Context path="/my-context" docBase="C:/Projects/calendar/htdocs" debug="0" reloadable="true"/>

If you are trying to change where http://localhost:8080/ would look for content then maybe you want to change the <host> appbase? I've not tried doing that (yet) but the server.xml seems to indicate that it is possible.

Mike


Jonathan Zhang wrote:

I tried that, and a couple of other variations like
<Context path="C:/" docbase="Projects/calendar/htdocs" debug="0"/>
but it still gave me the same nullPointer exception.why?
thanks for the help

----- Original Message -----
From: "M. Hockings" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 4:13 PM
Subject: Re: adding context



Try using forward slashes for the directory delimiter?

<Context path="" docbase="c:/Projects/calendar/htdocs" debug="0"/>

Mike


Jonathan Zhang wrote:


hi Guys,
I'm running tomcat 4.x on windows xp and I'm trying to add a context to
<Context path="" docbase="c:\Projects\calendar\htdocs" debug="0"/>

I get the following exception:

Starting service Tomcat-Standalone
Apache Tomcat/4.1.12
java.lang.NullPointerException
at java.io.File.<init>(File.java:180)
at

org.apache.catalina.core.StandardContext.getBasePath(StandardContext.

java:3833)
at

org.apache.catalina.core.StandardContext.start(StandardContext.java:3

397)
at

org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

at

org.apache.catalina.core.StandardHost.start(StandardHost.java:738)

at

org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

at

org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347

)
at

org.apache.catalina.core.StandardService.start(StandardService.java:4

97)
at

org.apache.catalina.core.StandardServer.start(StandardServer.java:218

9)
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at

org.apache.catalina.startup.Catalina.execute(Catalina.java:400)

at

org.apache.catalina.startup.Catalina.process(Catalina.java:180)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

thanks for the help




--

Note new email address -> [EMAIL PROTECTED] <-

Mike's Page : http://www.hockings.net/~mike
Rifle Shooting in Ontario : http://www.hockings.net/rso/
Scarborough Rifle Club : http://www.hockings.net/rso/src/
Canadian Shooting Sports : http://www.CdnShootingSports.org
Ontario Rifle Association : http://www.OntarioRifleAssociation.org




--
To unsubscribe, e-mail:

<mailto:tomcat-user-unsubscribe@;jakarta.apache.org>

For additional commands, e-mail:

<mailto:tomcat-user-help@;jakarta.apache.org>



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


--

Note new email address -> [EMAIL PROTECTED] <-

Mike's Page               :  http://www.hockings.net/~mike
Rifle Shooting in Ontario :  http://www.hockings.net/rso/
Scarborough Rifle Club    :  http://www.hockings.net/rso/src/
Canadian Shooting Sports  :  http://www.CdnShootingSports.org
Ontario Rifle Association :  http://www.OntarioRifleAssociation.org


Reply via email to