On Jan 14, 2013, at 1:15 PM, Delia, Brett wrote:

> Greetings,
> 
> I have a frustrating issue that I see when I try to set up an environment on 
> my Windows laptop, where I do development, to match my Linux servers that our 
> applications reside.  Everything seems to behave the way I would expect with 
> the exception of setting the shared.loader property in catalina.properties.
> 
> On Linux I can set it up like this:
> 
> shared.loader=${catalina.base}/sharedProperties,${catalina.base}/ 
> sharedProperties /*.properties,${catalina.home}/ 
> sharedProperties,${catalina.home}/ sharedProperties /*.properties

You don't want to do this.  The "shared.loader" property is for configuring the 
locations where the class loader will look for something.  This should be 
either a directory, a JAR file or a URL.  In other words, you need to add the 
location where the ".properties" file resides, not the full path to the 
properties files.

Try this instead...

shared.loader=${catalina.base}/sharedProperties,${catalina.home}/ 
sharedProperties

> 
> But on my Windows laptop that does not work and results in the server 
> throwing the following during start up:
> 
> SEVERE: Class loader creation threw exception
> java.io.IOException: The system cannot find the file specified
>     at java.io.WinNTFileSystem.canonicalize0(Native Method)
>     at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
>     at java.io.File.getCanonicalPath(File.java:559)
>     at 
> org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:201)
>     at 
> org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:174)
>     at 
> org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:98)
>     at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:207)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:391)
> 
> I can get it working if I explicitly name all of the property files that 
> might be in that directory like so:
> 
> shared.loader=${catalina.base}/sharedProperties,${catalina.base}/ 
> sharedProperties /foo.properties,${catalina.base}/ sharedProperties 
> /bar.properties,${catalina.home}/ sharedProperties,${catalina.home}/ 
> sharedProperties /foo.properties,${catalina.home}/sharedProperties 
> /bar.properties
> 
> 
> My intent is to not have to do that but to leave it more generic, like we do 
> on the Linux servers.   This makes it so that each application that has a 
> property file that need to be dropped in that shareProperties directory does 
> not have to result in updating the Tomcat configuration.
> 
> Any insight on why I cannot seem to configure this the same way on Windows 
> and Linux would be greatly appreciated.  According to the properties file 
> itself I should be able to do so.

It's different because the OS's handle file operations differently.  Try my 
suggestion above, I think that will work on both.

Dan

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

Reply via email to