Where to place jar file inside Lucee Express?

I’m having a difficult time getting Lucee to pick up my jar file. In which
folder is it supposed to be?

cannot load class through its string name, because no definition for the
class with the specified name [password.test.PasswordConverter.class] could
be found caused by
(java.lang.ClassNotFoundException:password.test.PasswordConverter.class not
found by lucee.core
[64];java.lang.ClassNotFoundException:password.test.PasswordConverter.class;)

Here is my CF code:

<cfset testCF = createObject(“java”, “password.test.PasswordConverter”) />
does it work? #testCF.test()#

Am I supposed to use a regular jar or an executable jar? Neither one work
btw. Or am I supposed to use an OSGI bundle? What do I do if I am
referencing other java libraries inside of my custom jar file? Do I place
them inside my custom jar file or include them separately?

Am I supposed to create a mapping inside of Application.cfc for this to
work, or is it unnecessary? In which file can I find the settings which
declares the file path for Lucee to pick up these jar files?

Thanks

https://cfdocs.org/application-cfc
See javasettings.

-GOn Wed, Mar 1, 2017 at 9:54 AM, <@ryanjpgandy> wrote:

I’m having a difficult time getting Lucee to pick up my jar file. In which
folder is it supposed to be?

cannot load class through its string name, because no definition for the
class with the specified name [password.test.PasswordConverter.class]
could be found caused by (java.lang.ClassNotFoundException:password.test.PasswordConverter.class
not found by lucee.core [64];java.lang.ClassNotFoundException:
password.test.PasswordConverter.class;)

Here is my CF code:

<cfset testCF = createObject(“java”, “password.test.PasswordConverter”) />
does it work? #testCF.test()#

Am I supposed to use a regular jar or an executable jar? Neither one work
btw. Or am I supposed to use an OSGI bundle? What do I do if I am
referencing other java libraries inside of my custom jar file? Do I place
them inside my custom jar file or include them separately?

Am I supposed to create a mapping inside of Application.cfc for this to
work, or is it unnecessary? In which file can I find the settings which
declares the file path for Lucee to pick up these jar files?

Thanks


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+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/6e797633-9134-4160-baac-9521d08c6425%40googlegroups.com
https://groups.google.com/d/msgid/lucee/6e797633-9134-4160-baac-9521d08c6425%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

joe, can you expand on that just a tad? The article you pointed to had no examples of how this should look.

Thank you!

My BCrypt.jar goes in WEB-INF/lucee/lib.
Then createObject(“java”, packagename)

you might have to reboot/reload Lucee after that.

1 Like

Did you already take a look at the following thread?

1 Like

Very informative, thank you. I had not found that one, working on this now.

I was able to finally dial in the right combination.

I was able to load the ftp4j-1.7.2.jar file by placing it in the C:\lucee\tomcat\webapps\ROOT\WEB-INF\lucee\lib\ directory, and in a cfscript I put:

ftpClient = CreateObject(“java”,“it.sauronsoftware.ftp4j.FTPClient”, “C:/lucee/tomcat/webapps/ROOT/WEB-INF/lucee/lib/ftp4j.jar”).init();

Voila! A simple dump(ftpClient); after that gave me access to all the PEM’s.

I did NOT need to load the java classpaths in Application.cfc either, which was good because this is only used by less than one percent of the application and only by certain people, so I didn’t need to add to the memory usage for the rest of the community.

Thanks to this forum I was able to piece together the solution. Gracias!

1 Like

Bienvenido @randylsmith! Nice to see that you got it working :smiley: and thanks also for posting it.

1 Like