Deployment error: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]

Hi Team,

I’m following the get started pages of your website: https://docs.camunda.org/get-started/bpmn20/project-setup/
I try to deploy the example Loan-approval application and followed each step exactly. The only difference is that the Process Application class doesn’t accept a public class LoanApprovalApplication. So I have changed that in: class LoanApprovalApplication

I use: Windows 10 and Eclipse 4.6.0 with Maven.
The default JRE definition in Eclipse is jdk1.8.0_101
JRE_HOME: C:\Program Files\Java\jdk1.8.0_101
The default Invoice application is running in Cockpit

The build of the loan-approval-0.1.0-SNAPSHOT.war is successful.
I copied the war file to C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps
Then I start C:\Camunda\camunda-bpm-tomcat-7.5.0\start-camunda

I get the following (part of a) catalina logfile:

19-Oct-2016 07:44:38.924 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.24
19-Oct-2016 07:44:38.954 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps\loan-approval-0.1.0-SNAPSHOT.war
19-Oct-2016 07:44:41.523 INFO [localhost-startStop-1] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-07015 Detected @ProcessApplication class ‘org.camunda.bpm.getstarted.loanapproval.LoanApprovalApplication’
19-Oct-2016 07:44:41.526 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/loan-approval-0.1.0-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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.IllegalArgumentException: Unable to create an instance of type [org.camunda.bpm.getstarted.loanapproval.LoanApprovalApplication]
at org.apache.catalina.core.ApplicationContext.addListener(ApplicationContext.java:1264)
at org.apache.catalina.core.ApplicationContextFacade.addListener(ApplicationContextFacade.java:647)
at org.camunda.bpm.application.impl.ServletProcessApplicationDeployer.onStartup(ServletProcessApplicationDeployer.java:79)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5156)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
… 10 more
Caused by: java.lang.IllegalAccessException: Class org.apache.catalina.core.DefaultInstanceManager can not access a member of class org.camunda.bpm.getstarted.loanapproval.LoanApprovalApplication with modifiers “”
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.Class.newInstance(Class.java:436)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:121)
at org.apache.catalina.core.ApplicationContext.addListener(ApplicationContext.java:1252)
… 14 more

19-Oct-2016 07:44:41.530 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps\loan-approval-0.1.0-SNAPSHOT.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/loan-approval-0.1.0-SNAPSHOT]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

19-Oct-2016 07:44:41.533 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps\loan-approval-0.1.0-SNAPSHOT.war has finished in 2,578 ms
19-Oct-2016 07:44:41.536 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps\camunda
19-Oct-2016 07:44:44.082 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
19-Oct-2016 07:44:44.501 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps\camunda has finished in 2,965 ms
19-Oct-2016 07:44:44.502 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps\camunda-invoice
19-Oct-2016 07:44:46.384 INFO [localhost-startStop-1] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-07015 Detected @ProcessApplication class ‘org.camunda.bpm.example.invoice.InvoiceProcessApplication’
19-Oct-2016 07:44:46.410 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
19-Oct-2016 07:44:46.417 INFO [localhost-startStop-1] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-08024 Found processes.xml file at file:/C:/Camunda/camunda-bpm-tomcat-7.5.0/server/apache-tomcat-8.0.24/webapps/camunda-invoice/WE

The invoice application is still running in Cockpit.
Any idea how to solve this? I can’t find an answer on internet. Please let me know if you need more information.

Thanks,
Arian

Hi @averbeek,

could you please attach your org.camunda.bpm.getstarted.loanapproval.LoanApprovalApplication.

Cheers,
Askar

Hi Askar,

See attached file and below screenshot of eclipse.

Regards,

Arian

@averbeek please make your class public and rename file accordingly.

You can read following articles to better understand why:
https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html

http://www.careerride.com/Java-servlet-life-cycle.aspx

Cheers,
Askar.

Hi Askar,

I have changed it (see below screenshot), but still get the same error.

Regards,

Arian

Hi Arian,

did you rerun maven clean package goals?

Hi,

I did run Maven clean (in Eclipse right button on Pom => Run as Maven clean). As a consequence the war is automatically removed. After that I did run Maven install (in Eclipse right button on Pom => Run as Maven install. The console reports BUILD SUCCESS.

I removed the old war file from C:\Camunda\camunda-bpm-tomcat-7.5.0\server\apache-tomcat-8.0.24\webapps. I copied-pasted the new war file to this directory and started camundo. Still the same error.

Regards,

Arian

HI @averbeek,

are you sure that sources got replaced properly? can you take a look in compiled classes if they are marked as public? Could you make sure that tomcat temp folders are cleaned?

Cheers,
Askar

Hi ,

I cleaned the complete target directory in Eclipse (Maven clean).

However there was still a file C:\Eclipse\WSLoanApproval\loan-approval\target\classes\META-INF\processes.xml with only 1 line: default false true

I have removed this file.

I removed the complete directory C:\Camunda\camunda-bpm-tomcat-7.5.0 and I unzipped the download again.

I created a war file within eclipse.

Also a new file processes.xml is created.

I placed the war in the webapps dir and started Camunda.

I received a new SEVERE Error. See attached logfile.

The invoice application still works.

Regards,

Arian

catalina.2016-10-20.log (43.9 KB)

Hi Asker,
Do you have any tips regarding the new error?
Regards,
Arian

Hi @averbeek,

could you please publish your project on github?

Cheers,
Askar.

Hi,

Sorry, I’m not familiar with Github. Attached the export of the Eclipse project (Version: Neon Release (4.6.0)). Does that also work for you?

Regards,

Arian Verbeek

Hi @averbeek,

export from eclipse would work too, but I cannot see an attachment. Could you put it on dropbox or google drive and send me a link?

Cheers,
Askar

Hi,

Hereby the link to Google-drive. Google Drive: Anmelden

Regards,

Arian

Hi @averbeek,

your processes.xml is corrupted. Please add following closing tag </process-application>. After that deployment works fine on clean distribution of tomcat.

Hope that helps,
Askar.

Hi Askar,

That solved the problem. Thanks a lot for your support.

Regards,

Arian