设为首页 收藏本站
查看: 397|回复: 0

[经验分享] Eclipse中启动Tomcat无任何反应收藏

[复制链接]

尚未签到

发表于 2017-2-3 06:28:48 | 显示全部楼层 |阅读模式
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、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-336690-1-1.html 上篇帖子: Tomcat集群与负载均衡区别以及特性 下篇帖子: 转载: 关于TOMCAT的集群和负载均衡
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表