Sidebar

How to resolve: Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.some.package.SomeClass

0 votes
4.2K views
asked Jan 23, 2015 by rich-c-2789 (16,240 points)

I have created my own external library but I get a "500 internal server error" that directed me to look in the log files.  I found this error in the logs.  

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.some.package.SomeClass

My external jar contains MyAwesomeClass that I call in my script.  I do not use SomeClass anywhere in my script.

 

 

1 Answer

0 votes
This error is likely due to a missing dependency.  If the calling chain or call stack is missing the dependency then this error would be thrown.  For example: If the script calls MyClass.someMethod which calls SomeUtilsClass.someParseMethod that calls SomeClass...  If MyClass was in My.jar and SomeClass was in Some.jar both jars would need to be added to QIE's lib folder and selected.  

You may also be interested in these related questions:

https://www.qvera.com/kb/index.php/256/what-are-external-libraries-or-jar-files

https://www.qvera.com/kb/index.php/628/how-do-i-import-and-use-a-3rd-party-java-library-in-qie

https://www.qvera.com/kb/index.php/35/referenceerror-jcifs-defined-trying-jcifs-external-library

https://www.qvera.com/kb/index.php/151/how-do-i-resolve-typeerror-is-not-a-function-it-is-object
answered Jan 23, 2015 by rich-c-2789 (16,240 points)
...