Thanks Sriram, I've already done that and it's working fine. 

Now, the only problem that I have is I don't know how to configure digester
so that a rule is not executed until another rule is executed. My english is
bad but I think an example is better :)
I ve done some minor changes to rules in packege org.apache.catalina.startup
to work with embedded. In particular i've remove the server tag
digester.addObjectCreate("Service","org.apache.catalina.startup.Embedded","c
lassName");
digester.addSetProperties("Service");
digester.addSetNext("Service","setEmbedded","org.apache.catalina.startup.Emb
edded");
And change the Engine rules (because in org.apache.catalina.startup.Embedded
the method to add an engine is addEngine)

digester.addSetNext(prefix + "Engine", "setContainer",
"org.apache.catalina.Container"); by
digester.addSetNext(prefix +
"Engine","addEngine","org.apache.catalina.Engine");

The connector rules are the originals:
digester.addObjectCreate("Service/Connector",
"org.apache.coyote.tomcat5.CoyoteConnector", "className");
digester.addRule("Service/Connector", new SetAllPropertiesRule());
digester.addSetNext("Service/Connector",
"addConnector","org.apache.catalina.Connector");

Now the problem is that the method addConnector in
org.apache.catalina.startup.Embedded check there is an engine. So addEngine
must be excute before addConnector. 
Is there something to force digester to do this?

If my xml is the following everything works fine:
  <Service name="Catalina-Service">
    <Engine name="Catalina-Engine" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger" />
      <Host name="localhost" appBase="webapps" />
    </Engine>
    <Connector port="8080" />
  </Service>

But the following dosn't work:
  <Service name="Catalina-Service">
    <Connector port="8080" /> 
    <Engine name="Catalina-Engine" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger" />
      <Host name="localhost" appBase="webapps" />
    </Engine>
  </Service>

Thanks, Claudio. 

-----Original Message-----
From: Sriram Narayanan [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 16, 2006 4:26 PM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: Re: Embedded intance and server.xml

On 1/17/06, Claudio Sanchez <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to configure an embedded server using an external configuration
file.
> Is there a way to configure an Embedded server instance using server.xml?
>

server.xml is digested. You can easily do something like this yourself by
just creating the appropriate Digester Rules.

> Thanks, Claudio
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to