我提前道歉 - 爲什麼可能是一個常見的錯誤,但經過幾天試圖找出它......我認爲它看起來戰爭文件想要一個不同的java jdk ...但我現在已經嘗試了下面的這個版本以及openjdk 1.6和1.7。試圖啓動一個戰爭文件 - 獲取錯誤 - 需要幫助理解catalina.out
Tomcat7在Wheezy上運行。這裏是我的JDK版本:
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Server VM (build 25.5-b02, mixed mode)
這裏是我的$ JAVA_HOME:
/usr/local/java/jdk1.8.0_05
這裏是我的 「catalina.out的」:
INFO: Deploying web application archive /var/lib/tomcat7/webapps/my_app.war
Jun 6, 2014 2:22:50 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/my_app/WEB-INF/lib/javax.servlet-api-3.1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
...
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.myco.mydata.controller.ShowmydataController] for bean with name 'showmydataController' defined in file [/var/lib/tomcat7/webapps/my_app/WEB-INF/classes/com/myco/mydata/controller/ShowmydataController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/myco/mydata/controller/ShowmydataController : Unsupported major.minor version 51.0 (unable to load class com.myco.mydata.controller.ShowmydataController)
...
Caused by: java.lang.UnsupportedClassVersionError: com/myco/mydata/controller/ShowmydataController : Unsupported major.minor version 51.0 (unable to load class com.myco.mydata.controller.ShowmydataController)
...
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.myco.mydata.controller.ShowmydataController] for bean with name 'showmydataController' defined in file [/var/lib/tomcat7/webapps/my_app/WEB-INF/classes/com/myco/mydata/controller/ShowmydataController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/myco/mydata/controller/ShowmydataController : Unsupported major.minor version 51.0 (unable to load class com.myco.mydata.controller.ShowmydataController)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1330) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1396) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:385) [spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:354) [spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:97) ~[spring-context-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609) ~[spring-context-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) ~[spring-context-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5284) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.6.0_31]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.6.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) ~[na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.6.0_31]
at java.lang.Thread.run(Thread.java:701) ~[na:1.6.0_31]
...
和SO-上。
預先感謝您的時間和關注!
卡塔利娜出局行爲經常你有錯誤的庫集合部署。 –
你確定Tomcat也使用Java 8嗎? 51.0是Java 7,所以它看起來像是在運行Java 6運行時。查看bin目錄中的env.sh和startup.sh。 –
看着setenv.sh和startup.sh - 我找不到指向JDK的東西。我知道這是JDK的問題,但我無法弄清楚它需要哪個JDK以及如何提供它。 –