Hi Christopher and Charles,

Thanks for your help so far. I made the following changes:

server.xml
 <Engine name="Catalina" defaultHost="localhost">
      <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"  
             directory="logs"  prefix="localhost_access_log." suffix=".txt"  
             pattern="common" resolveHosts="false"/>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="false" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      </Host>
 </Engine>
        
conf/Catalina/localhost/ROOT.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="apps/AddressBookServer.war">
  <Environment name="LicenseFile" value="Licensekey.license" 
type="java.lang.String" override="true"/>
  <Environment name="BackupsFolder" value="../backups" type="java.lang.String" 
override="true"/>
  <Resource name="jdbc/AddressBookDB" auth="Container" 
type="javax.sql.DataSource"
     maxActive="1" maxIdle="0" maxWait="-1" removeAbandoned="true" 
removeAbandonedTimeout="60" logAbandoned="true"
     username="sa" password="" driverClassName="org.h2.Driver"
     
url="jdbc:h2:tcp://localhost:28081/../db/AddressBookDB;LOCK_TIMEOUT=60000"/>
  <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="org.h2.Driver"
    
connectionURL="jdbc:h2:tcp://localhost:28081/../db/AddressBookDB;LOCK_TIMEOUT=60000"
    connectionName="sa" connectionPassword=""
    userTable="WEBUSERS" userNameCol="USERID" userCredCol="PASSWORD"            
                                                                                
                            
    userRoleTable="WEBROLES" roleNameCol="ACCESSROLE"/>
</Context>

I also set the autoDeploy to false in server.xml and tried keeping my WAR in 
the webapps folder, however this didn't work. The following error messages were 
reported during startup.

I guess this is causes as I have a META-INF/context.xml file inside my WAR. 
However since this is ignored in any case I am not too worried

WARNING: A docBase 
/Users/alex/Tools/apache-tomcat-6.0.18/webapps/apps/AddressBookServer.war 
inside the host appBase has been specified, and will be ignored

I created an empty folder, but that didn't load my applications either. I am 
guessing it's loading it from the empty ROOT folder I created instead. 

Feb 3, 2010 11:12:03 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base 
/Users/alex/Tools/apache-tomcat-6.0.18/webapps/ROOT does not exist or is not a 
readable directory
        at 
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
        at 
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3957)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4126)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)

I am using tomcat 6.0.18. Is this supposed to work with this release or should 
I upgrade to 6.0.24 ?

Kind regards
Alex


On 3 Feb 2010, at 22:43, Christopher Schultz wrote:

> Alexander,
> 
> On 2/3/2010 3:17 PM, Alexander Hartner wrote:
>> This is a little off topic, but I tried your suggestions. However
>> there doesn't seem to be an option to set the root application
>> without renaming the WAR to ROOT.war, or is there.
> 
> You can use an xml-based file deployment model by, as I said before,
> putting your context.xml file in
> CATALINA_BASE/conf/[service]/[host]/[appname].xml, where "ROOT" is the
> appname if you want to deploy to "/". In that case, docBase should be
> set to the full path of the WAR file (or exploded WAR structure on the
> disk).
> 
>> Ideally I would like to set the deployment path to / in
>> META-INF/context.xml
> 
> It should be set elsewhere, but...
> 
>> but configure the database connection outside
>> the WAR to allow me to change between different database.
> 
> You can certainly do this: use <GlobalNamingResources> in server.xml and
> then use <resource-ref> in your web.xml. This feature is set up exactly
> for this situation: administrators maintain the details of the
> connection, and the webapps simply use them.
> 
>> Any other suggestion on my Connection issue. I set the maxActive to
>> 200 and after a day ended up with 21 in numActive state. So by
>> increasing my upper limit I can increase the time between restarts.
>> However this is really just a hack until I figure this out.
> 
> So, the problem is that you want the pool to go back down to 0? How are
> you checking the values of these settings?
> 
> -chris
> 

Reply via email to