Eclipse中启动Tomcat无任何反应

推动了软件业不断发展的可以说有3个方面的东西,过程,方法,技术。方法附会到哲学上应该就是方法论了,做很多事情都是需要方法的,比如写一篇案例,随心随意写也可以写出来,但是别人能否理解,如何检测自己描述清晰都是没有参考的。如果有个模板的,这样按照模板写,把模板填充了,自己的意思也表达清楚了,别人应该也可以理解了,因为模板就是成功经验的总结。这个案例按照我自己找的一个模板写。

 现象:

eclipse中安装了tomcat插件,tomcat原来是可以在eclipse中启动,后来无法启动,点击启动按钮无任何反应。

故障跟踪:

  在eclipse的console没有任何反应,是不是有文件日志。果然在eclisep当前的workspace下面的.metadata/ .log找到了错误日志,如下:

Eclipse中安装了tomcat插件

!ENTRY com.sysdeo.eclipse.tomcat 4 4 2008-07-16 23:52:11.687

!MESSAGE Impossible to start Tomcat

Check home directory setup in Tomcat preference page/n

 

!ENTRY com.sysdeo.eclipse.tomcat 4 4 2008-07-16 23:52:11.687

!MESSAGE org.eclipse.core.runtime.CoreException: Unable to parse XML document.

       at org.eclipse.debug.core.DebugPlugin.abort(DebugPlugin.java:1198)

       at org.eclipse.debug.core.DebugPlugin.parseDocument(DebugPlugin.java:1176)

       at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doInitializeFromMemento(AbstractSourceLookupDirector.java:410)

       at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.initializeFromMemento(AbstractSourceLookupDirector.java:546)

       at org.eclipse.debug.internal.core.LaunchConfiguration.initializeSourceLocator(LaunchConfiguration.java:566)

       at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:761)

       at com.sysdeo.eclipse.tomcat.VMLauncherUtility.runVM(VMLauncherUtility.java:95)

       at com.sysdeo.eclipse.tomcat.TomcatBootstrap.runTomcatBootsrap(TomcatBootstrap.java:202)

       at com.sysdeo.eclipse.tomcat.TomcatBootstrap.start(TomcatBootstrap.java:95)

       at com.sysdeo.eclipse.tomcat.actions.StartActionDelegate.run(StartActionDelegate.java:38)

       at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)

       at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)

       at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)

       at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)

       at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)

       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)

       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)

       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)

       at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)

       at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)

       at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)

       at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)

       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)

       at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)

       at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

       at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)

       at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)

       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)

       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)

       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)

       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)

       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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)

       at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)

       at org.eclipse.equinox.launcher.Main.run(Main.java:1169)

org.eclipse.core.runtime.CoreException[120]: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.

       at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(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.DOMParser.parse(Unknown Source)

       at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)

       at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)

       at org.eclipse.debug.core.DebugPlugin.parseDocument(DebugPlugin.java:1168)

       at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doInitializeFromMemento(AbstractSourceLookupDirector.java:410)

       at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.initializeFromMemento(AbstractSourceLookupDirector.java:546)

       at org.eclipse.debug.internal.core.LaunchConfiguration.initializeSourceLocator(LaunchConfiguration.java:566)

       at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:761)

       at com.sysdeo.eclipse.tomcat.VMLauncherUtility.runVM(VMLauncherUtility.java:95)

       at com.sysdeo.eclipse.tomcat.TomcatBootstrap.runTomcatBootsrap(TomcatBootstrap.java:202)

       at com.sysdeo.eclipse.tomcat.TomcatBootstrap.start(TomcatBootstrap.java:95)

       at com.sysdeo.eclipse.tomcat.actions.StartActionDelegate.run(StartActionDelegate.java:38)

       at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)

       at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)

       at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)

       at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)

       at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)

       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)

       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)

       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)

       at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)

       at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)

       at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)

       at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)

       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)

       at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)

       at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

       at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)

       at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)

       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)

       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)

       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)

       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)

       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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)

       at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)

       at org.eclipse.equinox.launcher.Main.run(Main.java:1169)

可以看到异常的原因是eclisep无法解析xml文件,xml文件可以认为是配置文件。回顾下eclipse环境是否有改动过?因为当时我在使用tomcat启动x工程,所以remove了tomcat context再试。结果还是一样的错误。

在错误打印出的堆栈信息中可以看到 AbstractSourceLookupDirector ,如果大家都eclipse中tomat的设置熟悉的话,可以想到tomcat有个Source Path的设置。在计算源代码路径中我去掉了x工程,结果tomcat可以启动了。找到了问题的原因,但是还不是根因。回顾了在x工程的配置的修改,结合错误信息,最终得到根因:buildpath的libraries中jar包的路径中 含有中文。这样导致启动tomcat的时候,tomcat插件计算路径的时候,不识别中文导致错误,从错误中可以看到:“ Invalid byte 2 of 2-byte UTF-8 sequence.“。这个应该属于tomcat的bug,或者需要修改某些设置,使得可以解析中文。至此,问题解决的了。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值