Hi

I've been setting up tomcat5 with great success and have a couple of
webapps working.

Next I thought I'll put the manager application in place and after a few
difficulties with the UserDatabase finally got it configured with a
memory Realm as discussed in the documentation for the manager app.

Ok, so all was working yesterday. Now I get an IOException about writing
to a file I don't have! Bizaarly tomcat wants a file called
tomcat-users.xml.new when I use tomcat-users.xml? What is that about?

exception, server.xml, and manager.xml (context) are below.

Any help is appreciated.

2007-02-16 14:01:25 UserDatabaseRealm[Local]: Exception looking up
UserDatabase under key UserDatabase
javax.naming.NamingException: IOException writing to
/usr/share/tomcat5/conf/tomcat-users.xml.new
at org.apache.naming.NamingContext.lookup(NamingContext.java:803)
at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
at
        
org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:252)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1075)
at
        org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at
        org.apache.catalina.core.StandardService.start(StandardService.java:480)
at
        org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
        
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

server.xml:

<Server port="8005" shutdown="SHUTDOWN" debug="0">

<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
            debug="0"/>

<Listener
  className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
            debug="0"/>

  <!-- Global JNDI resources -->
  <GlobalNamingResources>

    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>

  </GlobalNamingResources>

  <Service name="Local">

    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" 
               disableUploadTimeout="true" />

    <Engine name="Local" defaultHost="localhost" debug="0">

        <Logger className="org.apache.catalina.logger.FileLogger"
            verbosity="4"
            directory="logs"
            prefix="local-engine." suffix=".out"
            timestamp="true"/>

        <Valve className="org.apache.catalina.valves.AccessLogValve"
            prefix="local-engine-access_log." suffix=".txt"
            pattern="combined"/>

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
            debug="0" resourceName="UserDatabase"/>

        <!-- localhost Begin -->
        <Host name="localhost"
            debug="10"
            appBase="webapps"
            unpackWARs="true"
            autoDeploy="true" >

            <Logger className="org.apache.catalina.logger.FileLogger"
                directory="logs"
                prefix="localhost." suffix=".txt"
                timestamp="true"/>

            <Valve className="org.apache.catalina.valves.AccessLogValve"
                prefix="localhost-access_log." suffix=".txt"
                pattern="common"/>

        </Host>
        <!-- localhost End -->

    </Engine>

  </Service>

---8<---
cut other Service 
---8<---
</Server>

manager.xml context:
<!--

    Context configuration file for the Tomcat Manager Web App

    $Id: manager.xml,v 1.2 2004/02/20 17:09:29 remm Exp $

-->


<Context path="/manager"
docBase="${catalina.home}/server/webapps/manager"
        debug="0" privileged="true">

  <!-- Link to the user database we will get roles from -->
  <ResourceLink name="users" global="UserDatabase"
                type="org.apache.catalina.UserDatabase"/>

  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
                allow="127.0.0.1"/>

</Context>



Powered by Open-Xchange.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to