Mark,

I think I understand what you are saying about path and docBase being
invalid in my setup (per docs, they should not be set in context.xml,
which is not the same as setting them to empty), however even with
these changes, the outcome is exactly the same.

I even added override="false" thinking that maybe something gets
derived from default host.

I also tried setting defaultHost to my app hostname to no avail.

New cleaned up context:

<Context cachingAllowed="false" cookies="true" displayName="Example"
reloadable="true" swallowOutput="true" override="false">

        <Resource name="jdbc/exampleDS" ... unchanged ... />

</Context>


Is anyone running a ROOT webapp with subdirectories under a virtual
host in Tomcat 6.0.x successfully and is willing to share
configuration details?


TIA,

Ed



On Sat, Mar 14, 2009 at 3:24 PM, Mark Thomas <ma...@apache.org> wrote:
> Gmail User wrote:
>> Mark,
>>
>> The server.xml is 6.0.18 distribution version. I added host to it
>> (host name changed for privacy):
>>
>> <Host name="example.com" appBase="/var/webapps/example.com"
>> unpackWARs="false" path="" autoDeploy="false" xmlValidation="false"
>> xmlNamespaceAware="false">
>
> Path is not a valid attribute for a host element. That should not be
> affecting you though.
>
>>       <Alias>www.example.com</Alias>
>> </Host>
>>
>>
>> The corresponding /var/webapps/example.com/ROOT/META-INF/context.xml
>> was copied over from the original 5.5.15 server.xml that still works:
> Generally copying config from one major version to another is a bad
> idea. It is usually better to start afresh and add when you need.
>
>> <Context className="org.apache.catalina.core.StandardContext"
>> cachingAllowed="false"
>> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>> cookies="true" crossContext="false" debug="0" displayName="Example"
>> docBase="" mapperClass="org.apache.catalina.core.StandardContextMapper"
>> path="" privileged="false" reloadable="true" swallowOutput="true"
>> useNaming="true"
>> wrapperClass="org.apache.catalina.core.StandardWrapper">
>
> Lots of defaults in there you don't need. It could be a lot simpler.
> Neither docBase nor path are valid in a context.xml file. This may be
> the cause of the issue you are seeing.
>
> Mark
>
>>       <Manager className="org.apache.catalina.session.StandardManager"
>> algorithm="MD5" checkInterval="30" debug="0" duplicates="0"
>> expiredSessions="41" maxActive="11" maxActiveSessions="-1"
>> maxInactiveInterval="1800" pathname="SESSIONS.ser"
>> randomClass="java.security.SecureRandom" rejectedSessions="0"
>> sessionCounter="42">
>>       </Manager>
>>
>>       <Resource name="jdbc/exampleDS" auth="Container"
>> type="javax.sql.DataSource" maxActive="75" maxIdle="10" maxWait="5000"
>> driverClassName="org.gjt.mm.mysql.Driver"
>> username="example" removeAbandoned="true" removeAbandonedTimeout="60"
>> validationQuery="SELECT 1" testOnBorrow="true" testWhileIdle="true"
>> timeBetweenEvictionRunsMillis="10000"
>> minEvictableIdleTimeMillis="60000"
>> url="jdbc:mysql://localhost/example?useUnicode=true&amp;charEncoding=utf-8&amp;mysqlEncoding=utf8&amp;cachePrepStmts=true&amp;useServerPrepStmts=false"
>> />
>> </Context>
>>
>>
>> BTW, if I define the context inside server.xml, the data souce gets
>> set correctly. If defined in context.xml, the app barfs with
>> exception:
>>
>> Cannot create JDBC driver of class '' for connect URL 'null'
>> java.lang.NullPointerException
>>
>> BUT one error at a time (this one is not critical at this point, but
>> would be nice to be able to define it in the context.xml).
>>
>>
>> Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to