How to add my JAR lib to tomcat7 installation in ubuntu

I am trying to configure an ubuntu server using tomcat7, I installed tomcat7 using the base

sudo apt-get install tomcat7 in ubuntu, I have several shared libraries in my applications, such as JSTL and other materials, so I would like to make them in the folder with the web server.

I placed them somewhere on the server after searching the Internet, but never booted, where to place them correctly?

I did it on Windows and it worked very hard, but on ubuntu it does not work, or do I need to install tomcat in another way?

+4
source share
4 answers

After installing the tomcat7 package on Ubuntu, you create your own tomcat instance using tomcat-instance-create <dir> . Among other files, this command creates <dir> /conf/catalina.properties, which defines

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

If your bank is located anywhere common.loader refers to, it will be used for all applications in the instance. CATALINA_BASE is & lt; dir> you specified in tomcat-instance-create. Thus, to maintain shared libraries between tomcat7 package updates, put them in <dir> / lib

+2
source

I would highly recommend against this.

You may have problems with class loaders, and shared libraries will not be able to see your code.

A general approach to this is to deploy common code as part of an EAR, but a simple Tomcat implements too little Java EE to support this. For this level, simply expand what you need and leave it at that. It also makes container switching easier if you need it - Jetty is a good alternative to development.

0
source

using the command you proved my library is in

/ Usr / shares / tomcat7 / library

If you are on ubunto you can try something like

find tomcat7 / lib

0
source

SHOULD CREATE AN INSTANCE FOR YOUR STATEMENT AND AFTER THIS ONE FOLDER, GATHERING WITH ALL THE CONFIGURATION, NORMALLY UNDER THE UNDERGROUND / etc / tomcat 7 / TEST-INSTANCE THIS CASE WHEN YOU HAVE A TASTY-TAST. TAKE THIS FOLDER THAT YOU CAN FIND ANOTHER NAMED webapp PACKAGE WHERE YOU CAN MAKE YOUR STATEMENT. ALSO ALSO OTHER FOLDERS ARE NAME THAT YOU CAN INITIALIZE THE WORK OF TOMCAT7 RUNNING./startup.sh COMMAND. IN THE NEXT LINE YOU CAN SEE A DEEP DESCRIPTION https://help.ubuntu.com/10.04/serverguide/tomcat.html

-3
source

Source: https://habr.com/ru/post/1484037/


All Articles