Configure Tomcat to use properties file to load DB connection information

We often distribute webapps by providing a WAR, and a Context XML file, which gets placed into your tomcat/conf/Catalina/localhost directory, and can load the webapp from any path. There is a reference document here. This provides the following advantages: Context parameters can be configured here and read by the webapp DataSources can be defined and … Read more

JAXB not available on Tomcat 9 and Java 9/10

Analysis First some random facts: if not given a class loader, JAXBContext::newInstance will use the thread’s context class loader when looking for the JAXB implementation – this is the case even if you call newInstance(Class…) (one might mistakenly think it uses the provided class instances’ loader) Tomcat builds a small class loader hierarchy to separate … Read more

How to set maximum number of rolls and maximum log size for tomcat?

As Tomcat internally uses JUL to log , you can use the system property java.util.logging.config.file to specify the file path of the properties file. For the format of this properties file , you can refer to your JRE_HOME/lib/logging.properties (which is the default configuration file used by JUL) However, JUL does not support the daily rotation … Read more

spring-boot-starter-tomcat vs spring-boot-starter-web

Since #1 supports Tomcat why would one want to use #2? spring-boot-starter-web contains spring-boot-starter-tomcat. spring-boot-starter-tomcat could potentially be used on its own if spring mvc isn’t needed (contained in spring-boot-starter-web). Here is the dependency hierarchy of spring-boot-starter-web: What are the differences? spring-boot-starter-web contains spring web dependencies (including spring-boot-starter-tomcat): spring-boot-starter jackson spring-core spring-mvc spring-boot-starter-tomcat spring-boot-starter-tomcat contains … Read more

UnsupportedClassVersionError unsupported major.minor version 51.0 unable to load class [duplicate]

Well presumably it’s not using the same version of Java when running it externally. Look through the startup scripts carefully to find where it picks up the version of Java to run. You should also check the startup logs to see whether they indicate which version is running. Alternatively, unless you need the Java 7 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)