2

我有一个安装了 CentOS 和Tomcat6的 linux 服务器。我正在尝试部署我的 jsf 应用程序,并为我的项目创建了一个 war 文件。我正在使用 Tomcat 管理器,使用位于服务器上的 Deploy 目录或 WAR 文件,参数如下在此处输入图像描述

按照建议,我的战争文件位于 wepapps 目录中。比我将上下文路径提供给我的应用程序名称(如/myapp )并为WAR 或目录 URL提供我的应用程序的 url,如/var/lib/tomcat6/webapps/myapp.war,最后我将值留空XML 配置。当我按下部署按钮时,消息说在上下文路径 /myapp 部署应用程序失败

由于这是我在服务器上部署应用程序的第一次体验,我不确定我是否做得对。我已经搜索了很多文档,但仍然找不到有用的解释来启动我的应用程序。我真的很困惑,需要你的帮助吗?

这是我的 catalina 日志文件

 Sep 5, 2013 1:38:37 p.m. org.apache.tomcat.util.digester.Digester startElement
    SEVERE: Begin event threw error
    java.lang.NoClassDefFoundError: org.apache.tomcat.util.modeler.ManagedBean
       at java.lang.Class.initializeClass(libgcj.so.10)
       at java.lang.Class.newInstance(libgcj.so.10)
       at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:145)
       at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
       at gnu.xml.stream.SAXParser.parse(libgcj.so.10)
       at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1556)
       at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.execute(MbeansDescriptorsDigesterSource.java:238)
       at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.loadDescriptors(MbeansDescriptorsDigesterSource.java:216)
       at org.apache.tomcat.util.modeler.Registry.load(Registry.java:689)
       at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:800)
       at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:780)
       at org.apache.catalina.mbeans.MBeanUtils.createRegistry(MBeanUtils.java:1066)
       at org.apache.catalina.mbeans.MBeanUtils.<clinit>(MBeanUtils.java:95)
       at java.lang.Class.initializeClass(libgcj.so.10)
       at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.<clinit>(GlobalResourcesLifecycleListener.java:68)
       at java.lang.Class.initializeClass(libgcj.so.10)
       at java.lang.Class.newInstance(libgcj.so.10)
       at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:145)
       at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
       at gnu.xml.stream.SAXParser.parse(libgcj.so.10)
       at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
       at org.apache.catalina.startup.Catalina.load(Catalina.java:617)
       at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
       at java.lang.reflect.Method.invoke(libgcj.so.10)
       at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
       Sep 5, 2013 1:47:15 p.m. org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw error
java.lang.NoClassDefFoundError: org.apache.tomcat.util.modeler.ManagedBean
   at java.lang.Class.initializeClass(libgcj.so.10)
   at java.lang.Class.newInstance(libgcj.so.10)
   at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:145)
   at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
   at gnu.xml.stream.SAXParser.parse(libgcj.so.10)
   at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1556)
   at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.execute(MbeansDescriptorsDigesterSource.java:238)
   at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.loadDescriptors(MbeansDescriptorsDigesterSource.java:216)
   at org.apache.tomcat.util.modeler.Registry.load(Registry.java:689)
   at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:800)
   at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:780)
   at org.apache.catalina.mbeans.MBeanUtils.createRegistry(MBeanUtils.java:1066)
   at org.apache.catalina.mbeans.MBeanUtils.<clinit>(MBeanUtils.java:95)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.<clinit>(GlobalResourcesLifecycleListener.java:68)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at java.lang.Class.newInstance(libgcj.so.10)
   at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:145)
   at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
   at gnu.xml.stream.SAXParser.parse(libgcj.so.10)
   at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
   at org.apache.catalina.startup.Catalina.load(Catalina.java:617)
   at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
   at java.lang.reflect.Method.invoke(libgcj.so.10)
   at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.lang.ClassNotFoundException: javax.management.modelmbean.ModelMBeanNotificationBroadcaster not found in org.apache.catalina.loader.StandardClassLoader{urls=[file:/usr/share/apache-tomcat-7.0.42/lib/,file:/usr/share/apache-tomcat-7.0.42/lib/catalina-tribes.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-coyote.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-dbcp.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-util.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-jdbc.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-i18n-ja.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-i18n-fr.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-api.jar,file:/usr/share/apache-tomcat-7.0.42/lib/ecj-4.2.2.jar,file:/usr/share/apache-tomcat-7.0.42/lib/catalina-ha.jar,file:/usr/share/apache-tomcat-7.0.42/lib/catalina-ant.jar,file:/usr/share/apache-tomcat-7.0.42/lib/jsp-api.jar,file:/usr/share/apache-tomcat-7.0.42/lib/jasper.jar,file:/usr/share/apache-tomcat-7.0.42/lib/catalina.jar,file:/usr/share/apache-tomcat-7.0.42/lib/tomcat-i18n-es.jar,file:/usr/share/apache-tomcat-7.0.42/lib/annotations-api.jar,file:/usr/share/apache-tomcat-7.0.42/lib/el-api.jar,file:/usr/share/apache-tomcat-7.0.42/lib/jasper-el.jar,file:/usr/share/apache-tomcat-7.0.42/lib/servlet-api.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/apache-tomcat-7.0.42/bin/bootstrap.jar,file:/usr/share/apache-tomcat-7.0.42/bin/tomcat-juli.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.VMClassLoader.defineClass(libgcj.so.10)
   at java.lang.ClassLoader.defineClass(libgcj.so.10)
   at java.security.SecureClassLoader.defineClass(libgcj.so.10)
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.Class.forName(libgcj.so.10)
   at java.lang.Class.initializeClass(libgcj.so.10)
   ...25 more

谢谢并恭祝安康

4

2 回答 2

0

好吧,我已经把这个问题做空了

Step 1:-
Install JDK 1.7.0

step 2:-
Just include Jre Directory when you are Making TOMCAT Server 7. just goto Installed Jre and Just select ADD in option in that and GOTO the Location of your JRE and add that Folder that.

Step3:-
after adding that finish server installation and run your server.

这样就行了。

于 2013-10-09T07:17:08.710 回答
0

我终于解决了这个问题。错误的原因其实很简单。我们配置了我们的项目并使用 tomcat7 创建了 war 文件。因此,当我们尝试在具有先前版本的 tomcat (tomcat6) 的服务器上部署和运行时,它不起作用。所以我们在该服务器上安装了 tomcat7,它现在​​可以工作了。可能是因为 tomcat6 不支持 servlet3 和一些 jsf fauters。再次感谢。

于 2013-09-06T07:50:36.280 回答