SAP-archive / cloud-bulletinboard-ads

This is the bulletinboard-ads sample application code used in the openSAP course: Cloud-Native Development with SAP Business Technology Platform (formerly SAP Cloud Platform).
Apache License 2.0
76 stars 99 forks source link

Excercise 6: NoClassDefFoundError: org/apache/commons/logging/LogFactory #9

Closed kedeggel closed 5 years ago

kedeggel commented 6 years ago

When I try to cf push, I get an error, so my app won't start:

   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1144)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1878)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT     at java.lang.Thread.run(Thread.java:748)
   2018-05-08T12:48:31.02+0200 [APP/PROC/WEB/0] OUT Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
...

I fixed this by adding

    <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
    </dependency>

to my pom.

nenaraab commented 6 years ago

Hi,

this is interesting. Which java buildpack have you used?

Maybe i had a transitive dependency on it and therefore no issue?

Thanks for clarification. Nena