class版本问题导致-严重: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/web

     在eclipse-ee中启动tomcat运行java web项目,没有出现问题,但是单独启动tomcat时就报下面错误

2013-9-30 9:46:36 org.apache.tomcat.util.modeler.Registry registerComponent
严重: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/web
,J2EEApplication=none,J2EEServer=none
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.UnsupportedClassVersionError: com/baby/util/Onli
neUserListenNew : Unsupported major.minor version 51.0 (unable to load class com
.baby.util.OnlineUserListenNew)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:2531)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:1010)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1483)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1361)
        at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebA
nnotationSet.java:145)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerA
nnotations(WebAnnotationSet.java:73)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotatio
ns(WebAnnotationSet.java:56)

 

            经过一个小时的观察,最终发现问题原因是class版本太高问题,因为我是用eclipse-ee开发的,在eclipse-ee中,我用的是jdk7开发的,因此把项目部署到tomcat中时,默认用的是项目的jdk7进行编译java文件,然后和项目一起发布到tomcat里面,这个时候如果是在eclipse-ee中启动tomcat,那么此时tomcat用的是eclipse-ee中项目默认的jdk,因此也是用jdk7进行启动tomcat的,因此可以正常启动tomcat。


       但是如果单独启动tomcat,因为我在电脑属性里面设置的java_home是jdk6,这个时候,如果单独启动tomcat,那么tomcat用的就是电脑属性里面的java_home,即jdk6,那么在启动的过程中,tomcat在加载class文件时,就会报class版本错误,如上“Unsupported major.minor version 51.0”,因为java是向下兼容的,即jdk7能兼容小于jdk7编译的class文件,jdk6能兼容小于jdk6编译的class文件,jdk6能不能兼容jdk7编译的class文件,所以报上面错误

 

        解决办法

                  1、修改eclipse-ee中项目用的jdk7为jdk6,
                  2、修改电脑属性里面设置的java_home是jdk7
                 3、修改catalina.bat,在第二行,加上下面这句话 set JAVA_HOME="D:\soft\apache-tomcat-6.0.26\jdk1.7.0_03"      即修改tomcat使用jdk7启动

 

 

展开阅读全文

严重: Null component Catalina:type=JspMonitor请教该问题

01-18

大家好,我的一个SSH项目,在myeclipse中启动tomcat,提示以下错误:rnrn2009-1-18 3:11:25 org.apache.catalina.core.AprLifecycleListener initrn信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\MyEclipse-6.0M1\bin;D:\Tomcat 6.0\binrn2009-1-18 3:11:26 org.apache.coyote.http11.Http11Protocol initrn信息: Initializing Coyote HTTP/1.1 on http-8080rn2009-1-18 3:11:26 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 4172 msrn2009-1-18 3:11:27 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2009-1-18 3:11:27 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/6.0.10rn2009-1-18 3:11:32 org.apache.tomcat.util.modeler.Registry registerComponentrn严重: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/sshnews,J2EEApplication=none,J2EEServer=nonernjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.UnsupportedClassVersionError: Bad version number in .class filern at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(Unknown Source)rn at java.security.SecureClassLoader.defineClass(Unknown Source)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:145)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:84)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:57)rn at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)rn at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4238)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn ... 6 morernrnrn我在网上搜的解决方案是更换JRE版本。然后我在myeclipse中的project菜单中的property中,更改JDK compliance分别为1.3,1.4,5.0都不行。在myeclipse中的windows菜单中的preference中修改jre为5.0也不行。用myeclipse自带的JRE也不行。很着急,请大家给出出主意,谢谢! 论坛

Null component Catalina 问题

09-13

在lib下边加入Catalina .jar包,然后import org.apache.catalina.session.StandardSessionFacade;之后编译,启动tomcat出现如下问题,请高手指点!!rn严重: Null component Catalina:type=DataSource,path=/Test,host=localhost,class=javax.sql.DataSource,name="jdbc/db2"rn2010-9-10 16:31:40 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn2010-9-10 16:31:42 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourcetarget' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name java:comp is not bound in this Contextrnat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)rnat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rnat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rnat java.security.AccessController.doPrivileged(Native Method)rnat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rnat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rnat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rnat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rnat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rnat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rnat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rnat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rnat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rnat org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rnat org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rnat org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rnat org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)rnat org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)rnat org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rnat org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rnat org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rnat org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)rnat org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)rnat org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)rnat org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rnat org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rnat org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rnat org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rnat org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rnat org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rnat org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rnat org.apache.catalina.core.StandardService.start(StandardService.java:519)rnat org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rnat org.apache.catalina.startup.Catalina.start(Catalina.java:581)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rnat java.lang.reflect.Method.invoke(Method.java:597)rnat org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rnat org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: javax.naming.NameNotFoundException: Name java:comp is not bound in this Contextrnat org.apache.naming.NamingContext.lookup(NamingContext.java:770)rnat org.apache.naming.NamingContext.lookup(NamingContext.java:153)rnat javax.naming.InitialContext.lookup(InitialContext.java:392)rnat org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)rnat org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)rnat org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)rnat org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)rnat org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)rnat org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)rnat org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)rnat org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186) 论坛

没有更多推荐了,返回首页