Issue in deploying web app as Lucee archive in tomcat container

#1

I had been trying to deploy the Lucee app as war in the Tomcat Container. ie renamed the application.war built without cfml source code files (and along with WEB-INF/web.xml having LuceeServlet referenced ) to ROOT.war and copied into /opt/lucee/lucee-server/webapps. CATALINA_HOME is /opt/tomcat and CATALINA_BASE is /opt/lucee/lucee-server. And the lucee.jar is located in CATALINA_BASE/lib.

The ROOT.war gets deployed successfully, but i get the error, index.cfm is not found however the compiled byte code is present. If I deploy the archive-html.lar (built without source code files) through /CATALINA_BASE/webapps/ROOT/WEB-INF/lucee/deploy, the index.cfm is executed, however the relative path is still pointing to CATALINA_BASE/webapps/ROOT.

Could someone please help solve this issue. I understand there’s a class path issue, but I have trouble figuring out that.

If the ROOT.war contains the source code files, it all works fine. But we prefer not to have source code files in the production server.

Thanks in Advance

#2

Firstly, a few questions:

  • Can you expound on the issue you’re solving by using a WAR deployment of Lucee as opposed to a “normal” installation? I just want to make sure we’re on the right road for the right reasons.
  • Have you installed just stock Tomcat and you’re trying to deploy a war on it? The subject of the post implies “yes”, but the file paths in the post imply “no”.
  • Exactly how.where did you get/create your war file from?
  • Is the issue that you can’t deploy a war that works at all, or specifically that you can’t deploy a war that provides all the CFML pre-compiled as a lar?
  • Can you tell us more about the Lucee archive (lar)? How did you create it, how have you configured your war to use it, and what is it mapped as?
#3
  • Can you expound on the issue you’re solving by using a WAR deployment of Lucee as opposed to a “normal” installation? I just want to make sure we’re on the right road for the right reasons.

The end result, what I’m trying to achieve is deploying a web app, as an archive file, which has pre-compiled cfml code but not the source code. I used the Lucee installer as well, since I had issues with that, I attempted all the different modes of setting up Lucee. ie Lucee installer, Lucee.war in a tomcat container, using lucee.jar in a tomcat container.

  • Have you installed just stock Tomcat and you’re trying to deploy a war on it? The subject of the post implies “yes”, but the file paths in the post imply “no”.

The method followed for my set up is this
https://www.rasia.io/blog/how-to-easily-setup-lucee-in-tomcat.html
Tomcat version is 8.5.40 and lucee-5.3.1.102.jar.

CATALINA_HOME is /opt/tomcat and CATALINA_BASE is /opt/lucee/lucee-server/

  • Exactly how.where did you get/create your war file from?

The archive .lar is generated through the mapping in Lucee web admin and renamed it as ROOT.war to deploy it in the webapps directory.

  • Is the issue that you can’t deploy a war that works at all, or specifically that you can’t deploy a war that provides all the CFML pre-compiled as a lar?

When archive-.lar ( built with the pre-compiled cfml alone without cfml source code) is deployed in /opt/lucee/webapps/ROOT/WEB-INF/lucee/deploy, it gets deployed successfully. And it takes me to the index.cfm, however the relative paths don’t get resolved correctly as the webroot is /opt/lucee/webaapps

But when I rename the same archive-.lar as ROOT.war, and on copy to /opt/lucee/lucee-server/webapps, it gets deployed, ie explodes the archive with all the pre-compiled cfml files. However it says, index.cfm is not found

However the same method works, if the ROOT.war has cfml source code in it and the application works as expected.

  • Can you tell us more about the Lucee archive (lar)? How did you create it, how have you configured your war to use it, and what is it mapped as?

I created the Lucee archive following this https://docs.lucee.org/guides/cookbooks/filesystem-mapping/filesystem-mapping-define-mapping.html.

The mapping gets generated when its deployed as *.lar as expected. When deployed as ROOT.war, the mapping points to /opt/lucee/lucee-server/webapps/ROOT.

Hope this helps.

Thank You.

#4

The end result, what I’m trying to achieve is deploying a web app, as an archive file, which has pre-compiled cfml code but not the source code.

This is possible without resorting to war deploy, which IMO is much more work than you need. You can precompile your CFML sources to a lar and deploy that as part of a normal app without needing a war. I have very little experience with lar files personally so I can’t promise they don’t have bugs, but whether or not you’re using a war wouldn’t change that.

I used the Lucee installer as well, since I had issues with that, I attempted all the different modes of setting up Lucee. ie Lucee installer, Lucee.war in a tomcat container, using lucee.jar in a tomcat container.

I’m not sure I followed all of that to be honest. It sounds like you’re saying you used the standard Lucee installer, had some sort of unspecified issues, and then uninstalled that and installed stock Tomcat to try and go another route? I would honestly back up and return to the Lucee installer first and let’s work through those issues. Trying to switch to wars and a much more complicated mode of installation may be doing nothing for you but just complicating things at this point.

The method followed for my set up is this
https://www.rasia.io/blog/how-to-easily-setup-lucee-in-tomcat.html

I’m not sure this is doing what you think it’s doing. Those instructions are basically just having you replicate what the Lucee installer does, but just with 1000 times the effort. When you talk about “deploying Lucee as a war” that typically means that you’re not dumping the core Lucee jars into the top-level Tomcat lib folder, but instead bundling the Lucee jars inside the war in web-inf/lib. Most people resorting to a war installation of Lucee are either deploying Lucee along side an existing non-CFML Java servlet or using some servlet-based SAAS like Jelastic. So far you haven’t indicated either of those scenarios apply to you so I think you may be off on a red herring of war-land.

  • Exactly how.where did you get/create your war file from?

The archive .lar is generated through the mapping in Lucee web admin and renamed it as ROOT.war to deploy it in the webapps directory.

Hold up, I was asking about the war, not the lar. Now I’m questioning if you’ve been confusing a lar with a war this entire time. These are two totally different unrelated files. A war is a “web archive” as defined by the J2E spec implemented by servlet containers such as Tomcat, Jetty, Wildfly, etc. A lar is a “lucee archive” which contains precompiled CFML files specific to Lucee Server only which is added as a mapped resource to a Lucee server or web context.

I’m going to skip the remaining questions as it seems like we have enough confusion right now just in the questions above to work through.

#5

Thanks for your response and time. I will return to the Standard Lucee installer. Yes, definitely a war file is different from lar file.

The issue remains the same, the relative paths like /assets/images/example.png is not being accessible.

#6

To be honest, that’s quite likely an issue with lar files in general. I’ve never really used them and I don’t see may other people using them. One of my big issues with them is the fact that I can’t automate their creation. Needing a running Lucee server and manually using a web UI is enough for me to just walk away from them as not worth my time. I would recommend putting a ticket In JIRA with the simplest example you can create. Otherwise, it won’t get addresses. (The dev team doesn’t really monitor this forum)

#7

Thanks for your suggestion. I will raise a ticket through JIRA.