Runnable Task - java.lang.NoClassDefFoundError


i want to create a task, which running in the background, till someone
stops it.

I found a “demo” at a rabbitmq consumer:

The demo works, but when i try to write my own Task, i cant start it.


I hope someone can help me…




application.stoptasks = false;
//Create Task
myTask = createDynamicProxy(new MyTask(), [ "java.lang.Runnable" ]);
// Create a new start for consuming
    thread = createObject( "java", "java.lang.Thread" 


component accessors="true"{

  property name = "id";

  function init(){ = left( createUUID(), 3); = application;
    return this;

  function run(){
      WriteOutput("Test Output");


I dont know why this happens…

Thank you!

Running a thread inside a thread in Lucee 4

I found the issue…
Simply add javaSettings in your application.cfc.

this.javaSettings = { loadPaths = ["/task/lib"] }; 

This works, but i dont know why i have to define the javaSettings
Path…The lib-folder is empty and it makes not sense…


Why on earth does this stupid fix work? Did you raise an issue on JIRA?


@lmajano Have you ever run into the behavior described in this thread?


@bdw429s @David_Raschper @kliakos
Works for me, too. But it should not be necessary, shouldn’t it?


It’s very helped me.