Using OstermillerUtils in Lucee

40 views
Skip to first unread message

John Barbic

unread,
Mar 28, 2016, 12:49:49 PM3/28/16
to Lucee
While testing an application to be migrated to Lucee I've run into an issue with a bit of existing functionality that works in CF, but not in Lucee.  I'm using Lucee 5 RC and trying to understand how to configure the server to be able to use a java utility library (http://ostermiller.org/utils/).  In CF, you are able to include the jar in the ColdFusion Class Path in Servers Java and JVM Settings.  How is something like this meant to be done in Lucee?  I'm new to Lucee so I am probably not understanding the Extension piece, but otherwise I don't see any facility to including Java libraries like this. Any pointers would be appreciated.    

Igal @ Lucee.org

unread,
Mar 28, 2016, 1:13:09 PM3/28/16
to lu...@googlegroups.com
This is not an "extension" matter.  Did you try the same in Lucee?  Are you getting an error?  If so, please post it with full stacktrace.

In addition to the standard way, you can also specify the path to the jar in your function call, i.e.

  <cfset object = createObject("java", "pkg.name.ClassName", "C:\myjars\utils.jar")>

Igal Sapir
Lucee Core Developer
Lucee.org

On 3/28/2016 9:49 AM, John Barbic wrote:
While testing an application to be migrated to Lucee I've run into an issue with a bit of existing functionality that works in CF, but not in Lucee.  I'm using Lucee 5 RC and trying to understand how to configure the server to be able to use a java utility library (http://ostermiller.org/utils/).  In CF, you are able to include the jar in the ColdFusion Class Path in Servers Java and JVM Settings.  How is something like this meant to be done in Lucee?  I'm new to Lucee so I am probably not understanding the Extension piece, but otherwise I don't see any facility to including Java libraries like this. Any pointers would be appreciated.    
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
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/1e0ac8df-462c-4cf4-b07f-c8b03b75fc35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Barbic

unread,
Mar 28, 2016, 1:23:29 PM3/28/16
to Lucee
Thanks for that response Igal.  My issue is not understanding what "the standard way" is.  In other words, what is the standard way of including a jar like this in the Lucee Admin?  

Igal @ Lucee.org

unread,
Mar 28, 2016, 2:12:55 PM3/28/16
to lu...@googlegroups.com
It's like you said, you need the jar on the classpath, and there are many ways to achieve that:

    this.javaSettings = { ... }

Should work if that's what you did in CF11.

You can also put the jar files in the following directories (TBH I haven't used any of those myself in years, but they should work):
   
    {lucee-server}/lib
    {lucee-web}/lib

You can see the physical paths of the above by running:

    <cfdump var="#ExpandPath('{lucee-server}/lib')#">
    <cfdump var="#ExpandPath('{lucee-web}/lib')#">

The servlet container's lib directory should work as well:

    {your-web-context}/WEB-INF/lib

I personally add my directory with jars to the `common.loader` in {tomcat}/conf/catalina.properties

So really...  pick your own favorite ;)


Igal Sapir
Lucee Core Developer
Lucee.org

John Barbic

unread,
Mar 28, 2016, 3:09:33 PM3/28/16
to Lucee
Cool thanks again for taking the time to respond.  In CF there existed a page for doing this: Server Settings / Java JVM.  My n00b brain was getting tripped up looking for a similar page in Lucee...  
Reply all
Reply to author
Forward
0 new messages