Lucee CLI?

163 views
Skip to first unread message

Doug Hughes

unread,
Oct 1, 2015, 2:29:31 PM10/1/15
to Lucee
Hi All, I'm experimenting with Lucee (and never did with Railo, really). While digging around I saw that there was a lucee.cli.CLI that appears to allow me to run cfm files from the command line. Is this correct? If so, are there any examples on how to do this? 

My goal is to have a one-line command I can use to fire off a script that uses ColdDocs to generate static documentation of some CFCs. But, for the life of me I can't figure out how to get this to actually work. I may be using the java -jar command wrong, or maybe there's something else. But, here's an example of how I'm trying to use it. Can anyone point out where I'm going wrong?

java lucee.cli.CLI -jar lucee-5.0.0.81-20150918.205353-2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/ServletException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
at java.lang.Class.privateGetMethodRecursive(Class.java:3035)
at java.lang.Class.getMethod0(Class.java:3005)
at java.lang.Class.getMethod(Class.java:1771)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more

Perhaps I need to have all the dependent jars downloaded too and on the classpath?

Thanks for the feedback,

Doug

Pete Freitag

unread,
Oct 1, 2015, 2:34:03 PM10/1/15
to lu...@googlegroups.com
Hi Doug,

The easiest way to do this may be to use CommandBox, it embeds Lucee in a single binary, so you can just run: 

box somefile.cfm  



--
Pete Freitag
https://foundeo.com/ - ColdFusion Consulting & Products
http://hackmycf.com - CFML Server Security Scanner


--
See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/
---
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/3fcd0b68-6476-4767-9b68-ec6e29754b90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Doug Hughes

unread,
Oct 1, 2015, 4:46:27 PM10/1/15
to lu...@googlegroups.com
Thanks Pete, that's exactly what I needed. I'd been overlooking CommandBox because I didn't want to use some other tool if CLI was already built into Lucee and I'd also assumed that CommandBox was just a REPL. 

Thanks again!
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/Rsy-Slouwqg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Brad Wood

unread,
Oct 2, 2015, 11:28:55 AM10/2/15
to Lucee
Hi Doug, please run through the Getting Started Guide for CommandBox.  It will just take a few minutes and should give you a taste of all the stuff it does.  CommandBox is also a package manager, CLI, embedded server, and command-based scripting tool.


> My goal is to have a one-line command I can use to fire off a script that uses ColdDocs

Please note, Ortus has taken over the ColdDoc project from Mark Mandel and rebranded it as DocBox.  


We have a docbox command for CommandBox already in progress that will basically do everything you're trying to do out of the box.  It looks like the command still isn't fully complete, but let us know if you want to help test it and get it finished off.

Thanks!

~Brad

Doug Hughes

unread,
Oct 2, 2015, 11:35:04 AM10/2/15
to lu...@googlegroups.com
Brad - Thanks for the info. The DocBox was something I'd missed so it's very helpful.
Reply all
Reply to author
Forward
0 new messages