cancel
Showing results for 
Search instead for 
Did you mean: 

Start taskengine runtime

Former Member
0 Kudos

When I try to start the TaskEngine via DefaultTaskService I get the following exception in Hybris 6.7:

 Exception in thread "Task-master-poll" de.hybris.platform.servicelayer.exceptions.SystemException: Cannot execute Task Polling Thread with HybrisWebClassLoader in class loader hierarchy. Current context classloader is: de.hybris.tomcat.HybrisWebappLoader$HybrisWebappClassLoader
         at de.hybris.platform.task.impl.DefaultTaskService$Poll.assertNoHybrisWebAppClassLoader(DefaultTaskService.java:907)
         at de.hybris.platform.task.impl.DefaultTaskService$Poll.run(DefaultTaskService.java:874)
         at de.hybris.platform.core.AbstractTenant$5.run(AbstractTenant.java:2460)
         at java.lang.Thread.run(Thread.java:748)
         at de.hybris.platform.core.threadregistry.RegistrableThread.internalRun(RegistrableThread.java:144)
         at de.hybris.platform.core.threadregistry.RegistrableThread.run(RegistrableThread.java:134)

With this jsp script:

 <%
     final TaskService taskService = Registry.getApplicationContext().getBean("taskService", TaskService.class);
 
     TaskEngine engine = taskService.getEngine();
     boolean running = engine.isRunning();
     if(!running)
     {
         engine.start();
         out.write("Enabled");
     }
 %>

Accepted Solutions (1)

Accepted Solutions (1)

former_member387866
Active Contributor
0 Kudos

Hi Hidde,

You could try to execute it from a beanshell script:

 spring.getBean("taskService").getEngine().start()

Regards,
Luke

Former Member
0 Kudos

Hello

Does this really work? I tried running the given script and I do see a success message that task engine has been started.

But the tasks don't really run.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Hybris tries to drop a hint to you that you'd better not doing such a thing from a jsp page :-) I'd propose to move this logic to some custom service method to avoid its usage in the web part.

Former Member
0 Kudos

So you suggest that it would work from a service?