1

How can I deploy a war file to Tomcat in exactly the same way Eclipse deploys to Tomcat, if I configured Tomcat in Eclipse?

Reason for asking is that when I deploy with Eclipse everything works fine (databse connection, log4j ect). But when I manually deploy the corresponding war file to the same Tomcat installation, none of my external resources like database connection, logging to files work!

user2908112
  • 457
  • 6
  • 18
  • Several question may arise. 1) Did you restart your tomcat after deploying? 2) Did you deploy your war file in same machine? 3) Is there any path set to your program that was static? 4) After updating in your code, did you press "Clean and Build button"? – Ataur Rahman Munna Jun 29 '16 at 08:10
  • it's difficult to give an answers without error messages... does your war file contain the libraries needed for logging, database connction and so on? – JimHawkins Jun 29 '16 at 08:11
  • You can look here how to setup Tomcat: http://stackoverflow.com/questions/14579661/how-to-set-catalina-home-variable-in-windows-7 – Pritam Banerjee Jun 29 '16 at 08:12
  • Yes, restarted, same machine. Not sure about 3. Tried with ant build as well, nothing works – user2908112 Jun 29 '16 at 08:15
  • All libs are there otherwise eclipse wouldnt make it – user2908112 Jun 29 '16 at 08:16
  • Please put your exception too. What exception thrown by your tomcat ? P.S: see it in tomcat console. – Ataur Rahman Munna Jun 29 '16 at 08:44
  • I started a thread about this problem before this. There are all outputs: http://stackoverflow.com/questions/38069832/tomcat-deployment-failing – user2908112 Jun 29 '16 at 08:52

1 Answers1

0

You can add the external jars to $CATALINA_BASE/lib Read here

Common — This class loader contains additional classes that are made visible to both Tomcat internal classes and to all web applications

Pritam Banerjee
  • 17,953
  • 10
  • 93
  • 108
ThiepLV
  • 1,219
  • 3
  • 10
  • 21