求助,启动tomcat报can not find main class这个错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了求助,启动tomcat报can not find main class这个错误相关的知识,希望对你有一定的参考价值。

一、首先检查tomcat 是否是安装版;

二、如果不是安装版,则查看环境变量catalina_home 和java_home是否已经配置;

三、安装版的tomcat在安装向导中有选择jdk,所以不需要自行配置环境变量,免安装版的要注意环境变量的问题。
参考技术A 没有主方法,检查一下看有没有main方法
public static void main(String[] args)


像这样的方法本回答被提问者和网友采纳

tomcat启动时候报错Can't convert argument: null

一、启动报错: 为了避免导入的项目重名,我先修改了前一个项目的名称。 重新启动该项目至tomcat,报错:java.lang.IllegalArgumentException: Cant convert argum......

技术分享
一、启动报错:
为了避免导入的项目重名,我先修改了前一个项目的名称。
重新启动该项目至tomcat,报错:java.lang.IllegalArgumentException: Can‘t convert argument: null
二、发现问题:
因为MyEclipse在修改项目名时候,自动更新部署了web.xml文件并且重新生成了xml文件的头部声明. 新增了java的命名把这个javaee去掉就可以了,一般情况下他会修改servlet的配置。
三、解决问题:
修改项目后之后的web.xml仔细观察标签下的子标签是否多了一个javaee你把这个删除掉即可。
四、报错信息如下:
java.lang.IllegalArgumentException: Can‘t convert argument: null
at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:999)
at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:523)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1140)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1066)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
问题是由于在Eclipse下重构JEE项目名时,Eclipse自动更新了部署文件web.xml,重新生成了xml文件的头部声明,新增加了javaee的命名空间:如下
<servlet>
  <javaee:display-name>MessageBrokerServlet</javaee:display-name>
  <servlet-name>MessageBrokerServlet</servlet-name>
  <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
  <init-param>
    <javaee:param-name>services.configuration.file</javaee:param-name>
    <javaee:param-value>/WEB-INF/flex/services-config.xml</javaee:param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>
将标签 <javaee:param-name> 的javaee:删掉就完美解决问题。





























































以上是关于求助,启动tomcat报can not find main class这个错误的主要内容,如果未能解决你的问题,请参考以下文章

tomcat启动控制台报Exception in thread ''main".......“Could not find the main class:.....Boots

IDEA 启动项目时报错:Error running tomcat Can‘t find catalina.jar解决办法

Tomcat 启动出现警告问题Setting property 'minSpar eThreads' to '25' did not find a matching p

IntelliJ IDEA启动tomcat6.0报错,求助!!!!!!!!!!!!!

问题解决方案之 jmeter启动报错:Not able to find Java executable or version. Please check your Java installatio(代

tomcat启动时候报错Can't convert argument: null