2014-06-06 26 views
1

我提前道歉 - 爲什麼可能是一個常見的錯誤,但經過幾天試圖找出它......我認爲它看起來戰爭文件想要一個不同的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-上。

預先感謝您的時間和關注!

+0

卡塔利娜出局行爲經常你有錯誤的庫集合部署。 –

+0

你確定Tomcat也使用Java 8嗎? 51.0是Java 7,所以它看起來像是在運行Java 6運行時。查看bin目錄中的env.sh和startup.sh。 –

+0

看着setenv.sh和startup.sh - 我找不到指向JDK的東西。我知道這是JDK的問題,但我無法弄清楚它需要哪個JDK以及如何提供它。 –

回答

1

我可能已經解決了這個問題。

我安裝了openjdk 1.7。然後,我編輯了/etc/init.d/tomcat7並設置了JDK_DIRS =「/ usr/lib/jvm/java-1.7.0-openjdk-i386」。

Tomcat重新啓動成功,戰爭文件開始... kindof ...應用程序沒有完全工作,但這是現在的DEVs問題。它從Tomcat/Java POV出現 - 此問題已解決。

0

它看起來像您在App Server中以不同的JDK版本編譯,嘗試使用相同的jdk進行編譯。

+0

我同意 - 但我不是DEV,不能輕易影響這個,我可以訪問服務器和Tomcat,所以我試圖通過這種方式解決它。 –