Saturday, May 17, 2014

How to configure 'shared' loader directory in TOMCAT 6.x/7.x/8.x

Follow the below given steps to configure the 'shared' directory in TOMCAT 6.x/7.x/8.x :::

Shared loader config can be found in: <TomcatHome>\conf\catalina.properties. Follow the steps given below to update and configure shared loader.

Follow the steps given below:

1- Create 'shared' directory in tomcat parallel to webapps, bin, logs, conf. etc. directories.

2- Create 'classes' & 'lib' directories inside 'shared' directory.

3- Go to 'conf' directory and open 'catalina.properties' file and modify the value of 'shared.loader' to below given value.

   shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

4- Shared directory is ready to use, no you can directly add your jar files in 'lib' directory and     properties files, configs etc in 'classes' directory.

It will be automatically loaded to the classpath when server will run.

If you are using tomcat within eclipse or any other IDE, then you need to update the 'catalina.properties' found in the eclipse under "Servers" project. See the screen shot below:












Update the "shared.loader" value with full path in the "catalina.properties". See example below:

shared.loader=C:/Personal/EclipseWorkspace/Servers/Tomcat v8.0 Server at localhost-config/shared/classes,C:/Personal/EclipseWorkspace/Servers/Tomcat v8.0 Server at localhost-config/shared/lib/*.jar

Once you are done with above step then created the directories as mentioned above and place the config files which you want to load in classpath. See screen shot below:




No comments:

Post a Comment

Thanks for your comments/Suggestions.