Lucee 5 JAR install on Ubuntu 16.04 with Tomcat 7

671 views
Skip to first unread message

Alexander Ambrose

unread,
Jun 21, 2016, 4:12:24 PM6/21/16
to Lucee
Having a tough time getting Lucee 5 installs running on Ubuntu 16.04 using jars.  Create the base of our Ansible scripts from https://github.com/foundeo/ubuntu-nginx-lucee and hoping to backport fixes to ours back to foundeo.  https://bitbucket.org/lucee/lucee/wiki/Lucee_5_Upgrading_Railo results in a blocked page for me and might hold the keys, but I'm currently getting the errors below after installing in catalina.out:

WARNING: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
Jun 21, 2016 1:12:33 PM org.apache.catalina.startup.TldConfig execute
INFO: 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.
Jun 21, 2016 1:12:33 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1259)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.JarScanner.scan(Lorg/apache/tomcat/JarScanType;Ljavax/servlet/ServletContext;Lorg/apache/tomcat/JarScannerCallback;)V
at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:250)
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:103)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5573)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 10 more

Jun 21, 2016 1:12:33 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /var/lib/tomcat7/webapps/ROOT
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1259)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

Alexander Ambrose

unread,
Jun 21, 2016, 4:33:30 PM6/21/16
to Lucee
Realized that I was actually download the jar file and treating it as a zip and then unzipping it.  Still Monday to me I guess.

Let's assume I start with a nice fresh Ubuntu 16.04 instance with Java 8 / Tomcat 7 (hoping to get to Tomcat 8 but in due time).
`catalina_home` is set to `/usr/share/tomcat7`.
`java_home` is set to `/usr/lib/jvm/java-8-openjdk-amd64/bin`.

Goal:

Download Lucee jars to `/opt/lucee/<version folder>/lucee.jar` and then symlink to `/opt/lucee/current/lucee.jar` which makes it easiest for us and Ansible to detect if we are on the version of Lucee we want to be.

What changes need to be done from here? Apologies for the "Do it for me, I'm helpless" kind of question, but I'm hoping to distill documentation out of this for a number of sources.

Jordan Michaels

unread,
Jun 21, 2016, 5:05:30 PM6/21/16
to lu...@googlegroups.com
You'll need to load the Lucee jar into the Tomcat common.loader line in the catalina.properties file. This will give Lucee to all contexts you subsequently create in Tomcat.

--
Kind regards,
Jordan Michaels
Vivio Technologies
--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/e4ceb68a-29af-414d-a988-42aea11da4af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Ambrose

unread,
Jun 21, 2016, 5:22:10 PM6/21/16
to Lucee
Okay.  In the current setup:

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

Previously, there was additional configuration added to `web.xml`:

    <servlet>
        <servlet-name>CFMLServlet</servlet-name>
        <description>CFML runtime Engine</description>
        <servlet-class>lucee.loader.servlet.CFMLServlet</servlet-class>
        <init-param>
           <param-name>lucee-server-directory</param-name>
           <param-value>/opt/lucee/config/server/</param-value>
           <description>Lucee Server configuration directory (for Server-wide configurations, settings, and libraries)</description>
        </init-param>
        <init-param>
            <param-name>lucee-web-directory</param-name>
            <param-value>/opt/lucee/config/web/</param-value>
            <description>Lucee Web Directory (for Website-specific configurations, settings, and libraries)</description>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>RESTServlet</servlet-name>
        <description>Servlet to access REST service</description>
        <servlet-class>lucee.loader.servlet.RestServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CFMLServlet</servlet-name>
        <url-pattern>*.cfm</url-pattern>
        <url-pattern>*.cfml</url-pattern>
        <url-pattern>*.cfc</url-pattern>
        <url-pattern>/index.cfm/*</url-pattern>
        <url-pattern>/index.cfc/*</url-pattern>
        <url-pattern>/index.cfml/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>RESTServlet</servlet-name>
         <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>


Is this still needed?

Alexander Ambrose

unread,
Jun 22, 2016, 10:54:54 AM6/22/16
to Lucee
Went back to including the above configuration with /opt/lucee/current/*.jar in the common.loader and I'm still getting errors with Servlets not being found which is where I started the adventure.  Lucee is the only jar and file in the 'current' directory.  If I don't include the configuration, then nothing happens except unprocessed pages although no errors.

SEVERE: Servlet [CFMLServlet] in web application [] threw load() exception
java.lang.ClassNotFoundException: lucee.loader.servlet.CFMLServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1146)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

Jun 22, 2016 10:43:53 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet RESTServlet as unavailable
Jun 22, 2016 10:43:53 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [RESTServlet] in web application [] threw load() exception
java.lang.ClassNotFoundException: lucee.loader.servlet.RestServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1146)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962)

Jordan Michaels

unread,
Jun 22, 2016, 2:39:52 PM6/22/16
to lu...@googlegroups.com
Hi Alexander,

Yep, you'll need to add the CFMLServlet definitions to your web.xml file. This tells Tomcat to give CFM-related requests to Lucee. The errors you're seeing here are just because you still need to set up your web.xml - so you were on the right track!

--
Kind regards,
Jordan Michaels
Vivio Technologies

----- Original Message -----
From: "Alexander Ambrose" <alexander...@gmail.com>
To: "Lucee" <lu...@googlegroups.com>
--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/62017884-5dc3-48ac-9759-728f92be9bcd%40googlegroups.com.

Alexander Ambrose

unread,
Jun 22, 2016, 4:18:10 PM6/22/16
to Lucee
Looks like I had the common.loader setup correctly, but somewhere along the line blanked out all scanning of JARs which was forcing nothing to load. Derp. Copied the other values out of lucee-express and started to get Lucee errors finally! Knew it had to be something in that file as you pointed to it and the other stuff would only seem to matter if Lucee was getting loaded.  Thank for the help.  Greatly appreciated!

Noticed I had to create what looks like a '{tomcat_home}/lucee-server' directory with permissions that Lucee is running under.  In this round I stuck to the simple config close to lucee-express.  Would setting `lucee-server-directory` / `lucee-web-directory` change this location to something I can control?  Would love to keep it under `/opt/lucee`.
Reply all
Reply to author
Forward
0 new messages