Apache TomEE PLUS

Sir,

I have a question regarding deploying Camunda 7.4 version on TomEE Plus 1.7.4. I can’t use tomcat because my custom code has EJBs. I followed the tomcat documentation but looks like it is not working.
My code is working fine with WildFly8* server but as organisatin decision we are planning to do the same with TomEE.

Could you please suggest me on this. Is it advisable to use TomEE 1.7.4?? Based on your suggestin I will migrate to TomEE. As I did not find any official documentation for TomEE.

Thanks & Regards
Srini

Hi @tadikonda74,

TomEE is not part of the supported Camunda environments. That means, we do not test Camunda on TomEE and only have very limited experience with it. If you want to stick to a supported environment, I recommend using one of the supported JavaEE application servers, e.g. Wildfly as you mention.

If you want to debug what’s going wrong on TomEE, you could post the server logs and we could try to identify the problems together.

Cheers,
Thorben

Hi Rhorben,

Thanks a lot for your quick response. I totally understand.

Regards
Srini

Can you please help me on this, due to some dependence I have to use TomEE Plus server.
I am deploying 7.4 camunda version and got the following error in tomee log.


INFO: OpenWebBeans Container is starting…
Jul 22, 2016 9:59:31 AM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Jul 22, 2016 9:59:31 AM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
Jul 22, 2016 9:59:31 AM org.apache.webbeans.config.BeansDeployer validateInjecti
onPoints
INFO: All injection points were validated successfully.
Jul 22, 2016 9:59:31 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication

INFO: OpenWebBeans Container has started, it took 99 ms.
Jul 22, 2016 9:59:31 AM org.apache.openejb.assembler.classic.Assembler createApp
lication
INFO: Deployed Application(path=C:\apache-tomee-plus-1.7.4\webapps\camunda)
Jul 22, 2016 9:59:32 AM org.apache.openejb.observer.ObserverManager$MethodInvoca
tion invoke
SEVERE: error invoking org.apache.tomee.webservices.TomeeJaxRsService@212bf671
java.lang.NoClassDefFoundError: org/apache/http/HttpException
** at java.lang.Class.getDeclaredConstructors0(Native Method)**
** at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)**
** at java.lang.Class.getConstructors(Class.java:1651)**
** at org.apache.openejb.server.cxf.rs.CxfRsHttpListener$ProviderFactory.n**e
wInstance(CxfRsHttpListener.java:979)
at org.apache.openejb.assembler.classic.util.ServiceInfos.resolve(Servic
eInfos.java:98)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.providers(CxfRsHtt
pListener.java:423)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.sortProviders(CxfR
sHttpListener.java:851)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.configureFactory(C
xfRsHttpListener.java:828)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(
CxfRsHttpListener.java:507)
at org.apache.openejb.server.rest.RESTService.deployApplication(RESTServ
ice.java:464)
at org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RE
STService.java:233)
at org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreate
d(TomeeJaxRsService.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(O
bserverManager.java:400)
at org.apache.openejb.observer.ObserverManager$InvocationList.invoke(Obs
erverManager.java:515)
at org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.ja
va:111)
at org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager
.java:100)
at org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.jav
a:135)
at org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebApp
Builder.java:1661)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(Global
ListenerSupport.java:116)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase
.java:394)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:165)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
5)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav

a:1259)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig
.java:1998)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClas
sLoaderBase.java:1858)

Hi @tadikonda74,

Is this exception related to Camunda, i.e. is there anywhere a Camunda class in the stacktrace? Note that we do not have the resources to help you get an entire TomEE setup right, but that we try to help with Camunda-related problems in that context.

By the way, see this post how you can format log files as code blocks.

Cheers,
Thorben

Hi Thorben,

Thanks for quick response. When I ran TomEE without camunda then I did not see any error in logs.
While deploying camunda in tomee then I got attached error. But I could be able to login to camunda and looks like everything working fine on camunda.
Do you think is there any issue while communicating my custom app to camunda engine due to this error.

INFO: Deployed Application(path=C:\apache-tomee-plus-1.7.4\webapps\camunda)
Jul 22, 2016 10:08:22 AM org.apache.openejb.observer.ObserverManager$MethodInvocation invoke
SEVERE: error invoking org.apache.tomee.webservices.TomeeJaxRsService@212bf671
java.lang.NoClassDefFoundError: org/apache/http/HttpException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructors(Class.java:1651)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener$ProviderFactory.newInstance(CxfRsHttpListener.java:979)
at org.apache.openejb.assembler.classic.util.ServiceInfos.resolve(ServiceInfos.java:98)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.providers(CxfRsHttpListener.java:423)

And also how can I tell my custom app to use different camunda process engine where hosted in different machine and different port.? (If I host camunda and my custom app on same server then I used default)

Here is my process.xml for default. Please let me know how to inform my custom app to use different process-engine where it was hosted on different machine.?

default false true

Thanks a lot for your help.

Regards
Srini

catalina.2016-07-22.log (184 KB)

Hi @tadikonda74,

It would be helpful when you describe the context what you are doing on TomEE Plus when you post stacktraces. I can only see that you tried to deploy the Camunda WebApp? -> (Deployed Application(path=C:\apache-tomee-plus-1.7.4\webapps\camunda)) but you didn’t tell us if you have installed the Camunda Platform (Shared libraries etc.) already.

Best thing would be you describe what you already did and then maybe we can guide you on some points where you are unable to proceed.

Cheers,
Christian

Hint: I actually tried to install the Camunda WebApp on TomEE some years ago. If I remember correctly, I had to change some stuff inside the web.xml regarding the used JAX-RS provider in TomEE (Apache CXF in that case).

Hi Christian,

Yes, I followed the tomcat setup documentation. I downloaded camunda-bpm-tomcat-7.4.0.zip file from your site and copied all the shared lib and did the configuration changes also. I could able to login to camunda app also. Do you think is there any issue while communicating my custom
app to camunda engine due to this error?

Could you please let me know is there any change requried on web.xml??

INFO: Deployed
Application(path=C:\apache-tomee-plus-1.7.4\webapps\camunda)

Jul 22, 2016 10:08:22 AM
org.apache.openejb.observer.ObserverManager$MethodInvocation invoke

SEVERE: error invoking org.apache.tomee.webservices.TomeeJaxRsService@212bf671

java.lang.NoClassDefFoundError: org/apache/http/HttpException

               
at java.lang.Class.getDeclaredConstructors0(Native Method)

               
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)

               
at java.lang.Class.getConstructors(Class.java:1651)

               
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener$ProviderFactory.newInstance(CxfRsHttpListener.java:979)

Q2)

And also how can I tell my custom app to use different camunda
process engine where hosted in different machine and different port.? (If I
host camunda and my custom app on same server then I used default)

Here is my process.xml for default. Please let me know how to
inform my custom app to use different process-engine where it was hosted on
different machine.?

<process-application
  xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


  <process-archive name="investment_revised">
    <process-engine>default</process-engine>
    <properties>
      <property name="isDeleteUponUndeploy">false</property>
      <property name="isScanForProcessDefinitions">true</property>
    </properties>
  </process-archive>
```
 
Thanks alot for your qucik response.

</process-application>

 

Thanks a lot for your help.

Q1) I think you have to use another Camunda WebApp. The Tomcat distribution includes the Camunda WebApp for Tomcat, which packages all required JAX-RS dependencies. They will be probably conflicting with the ones already available in TomEE. You could try to remove the RestEasy JAX-RS dependencies and replace it’s configuration inside the webapp with the one required for CXF-RS.

Q2) Regarding the usage of your custom app with another process engine on a remote server - that it not possible. A process application can only be deployed to a process engine running on the local server.

Q1) I think you have to use another Camunda WebApp. The Tomcat distribution includes the Camunda WebApp for Tomcat, which packages all required JAX-RS dependencies.
They will be probably conflicting with the ones already available in
TomEE. You could try to remove the RestEasy JAX-RS dependencies and
replace it’s configuration inside the webapp with the one required for
CXF-RS.

A) Sure, I will try. Could you please send the link of another webapp which I can use for tomee deployment. ( I mean, without JAX-RS package…)

Q2) Regarding the usage of your custom app with another process engine on a remote server - that it not possible. A process application can only be deployed to a process engine running on the local server.

A) so I have to deploy my custom app and camunda on same TomEE server with same machine???

Q1) If I remember right, I used the WebApp of the Glassfish distribution. It contains no additional JAX-RS stuff. You have to adjust the JAX-RS provider config although.

Q2) Yes, when you have a process application, which I suspect your custom app is, you have to deploy it on the same machine.
Another architecture would be that you have two application:

  • a process application deployed on the Camunda server (which includes all processes and the required resources / beans etc.) and
  • a custom application (no processes included) which uses the Camunda REST API to talk to the process engine (start processes, read variables, claim and submit user tasks etc.).

The drawback of that approach is that you cannot access the process application on the Camunda server directly. Basically in this scenario it is a black box and you call it as a service and retrieve the result within your custom application.

Maybe you could describe you deployment/architecture scenario in a separate thread to validate your approach?

Cheers,
Christian

Got it. Thank you.

Yes, My architecture is deploying camunda and custom app on the same server so far. My custom app pom.xml has some camunda dependences so that I am using camunda api calls in my cusmapp java code and jsf also before staring a request. The communication to camunda engine is thru process.xml (default). This is basically your pizza-order app architecture.

Now I am thinking to use different server/machine for camunda app and give those server details in my custom app process.xml. It seems to be that is not possbile based on your previous response. Otherwise I have to use rest calls.

Thanks.