Tomcat undeploys WARs automatically after some time - java

I'm facing an issue with Apache Tomcat 9.0.13 with JDK 1.8, where it tries to reload memory user database & upon failure, undeploys all the WARs of webapps.
Stacktrace of the exception is as follows:
12-Dec-2018 14:16:45.739 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
12-Dec-2018 14:16:45.766 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
12-Dec-2018 14:16:45.779 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 11788 ms
12-Dec-2018 15:34:02.582 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.users.MemoryUserDatabase.backgroundProcess Reloading memory user database [UserDatabase] from updated source [file:/P:/Tools/apache-tomcat-9.0.13/conf/tomcat-users.xml]
12-Dec-2018 15:34:02.582 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.users.MemoryUserDatabase.open The specified user database [conf/tomcat-users.xml] could not be found
12-Dec-2018 15:34:03.082 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.undeploy Undeploying context []
12-Dec-2018 15:34:03.082 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.undeploy Error while removing context []
java.lang.NoClassDefFoundError: org/apache/catalina/Lifecycle$SingleUse
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:269)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:834)
at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1434)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1360)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1620)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1179)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1405)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1373)
at java.lang.Thread.run(Thread.java:745)
Please note, tomcat-users.xml is located at conf folder.
Can anyone help me fix the issue?
Thanks.

The server on which Tomcat is running lost the connection to the P: drive momentarily. That triggered both the failure to check the tomcat-users.xml file and the undeloyment of the web applications. You need to move the webapps directory to a more reliable network location or, better still, a local drive.

Seems that the file tomcat-users.xml has not been found - might be removed or corrupted. This file serves as an in-memory database for the Tomcat management users. Download the Tomcat again and add the missing/corrupted file to the conf folder.
Also, search for the following lines to the server.xml which should be included because it registers in JNDI as an instance of UserDatabase. If the lines are missing, add them:
<Resource name="UserDatabase" auth="Container"
pathname="conf/tomcat-users.xml"
description="User database that can be updated and saved"
type="org.apache.catalina.UserDatabase"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
/>
The conclusion and the safer way would be to download a new entire instance of Tomcat from scratch.

Related

Pentaho 6 Quartz DB error after switching to postgres

I am moving our Pentaho 4 installation to new server and also updating it to pentaho 6 with postgresSQL databases instead of hypersql.
I have been following this guide: http://helicaltech.com/steps-migrate-oracle-pentaho/
even that it is meant for Oracle, files needed to be edited looks pretty much same.
There is one exception, as I have not changed file biserver-ce/pentaho-solutions/system/quartz/quartz.properties because it already contains org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate which I believe is postgres configuration.
However, when I try to start my bi-server, I am getting into error that prevents my bi-server to start. Here is the catalina.out exception:
18-Oct-2016 15:56:57.618 INFO [Thread-17] org.apache.cxf.endpoint.ServerImpl.initDestination Setting the server's publish address to be /lineage
18-Oct-2016 15:56:58.421 INFO [Thread-17] org.apache.cxf.endpoint.ServerImpl.initDestination Setting the server's publish address to be /marketplace
15:56:58,467 ERROR [0] [[org.osgi.service.cm.ConfigurationAdmin]]Cannot use configuration org.pentaho.requirejs for [org.osgi.service.cm.ManagedService, id=495, bundle=187/mvn:pentaho/pentaho-requirejs-osgi-manager/6.0.1.0-386]: No visibility to configuration bound to mvn:pentaho/pentaho-server-bundle/6.0.1.0-386
********************************************************************************
15:57:14,694 ERROR [EmbeddedQuartzSystemListener] EmbeddedQuartzSystemListener.ERROR_0007_SQLERROR
org.postgresql.util.PSQLException: ERROR: syntax error at or near "RUNSCRIPT"
Position: 1
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:333)
at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
at org.pentaho.platform.scheduler2.quartz.EmbeddedQuartzSystemListener.verifyQuartzIsConfigured(EmbeddedQuartzSystemListener.java:176)
at org.pentaho.platform.scheduler2.quartz.EmbeddedQuartzSystemListener.startup(EmbeddedQuartzSystemListener.java:100)
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:436)
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:427)
at org.pentaho.platform.engine.core.system.PentahoSystem.runAsSystem(PentahoSystem.java:406)
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:427)
at org.pentaho.platform.engine.core.system.PentahoSystem.access$000(PentahoSystem.java:82)
at org.pentaho.platform.engine.core.system.PentahoSystem$1.call(PentahoSystem.java:358)
at org.pentaho.platform.engine.core.system.PentahoSystem$1.call(PentahoSystem.java:355)
at org.pentaho.platform.engine.core.system.PentahoSystem.runAsSystem(PentahoSystem.java:406)
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:355)
at org.pentaho.platform.engine.core.system.PentahoSystem.init(PentahoSystem.java:326)
at org.pentaho.platform.engine.core.system.PentahoSystem.init(PentahoSystem.java:222)
at org.pentaho.platform.web.http.context.SolutionContextListener.contextInitialized(SolutionContextListener.java:154)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
15:57:14,696 ERROR [Logger] Error: Pentaho
15:57:14,696 ERROR [Logger] misc-org.pentaho.platform.engine.core.system.PentahoSystem: org.pentaho.platform.api.engine.PentahoSystemException: PentahoSystem.ERROR_0014 - Error while trying to execute startup sequence for org.pentaho.platform.scheduler2.quartz.EmbeddedQuartzSystemListener
org.pentaho.platform.api.engine.PentahoSystemException: org.pentaho.platform.api.engine.PentahoSystemException: PentahoSystem.ERROR_0014 - Error while trying to execute startup sequence for org.pentaho.platform.scheduler2.quartz.EmbeddedQuartzSystemListener
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:363)
at org.pentaho.platform.engine.core.system.PentahoSystem.init(PentahoSystem.java:326)
at org.pentaho.platform.engine.core.system.PentahoSystem.init(PentahoSystem.java:222)
at org.pentaho.platform.web.http.context.SolutionContextListener.contextInitialized(SolutionContextListener.java:154)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.pentaho.platform.api.engine.PentahoSystemException: PentahoSystem.ERROR_0014 - Error while trying to execute startup sequence for org.pentaho.platform.scheduler2.quartz.EmbeddedQuartzSystemListener
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:445)
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:427)
at org.pentaho.platform.engine.core.system.PentahoSystem.runAsSystem(PentahoSystem.java:406)
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:427)
at org.pentaho.platform.engine.core.system.PentahoSystem.access$000(PentahoSystem.java:82)
at org.pentaho.platform.engine.core.system.PentahoSystem$1.call(PentahoSystem.java:358)
at org.pentaho.platform.engine.core.system.PentahoSystem$1.call(PentahoSystem.java:355)
at org.pentaho.platform.engine.core.system.PentahoSystem.runAsSystem(PentahoSystem.java:406)
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:355)
... 16 more
Caused by: org.pentaho.platform.api.engine.PentahoSystemException: PentahoSystem.ERROR_0014 - Error while trying to execute startup sequence for org.pentaho.platform.scheduler2.quartz.EmbeddedQuartzSystemListener
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:437)
... 24 more
15:57:14,696 ERROR [Logger] Error end:
Pentaho BI Platform server failed to properly initialize. The system will not be available for requests. (Pentaho Open Source BA Server 6.0.1.0-386) Fully Qualified Server Url = http://localhost:8080/pentaho/, Solution Path = /home/app_core/flexcore/pentaho/biserver-ce/pentaho-solutions
18-Oct-2016 15:57:17.747 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/app_core/flexcore/pentaho/biserver-ce/tomcat/webapps/pentaho has finished in 43,862 ms
18-Oct-2016 15:57:17.747 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/app_core/flexcore/pentaho/biserver-ce/tomcat/webapps/ROOT
18-Oct-2016 15:57:17.882 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
18-Oct-2016 15:57:17.883 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/app_core/flexcore/pentaho/biserver-ce/tomcat/webapps/ROOT has finished in 136 ms
18-Oct-2016 15:57:17.885 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
18-Oct-2016 15:57:17.889 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
18-Oct-2016 15:57:17.890 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 45068 ms
I am not very certain with Java, so I would like to ask, if anybody can give me some hints where should I look for problem. Or what files should I check.
PS:
Yes, I have used biserver-ce\data\postgres files to create
databases.
I have also checked pentaho oficial guide at link: https://help.pentaho.com/Documentation/6.0/0F0/0K0/040/0A0 but the Quartz settings looks same as mine.
I have tried different validationQuery settings, but that did not help.
I was also trying to find "Listener". And I have found it in
bi-server/pentaho-solutions/system/quartz/quartz.properties but it is commented (dummy one = #org.quartz.triggerListener.dummy.class = org.quartz.examples.DumbTriggerListener) and no guide is doing anything with that
setting.
I just hit this myself and found the answer here:
http://forums.pentaho.com/showthread.php?153231-Pentaho-ce-5-Initialization-Exception
The solution is to create a table named QRTZ in the quartz DB:
CREATE TABLE "QRTZ"
(
NAME VARCHAR(200) NOT NULL,
PRIMARY KEY (NAME)
);
This worked for me and others in the thread in the link

OSX El Cap, Apache2, Tomcat 8, Lucee 5

I have posted in the Lucee google group, but after four days, i'm just not getting the support I need. I have a feeling a Tomcat expert will be able to point me in the right direction fairly quickly, so I'm posting here.
OSX El Cap, Apache2, Tomcat 8, Lucee 5.
On http://localhost, i get the Apache "It Works!" page.
on http://localhost:8080, i get the default Lucee page, served from
/usr/local/Cellar/tomcat/8.5.3/libexec/apps/lucee
On http://localhost:8080/manager/html and http://localhost:8080/host-manager/html, I get the Tomcat admin pages.
I have a directory, /Volumes/Storage/{companyname}/sites/www-test-app/www that contains index.cfm and index.htm
I have www-test-app set up in my HOSTS file.
I have a host entry in httpd-vhosts.conf for www-test-app
I have an entry in tomcat's server.xml file:
<Host name="www-test-app" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/Volumes/Storage/{companyname}/sites/_test-app/www/">
<JarScanner scanClassPath="false"/>
</Context>
</Host>
When i call up http://www-test-app/index.htm, I get my static test page.
When I call up http://www-test-app/index.cfm I get this error:
HTTP Status 404 -
type Status report
message
description The requested resource is not available.
Apache Tomcat/8.5.3
I have stopped and restarted apache and tomcat to make sure config files are read.
THE BIGGEST CLUE:
I do not see WEB-INF being created under
/Volumes/Storage/{companyname}/sites/www-test-app/www
My directory permissions are 777 for this directory and all subdirectories:
/Volumes/Storage/{companyname}/sites
I'm not sure if I need to make ownership changes though.
Apache2 was included with El Cap. Apache testconfig yields "syntax OK".
Tomcat was installed via Homebrew.
Lucee was installed via WAR file per this page:
http://brianflove.com/2015/03/05/lucee-on-mac-os-x-yosemite-quick-start/
I am stuck from here... but oh so close, since the default Lucee page looks great, including any cfoutput/variables.
Here's is a sample from catalina.{date}.log:
13-Jul-2016 12:06:02.381 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.3
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 9 2016 11:16:29 UTC
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.3.0
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.11.5
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_65-b17
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/Cellar/tomcat/8.5.3/libexec/conf/logging.properties
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.385 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.385 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/Cellar/tomcat/8.5.3/libexec/temp
13-Jul-2016 12:06:02.385 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/marc/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
13-Jul-2016 12:06:02.578 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
13-Jul-2016 12:06:02.619 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2016 12:06:02.623 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
13-Jul-2016 12:06:02.624 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2016 12:06:02.625 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 702 ms
13-Jul-2016 12:06:02.654 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
13-Jul-2016 12:06:02.655 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.3
13-Jul-2016 12:06:02.665 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /usr/local/Cellar/tomcat/8.5.3/libexec/conf/Catalina/localhost/ROOT.xml
13-Jul-2016 12:06:03.183 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
13-Jul-2016 12:06:08.815 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /usr/local/Cellar/tomcat/8.5.3/libexec/conf/Catalina/localhost/ROOT.xml has finished in 6,149 ms
13-Jul-2016 12:06:08.816 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/docs
13-Jul-2016 12:06:08.837 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/docs has finished in 21 ms
13-Jul-2016 12:06:08.837 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/examples
13-Jul-2016 12:06:09.079 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/examples has finished in 241 ms
13-Jul-2016 12:06:09.079 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/host-manager
13-Jul-2016 12:06:09.104 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/host-manager has finished in 25 ms
13-Jul-2016 12:06:09.104 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/manager
13-Jul-2016 12:06:09.123 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/manager has finished in 19 ms
13-Jul-2016 12:06:09.157 INFO [www-test-app-startStop-1] org.apache.catalina.core.ApplicationContext.log Marking servlet CFMLServlet as unavailable
13-Jul-2016 12:06:09.157 SEVERE [www-test-app-startStop-1] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [CFMLServlet] in web application [] threw load() exception
java.lang.ClassNotFoundException: lucee.loader.servlet.CFMLServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1282)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1116)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1061)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1000)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4902)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5212)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1405)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1395)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Can't find the disconnect... where do i go from here?
RESOLVED {sigh}
Well, I’m totally ready to kick my own a$$. The solution was way more simple than I thought.
My (mis)understanding was that configuring the Lucee EXPRESS to use the local Apache install on the mac just wasn’t going to work – that I had to use the tomcat built-in web server. The tomcat web server, because it’s based on Java, is in fact case-sensitive when it comes to filenames in the URL – “Foo.jpg” is NOT the same as “foo.jpg” in the eyes of the ‘cat. This is why I had given up on Lucee Express.
I do recall trying to get local Apache to work with Lucee Express, but since so much time has passed since that attempt, I couldn’t begin to tell you what I was doing wrong. I just know I couldn’t get it to work – probably mucking with config files that I actually didn’t need to.
Anyway, the solution is simple as all heck… download Lucee Express. Then just configure virtual hosts in apache as one normally would, as Apache needs to be told to proxy any coldfusion requests to tomcat/lucee… like so:
<Directory "/Volumes/Storage/company/sites/_test-app/www">
Allow From All
AllowOverride All
Options +Indexes
Require all granted
DirectoryIndex index.cfm
</Directory>
<VirtualHost *:80>
ServerName "www-test-app"
ServerAlias "www-test-app.*.*.*.*.xip.io"
DocumentRoot "/Volumes/Storage/company/sites/_test-app/www"
<Proxy *>
Allow from 127.0.0.1
</Proxy>
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2
</VirtualHost>
Then on the other side, add a similar entry for the Tomcat server.xml file:
<Host name="www-test-app" appBase="webapps" autoDeploy="true" unpackWARs="true">
<Context path="" docBase="/Volumes/Storage/company/sites/_test-app/www">
<JarScanner scanClassPath="false"/>
</Context>
</Host>
Then (damn it!!!) just start Apache and start Tomcat/Lucee. That’s it. Tomcat will create the WEB-INF files in each virtual host specified. The tomcat web server is still running on port 8888, and the ajp connector is still running on 8009.
http://www-test-app gives the result via Apache (case-insensitive urls).
Since Apache has root permission to listen on port 80, it does so… and passes CF requests on to port 8009.
BONUS: One can still test via the Tomcat web server…
http://www-test-app:8888 gives the result via Tomcat web server.
If one wanted to bypass/refrain from Apache and use the Tomcat web server, completely self-contained, BUT not have to add “:8888” to all their urls, homebrew for mac can install “haproxy” which, when run as root and configured using a simple config file, can receive requests on port 80 and forward them to port 8888.
For any NEW sites where the desire is to make sure file names are properly specified in code (case sensitivity-wise), this would be my ultimate solution. For legacy apps that were originally run on a case-insensitive stack, the use of the local Apache web server is the way to go.

Mysql-connector-java jar creates No TLDs error

I added a jar file mysql-connector-java-5.1.34-bin.jar to my $CATALINA_HOME/lib/ folder so I could use this library for connection pooling for mysql.
I running a dedicated server with Centos 6.6 X64 with Cpanel.
I installed jdk8 in /opt/jdk1.8.0_25 and installed tomcat 8 by untarring the download in the /home/username/ folder. I followed this tutorial:
http://tecadmin.net/install-tomcat-8-on-centos-rhel-and-ubuntu/
A simple "Hello World" servlet is running by deploying a .war file in the public_html folder
However now when I start up Tomcat (8.0.15) in the catalina.out file I see the error:
09-Dec-2014 17:45:49.152 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.15
09-Dec-2014 17:45:49.182 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/username/public_html/J.war
09-Dec-2014 17:45:49.592 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
09-Dec-2014 17:46:04.623 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [14,997] milliseconds.
09-Dec-2014 17:46:04.657 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/username/public_html/J.war has finished in 15,474 ms
And the connection pooling doesn't work. At my previous server the hosting company had setup tomcat with Cpanel and this worked just fine. I did not change the servlets so that cannot be the problem either.
My environment variables are:
CATALINA_HOME=/home/username/apache-tomcat-8.0.15
JRE_HOME=/opt/jdk1.8.0_25/jre
JAVA_PATH=/opt/jdk1.8.0_25/jre
PATH=/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr
/bin:/opt/jdk1.8.0_25/jre/bin:/opt/jdk1.8.0_25/bin:/usr/local/bin:/usr/X11R6/bin
:/root/bin:/opt/jdk1.8.0_25/bin
JAVA_HOME=/opt/jdk1.8.0_25
CLASSPATH=.:/usr/local/jdk/lib/classes.zip
The last CLASSPATH I do not understand because there is no file classes.zip on the server.
I also tried adding the jar file directly in the WEB-INF/lib folder of the deployed war file but this also did not work (the error in catalina.out was gone though).
Can somebody explain what I'm doing wrong with adding the library?
Thanks

IntelliJ IDEA 13.0.3 and Tomcat 8.0.9. Cant get it to work

I'm trying to deploy a Java web application running on Tomcat. I got the book
Professional Java for Web Applications: Featuring Websockets, Spring Framework, JPA Hibernate, and Spring Security
and I've done everything said to get IntelliJ IDEA 13 work together with Tomcat 8.0.9. I've tested the server container manually and it works great, even deploying .war files works great. However when i move on to start/debug a web application - in this case the first example form the book - from IntelliJ the application wont start. The output in the Tomcat Log doesn't say much.
Server output tells me this:
Connected to server
[2014-08-08 09:17:35,075] Artifact Sample-Debug-IntelliJ:war exploded: Artifact is being deployed, please wait...
[2014-08-08 09:17:35,097] Artifact Sample-Debug-IntelliJ:war exploded: Error during artifact deployment. See server log for details.
[2014-08-08 09:17:35,098] Artifact Sample-Debug-IntelliJ:war exploded: com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: L:\java-dev\java_web_apps_chapter_code\9781118656464 Full Code\Chapter 02\Sample-Debug- IntelliJ\target\sample-debug-intellij-1.0.0.SNAPSHOT not found for the web module.
08-Aug-2014 21:17:44.671 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager
08-Aug-2014 21:17:44.939 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager has finished in 268 ms
Tomcat Catalina Log output this:
08-Aug-2014 22:56:35.843 INFO [main] org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache Tomcat Native library 1.1.30 using APR version 1.4.8.
08-Aug-2014 22:56:35.846 INFO [main] org.apache.catalina.core.AprLifecycleListener.init APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
08-Aug-2014 22:56:36.652 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.1g 7 Apr 2014)
08-Aug-2014 22:56:36.738 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"]
08-Aug-2014 22:56:36.746 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
08-Aug-2014 22:56:36.747 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1060 ms
08-Aug-2014 22:56:36.771 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
08-Aug-2014 22:56:36.771 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.9
08-Aug-2014 22:56:36.778 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
08-Aug-2014 22:56:36.784 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
08-Aug-2014 22:56:36.785 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 38 ms
08-Aug-2014 22:56:46.785 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager
08-Aug-2014 22:56:47.035 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager has finished in 251 ms
I've tried on both Windows and OSX and it's the same story on both with the exact same error.
When i access http://localhost:8080/i can see that the server is up and running. However, the application isn't deployed.
Anyone experiencing the same error as me and/or know a solution?
I'm running IntelliJ IDEA 13.0.3, Java 1.8.0_11 and Tomcat 8.0.9.
EDIT: I've also tried with IntelliJ IDEA 13.1.4. Didn't make any difference.
Steps taken
Downloaded Java 1.8.0_11, installed it and added it to environment variables.
Downloaded Tomcat, unpacked it and made the following changes to it (step 2-4);
In conf/tomcat-users.xml i added this user:
<user username="admin" password="admin" roles="manager-gui,admin-gui" />
In conf/web.xml i added the code below beneath the org.apache.jasper.servlet.jspServlet element
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.8</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.8</param-value>
</init-param>
<init-param>
<param-name>compiler</param-name>
<param-value>modern</param-value>
</init-param>
Downloaded apache-ant and added a setenv.bat file in the apache-tomcat/bin directory with the following script
export CLASSPATH=L:/java-dev/jdk8/lib/tools.jar:L:/java-dev/apache-ant/lib/ant.jar:L:/java-dev/apache-ant/lib/ant-launcher.jar
Started IntelliJ and added the Tomcat application server.
Then i imported the project and set it to use the Tomcat server that I just added.
UPDATE: 2014-08-09 16:22
I tried to deploy a JavaEE web application that IntelliJ created itself, and that worked right away. Seems like it's something wrong with the source code that the book references.
I had similar problem. The problem was in artifact configuration in Run/Debug Configurations. I had to remove the project artifact and readd it. The important thing is to choose Web Application: Exploded, From Modules...
You can read my blog post that contains screenshots about this issue.
For me it worked with:
File >Project Structure >Artifacts
In the
Output Layout on the right side >"Available Elements?"
right click on the available libraries ( for me it was "Spring MVC-4.2.4.RELEASE")
Put into Lib ( actually click on the fix warning button )
And it worked.
Open "Debug Configuration" in IntelliJ IDEA and make sure that "Deploy applications configured in Tomcat" checkbox is checked as it shown on the screenshot
open the artifact config dialog (artifact > edit...)
check 'Show contents of elements' in the dialogs bottom section
highlight the 'WEB-INF' directory
right click on the library container (on the right pane)
select from context menu 'put into /WEB-INF/lib'
the lib folder is added in the output layout
rebuild artifact
restart webserver
Hope it helps.

Java web-app debugging not possible due to direct undeploy on debug

When i try to debug my webapp it starts up the tomcat server and the application, but shuts down the debugger shortly before the app gets usable. I see the debugging toolbar for a second before it vanishes again, though the app keeps running.
Tomcat-log:
Listening for transport dt_socket at address: 11555
23.03.2010 01:24:35 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
23.03.2010 01:24:35 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
23.03.2010 01:24:35 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 847 ms
23.03.2010 01:24:35 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
23.03.2010 01:24:35 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
23.03.2010 01:24:41 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
23.03.2010 01:24:41 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
23.03.2010 01:24:41 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/78 config=null
23.03.2010 01:24:41 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5855 ms
23.03.2010 01:24:42 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context []
23.03.2010 01:24:45 org.apache.catalina.core.StandardContext start
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] has already been started
Debugging log:
Attached JPDA debugger to localhost:11555
Checking data source definitions for missing JDBC drivers...
Deploying JDBC driver to /Applications/NetBeans/apache-tomcat-6.0.20/lib/mysql-connector-java-5.1.6-bin.jar
Stopping Tomcat process...
Waiting for Tomcat...
Tomcat server stopped.
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
Undeploying ...
OK - Undeployed application at context path /
In-place deployment at /path/to/project/dir/build/web
deploy?config=file%3A%2Fvar%2Ffolders%2FZP%2FZPbqxGrbHFaUlXzAfgWV1%2B%2B%2B%2BTQ%2F-Tmp-%2Fcontext734173871283203218.xml&path=/
OK - Deployed application at context path /
start?path=/
Start is in progress...
OK - Started application at context path /
debug-display-browser:
Browsing: http://localhost:8084/
connect-client-debugger:
BUILD SUCCESSFUL (total time: 18 seconds)
System is Netbeans 6.8 on MacOS 10.6.2.
You should see if the TC server is still in debug mode. The easiest way to do that is to Debug->Attach Debugger to localhost;11555. If it is still running 'debuggable', you will be able to do a fair bit of debugging that way.
I had similar problem where debugging started but kind of stopped immediately. The application was deployed however. I was not even able to attach to debugger manually, even if the Tomcat was running in debug mode. By creating a simple debuggable hello world project and starting debugging it also made debugger to break to my "problem project"'s break points as well.. But this was not really way to work.
My problem was "solved" by dropping mysql-connector-java.jar from my web project. I don't see any reasoning, but it simply works now. FYI also, the Netbean's Tomcat config's property "Enable JDBC driver deployment" did not have effect.
My environment was Netbeans 6.9.1 and project type was maven2, run on on Win7.

Categories