camunda-community-hub / camunda-platform-7-reactor

Event Driven process applications
https://camunda.github.io/camunda-bpm-reactor/
Apache License 2.0
80 stars 34 forks source link

Wildfly ClassLoader issue #47

Closed LupusUmbrae closed 7 years ago

LupusUmbrae commented 7 years ago

Hello,

Just trying to get this plugin working inside Wildfly, and to programatically add a listener from a web app. However i think i'm hitting an issue with Wildfly using different class loaders.

The instanceof check to find the plugin is failing despite the plugins variable containing the ReactorProcessEnginePlugin

Debugging and running some arbitrary code against it shows:

plugins.get(3).getClass()
     (java.lang.Class<T>) class org.camunda.bpm.extension.reactor.plugin.ReactorProcessEnginePlugin

plugins.get(3).getClass().getClassLoader()
     (org.jboss.modules.ModuleClassLoader) ModuleClassLoader for Module "org.camunda.bpm.extension.reactor.camunda-bpm-reactor-core:main" from local module loader @73d4cc9e (finder: local module finder @80169cf (roots: C:\projects\camunda-wildfly\server\wildfly-10.0.0.Final\modules,C:\projects\camunda-wildfly\server\wildfly-10.0.0.Final\modules\system\layers\base))

Thread.currentThread().getClass().getClassLoader()
     (org.jboss.modules.ModuleClassLoader) ModuleClassLoader for Module "org.jboss.msc:main" from local module loader @73d4cc9e (finder: local module finder @80169cf (roots: C:\projects\camunda-wildfly\server\wildfly-10.0.0.Final\modules,C:\projects\camunda-wildfly\server\wildfly-10.0.0.Final\modules\system\layers\base))

At the moment the Wildfly instance of starting the process engine at boot time, and my webapp is attempting to get hold of the ProcessEngine and the reactor to add a listener:

@PostDeploy
public void postDeploy(ProcessEngine processEngine) {
        CamundaEventBus eventBus = CamundaReactor.eventBus();
        eventBus.register(new ExecutionCompletionListener());
}

Any thought's on how to fix this?

LupusUmbrae commented 7 years ago

Bit more arguing with it and i got it to work.

I had to set the CamundaReactor plugin to be provided (I had to put it into a Global Module for Wildfly), and tell WildFly that my webapp needed CamundaReactor

jboss-deployment-structure.xml:

<jboss-deployment-structure>
  <deployment>
    <dependencies>
      <module name="org.camunda.bpm.extension.reactor.camunda-bpm-reactor-core" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>
jangalinski commented 7 years ago

Hi Robin

Sorry for the Late response, Busy Day. Dös that Mean your Problem is Solved?

Jan

Von meinem iPhone gesendet

Am 11.11.2016 um 16:38 schrieb Robin Moss notifications@github.com<mailto:notifications@github.com>:

Bit more arguing with it and i got it to work.

I had to set the CamundaReactor plugin to be provided (I had to put it into a Global Module for Wildfly), and tell WildFly that my webapp needed CamundaReactor

jboss-deployment-structure.xmlhttps://docs.jboss.org/author/display/WFLY10/Class+Loading+in+WildFly:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/camunda/camunda-bpm-reactor/issues/47#issuecomment-259983875, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAxr0JyPRtS7-1K92_J74SsFBK8l5k5sks5q9IvPgaJpZM4KvrN8.

LupusUmbrae commented 7 years ago

Hi Yes that does fix my issue, thanks

joaopalma5 commented 4 years ago

Hi Yes that does fix my issue, thanks

Hi, I'm using the docker image: camunda/camunda-bpm-platform:wildfly-7.13.0 and I can't install this plugin... You can help me?

What did I do: clone reactor, mvn clean install OK Install extension with jar and module.xml in /camunda/modules/org/camunda/bpm/extension/reactor/

You can help me?