1

I have java web application which was working earlier. I upgraded it to JDK 8, and compiled the code with JDK 1.7 compliance setting. I am however getting the below error when I start the server. I actually removed all references to JDK 8 and using JDK 7, still I get the below error.

Apr 02, 2016 10:36:06 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_79\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Program Files (x86)\Skype\Phone\;.
Apr 02, 2016 10:36:06 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:eEducation' did not find a matching property.
Apr 02, 2016 10:36:06 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 02, 2016 10:36:06 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 02, 2016 10:36:06 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 997 ms
Apr 02, 2016 10:36:06 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 02, 2016 10:36:06 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Apr 02, 2016 10:36:09 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/eEducation]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/eEducation]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 6 more
Caused by: java.lang.UnsupportedClassVersionError: com/sun/faces/config/FacesInitializer : Unsupported major.minor version 52.0 (unable to load class com.sun.faces.config.FacesInitializer)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2948)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:187)
    at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:152)
    at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1543)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1265)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:873)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more

Apr 02, 2016 10:36:09 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more

Apr 02, 2016 10:36:09 AM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 11 more

Apr 02, 2016 10:36:09 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Apr 02, 2016 10:36:09 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Apr 02, 2016 10:36:09 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Apr 02, 2016 10:36:09 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Apr 02, 2016 10:36:09 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

I have checked all my build paths and JRE

I have checked that the jsf-impl.jar is complied with Major 49 version (Java 1.5). But the error which I am getting is from a class in this jar

Caused by: java.lang.UnsupportedClassVersionError: com/sun/faces/config/FacesInitializer : Unsupported major.minor version 52.0 (unable to load class com.sun.faces.config.FacesInitializer)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2948)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)

I have tried all permutation and combination but it still doesn't work. Attached are the screenshots of my project's JDK settings.

here are the images of my settings

Compiler Settings

Compiler Settings

Java Build Path

I can assure you that my Tomcat 7.0 is also running on JRE 1.7 (Unfortunately I cannot post more than 2 links)

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
Gaurav
  • 13
  • 1
  • 5
  • Yes Balus C. It is not JSF 1.0. My bad. Here are the classfiles in the /WEB-INF/lib folder. But note it works if I replace the JDK with the version 1.8. – Gaurav Apr 02 '16 at 20:04
  • antlr-2.7.6.jar aopalliance.jar charts4j-1.3.jar commons-collections-3.1.jar commons-collections-3.2.1.jar commons-el-1.0.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-lang-2.6.jar commons-logging-1.1.1.jar docx4j-2.8.0.jar dom4j-1.6.1.jar dsn.jar hibernate-jpa-2.0-api-1.0.0.Final.jar hibernate-tools.jar hibernate3.jar imap.jar itext-xtra-5.1.1.jar itextpdf-5.1.1.jar javassist-3.12.0.GA.jar javax.faces-2.3.0-m04.jar jsf-api.jar jsf-impl.jar jta-1.1.jar junit-4.3.1.jar jxl.jar log4j-1.2.16.jar mailapi.jar mysql-connector-java-5.1.13-bin.jar – Gaurav Apr 02 '16 at 20:06
  • poi-3.8-20120326.jar poi-ooxml-3.8-20120326.jar poi-ooxml-schemas-3.8-20120326.jar poi-scratchpad-3.8-20120326.jar pop3.jar primefaces-3.4.1.jar serializer.jar slf4j-api-1.6.1.jar smtp.jar spring-aop-4.0.0.RELEASE-javadoc.jar spring-aop-4.0.0.RELEASE-sources.jar spring-aop-4.0.0.RELEASE.jar spring-aspects-4.0.0.RELEASE-javadoc.jar spring-aspects-4.0.0.RELEASE-sources.jar spring-aspects-4.0.0.RELEASE.jar spring-beans-4.0.0.RELEASE-javadoc.jar spring-beans-4.0.0.RELEASE-sources.jar spring-beans-4.0.0.RELEASE.jar spring-build-src-4.0.0.RELEASE.jar spring-context-4.0.0.RELEASE-javadoc.jar – Gaurav Apr 02 '16 at 20:08
  • spring-context-4.0.0.RELEASE-sources.jar spring-context-4.0.0.RELEASE.jar spring-context-support-4.0.0.RELEASE-javadoc.jar spring-context-support-4.0.0.RELEASE-sources.jar spring-context-support-4.0.0.RELEASE.jar spring-core-4.0.0.RELEASE-javadoc.jar spring-core-4.0.0.RELEASE-sources.jar spring-core-4.0.0.RELEASE.jar spring-expression-4.0.0.RELEASE-javadoc.jar spring-expression-4.0.0.RELEASE-sources.jar spring-expression-4.0.0.RELEASE.jar spring-framework-bom-4.0.0.RELEASE-javadoc.jar spring-framework-bom-4.0.0.RELEASE-sources.jar spring-framework-bom-4.0.0.RELEASE.jar – Gaurav Apr 02 '16 at 20:09
  • spring-framework-bom-4.0.0.RELEASE-sources.jar spring-framework-bom-4.0.0.RELEASE.jar spring-instrument-4.0.0.RELEASE-javadoc.jar spring-instrument-4.0.0.RELEASE-sources.jar spring-instrument-4.0.0.RELEASE.jar spring-instrument-tomcat-4.0.0.RELEASE-javadoc.jar spring-instrument-tomcat-4.0.0.RELEASE-sources.jar spring-instrument-tomcat-4.0.0.RELEASE.jar spring-jdbc-4.0.0.RELEASE-javadoc.jar spring-jdbc-4.0.0.RELEASE-sources.jar spring-jdbc-4.0.0.RELEASE.jar spring-jms-4.0.0.RELEASE-javadoc.jar spring-jms-4.0.0.RELEASE-sources.jar spring-jms-4.0.0.RELEASE.jar – Gaurav Apr 02 '16 at 20:10
  • spring-messaging-4.0.0.RELEASE-javadoc.jar spring-messaging-4.0.0.RELEASE-sources.jar spring-messaging-4.0.0.RELEASE.jar spring-orm-4.0.0.RELEASE-javadoc.jar spring-orm-4.0.0.RELEASE-sources.jar spring-orm-4.0.0.RELEASE.jar spring-oxm-4.0.0.RELEASE-javadoc.jar spring-oxm-4.0.0.RELEASE-sources.jar spring-oxm-4.0.0.RELEASE.jar spring-test-4.0.0.RELEASE-javadoc.jar spring-test-4.0.0.RELEASE-sources.jar spring-test-4.0.0.RELEASE.jar spring-tx-4.0.0.RELEASE-javadoc.jar spring-tx-4.0.0.RELEASE-sources.jar spring-tx-4.0.0.RELEASE.jar – Gaurav Apr 02 '16 at 20:10
  • spring-web-4.0.0.RELEASE-javadoc.jar spring-web-4.0.0.RELEASE-sources.jar spring-web-4.0.0.RELEASE.jar spring-webmvc-4.0.0.RELEASE-javadoc.jar spring-webmvc-4.0.0.RELEASE-sources.jar spring-webmvc-4.0.0.RELEASE.jar spring-webmvc-portlet-4.0.0.RELEASE-javadoc.jar spring-webmvc-portlet-4.0.0.RELEASE-sources.jar spring-webmvc-portlet-4.0.0.RELEASE.jar spring-websocket-4.0.0.RELEASE-javadoc.jar spring-websocket-4.0.0.RELEASE-sources.jar spring-websocket-4.0.0.RELEASE.jar stax-api-1.0.1.jar tomahawk-1.1.11.jar xml-apis.jar xmlbeans-2.3.0.jar – Gaurav Apr 02 '16 at 20:10
  • These are all the files – Gaurav Apr 02 '16 at 20:10
  • Next time just edit the question (and keep out Spring JAR clutter). – BalusC Apr 02 '16 at 20:20

1 Answers1

2

From your list of JARs,

  • javax.faces-2.3.0-m04.jar
  • jsf-api.jar
  • jsf-impl.jar

Provided that jsf-impl.jar is compiled with Java 1.5, then this indicates that it's JSF 2.0. You're thus basically mixing JSF 2.3 (beta) and JSF 2.0 in one and same webapp. This makes no sense. JSF 2.3 is compiled with Java 1.8 and JSF 2.0 is compiled with Java 1.5. As per your exception, the JSF 2.3 classes got precedence in classloading and are actually being used.

Get rid of the JSF 2.3 JAR file.

If you still continue running after "fixing" the Java version, you'd sooner or later face one of following problems caused by mixing multiple different versioned JSF libraries:

Just do not mix multiple JSF libraries.

See also:

Community
  • 1
  • 1
BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
  • By Jove, @BalusC you are a genius. Bingo. It solved it. I never could have imagined that I added 2 of the JSF implementation. I had been on this for a week now and you just did it no time. I am thankful and humbled. I cannot upvote this as I have to earn 15 reputations. The stackobverflow would not take it unfortunately. – Gaurav Apr 02 '16 at 20:31
  • You're welcome. No problem as to vote, you can always do it later. However, you can still mark the answer accepted when it helped most in understanding and solving the problem. See also http://meta.stackexchange.com/a/5235 – BalusC Apr 02 '16 at 20:53