Lucee java.lang.NoClassDefFoundError

I am trying to migrate our Railo to Lucee. We are using Wildfly 10 and we figured Lucee 5.3.4.80 is working with Wildfly 10.
So I’ve deployed our artifact to Lucee and try to run it. There is an issue with java.lang.NoClassDefFoundError when trying to load our login page.

Error page -

Caused by: java.lang.NoClassDefFoundError: com/accela/security/taglib/AuthTag
  ... 71 more
 Caused by: java.lang.ClassNotFoundException: class com.accela.security.taglib.AuthTag is invalid or doesn't exist
  at lucee.commons.lang.PhysicalClassLoader.findClass(PhysicalClassLoader.java:168)
  at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:149)

The Class com.accela.security.taglib.AuthTag is there within ROOT.war\WEB-INF\lib\av-web-sso.jar, it is strange why it does not load properly for <cfimport taglib.

I’ve tried <cfscript> to createObject and it is working fine.

<cfscript>
 obj = createObject("java", "com.accela.security.taglib.AuthTag");
</cfscript>

So I am wondering if I am doing something wrong with <cfimport taglib.

Don’t forget to tell us about your stack!

OS: Windows 11
Java Version: 1.8
Wildfly Version: 10.1.0
Lucee Version: 5.3.4.80

Maybe I can say something useful.

I’m having a very similar problem, although I can’t be more specific right now.

I have been running an application for 3 years that uses the pusher-http-java-1.1.0.jar library.
It uses Lucee 5.3.3 and Tomcat
I perfectly remember using tehe library the first time, only copying it to the /WEB-INF/lib folder

Today I’m working on a similar project but with Lucee + CommandBox.
I can’t instantiate the library. I always get:

Lucee 5.3.3.62 Error (java.lang.NoClassDefFoundError)
Message com/google/gson/GsonBuilder

I tried using an “all-dependencies” package (downloaded from here) coping all jars in custom “/libs” directory and adding:

this.javaSettings.loadPaths = [ ExpandPath( "/libs" ) ];

to Application.cfc. But the result is the same.

I want to specify that in the working production installation I didn’t add any other library except Pusher’s one.

I hope it can be useful.

1 Like

Some findings here -
The Tag Class is accessible thru createObject method, since the jar is placed within WEB-INF\lib and ideally should be loaded.
The Tag Class is NOT accessible by using <tag:method taglib="xxx.tld" . I am assuming there are some differences of loading Classes with createObject.

I’ve tried placing a Test Tag jar in a specified location, but with proper javaSettings it can still be loaded thru createObject. And still, the <tag:method cannot find the Class.

By checking the documentation, it could be related to bundles and Jar/Class Loading mechanism. So I’ve prepared a test2.jar bundle with single TestTag.class and test it. The result is the same - createObject works fine but <tag:method is not.

The original Jar is a customized jar which ideally shouldn’t be in a bundle. But anyways, it is not working with <tag class.