2010/1/14 Rob S. <r...@tintri.com>:
> During development, we specify an alternate configuration file via
> JAVA_OPTS:
>
> -Dcatalina.config=file://...
>
> In it, we create properties like foo.port.http and foo.port.shutdown which
> we then use in server.xml.  We do this so that we can run multiple servers
> simultaneously as well as not require root access during development to
> ports < 1024.
>
> <Server port="${foo.port.shutdown}" shutdown="SHUTDOWN">
>
> During shutdown, it looks Tomcat is not loading properties from this file as
> it uses 8005 (the default shutdown port) instead of the shutdown port we set
> in our custom properties file.
>
> I'm pretty sure this is a bug (shutdown script does not load custom
> properties), I just wanted to check with everyone before filing it.
>

1. Are you sure, that you are using JAVA_OPTS ?
That behavior that you describe would be observed if CATALINA_OPTS
were used instead of them.

>From the source
Bootstrap.main() calls daemon.init(); (thus Bootstrap.init()) on the
first lines of it.

The init() method calls initClassLoaders(); which calls
createClassLoader() which accesses CatalinaProperties.  At this point
CatalinaProperties should have already been configured
(CatalinaProperties calls loadProperties() in its static initializer
block).

So, I do not see how it can avoid reading your custom catalina.properties.

Note, that if the file URL pointed by -Dcatalina.config is unreadable,
no error message is printed.  (I think that is a bug, though a minor
one).


I tried to reproduce your use case and it is working for me in 6.0.20
on Windows.

Try echoing the actual command that launches the JVM in catalina.sh file.

2. It is also possible to run
catalina.sh start -config pathToServer.xml

E.g, the following commands are working in 6.0.20:
catalina.bat start -config conf/server2.xml
catalina.bat stop -config conf/server2.xml


Best regards,
Konstantin Kolinko

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

Reply via email to