如何使用jdk 1.6.0_20在Eclipse 3.6中配置tomcat 7?

时间:2010-09-26 00:09:19

标签: java eclipse tomcat

我在Eclipse 3.6上配置tomcat 7时遇到了一些问题。环境是一个带有o.s.的笔记本电脑。 Windows 7家庭高级版64位。 在升级之前,我在Eclipse 3.6上使用tomcat 6成功地工作,但是我对新tomcat的开关是邪恶的!我重复我用来配置tomcat 6的所有指令,但它不起作用!

如果我在未安装受监控应用程序的情况下在eclipse中启动tomcat,那么当我添加一个应用程序时,它会崩溃。我错过了什么?

这是tomcat日志:

26-set-2010 2.02.24 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_20\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.6.0_20\jre\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\putty;C:\Program Files\SlikSvn\bin\;C:\Program Files (x86)\OpenLDAP\kfw\Binary;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;C:\Program Files\SlikSvn
26-set-2010 2.02.25 org.apache.tomcat.util.digester.SetPropertiesRule begin
AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DocSourcesProject' did not find a matching property.
26-set-2010 2.02.25 org.apache.tomcat.util.digester.Digester endElement
GRAVE: End event threw exception
java.lang.NullPointerException
    at org.apache.catalina.core.StandardContext.getObjectNameKeyProperties(StandardContext.java:5551)
    at org.apache.catalina.core.StandardContext.setNamingResources(StandardContext.java:1757)
    at org.apache.catalina.core.StandardContext.getNamingResources(StandardContext.java:1735)
    at org.apache.catalina.startup.SetNextNamingRule.end(SetNextNamingRule.java:99)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:180)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1544)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:515)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
26-set-2010 2.02.25 org.apache.catalina.startup.Catalina load
AVVERTENZA: Catalina.start using conf/server.xml: 
java.lang.NullPointerException
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2688)
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2714)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1061)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:180)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1544)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:515)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NullPointerException
    at org.apache.catalina.core.StandardContext.getObjectNameKeyProperties(StandardContext.java:5551)
    at org.apache.catalina.core.StandardContext.setNamingResources(StandardContext.java:1757)
    at org.apache.catalina.core.StandardContext.getNamingResources(StandardContext.java:1735)
    at org.apache.catalina.startup.SetNextNamingRule.end(SetNextNamingRule.java:99)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)
    ... 20 more
26-set-2010 2.02.25 org.apache.tomcat.util.digester.SetPropertiesRule begin
AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DocSourcesProject' did not find a matching property.
26-set-2010 2.02.25 org.apache.tomcat.util.digester.Digester endElement
GRAVE: End event threw exception
java.lang.NullPointerException
    at org.apache.catalina.core.StandardContext.getObjectNameKeyProperties(StandardContext.java:5551)
    at org.apache.catalina.core.StandardContext.setNamingResources(StandardContext.java:1757)
    at org.apache.catalina.core.StandardContext.getNamingResources(StandardContext.java:1735)
    at org.apache.catalina.startup.SetNextNamingRule.end(SetNextNamingRule.java:99)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:180)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1544)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:515)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:564)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
26-set-2010 2.02.25 org.apache.catalina.startup.Catalina load
AVVERTENZA: Catalina.start using conf/server.xml: 
java.lang.NullPointerException
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2688)
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2714)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1061)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:180)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1544)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:515)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:564)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: java.lang.NullPointerException
    at org.apache.catalina.core.StandardContext.getObjectNameKeyProperties(StandardContext.java:5551)
    at org.apache.catalina.core.StandardContext.setNamingResources(StandardContext.java:1757)
    at org.apache.catalina.core.StandardContext.getNamingResources(StandardContext.java:1735)
    at org.apache.catalina.startup.SetNextNamingRule.end(SetNextNamingRule.java:99)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)
    ... 20 more
26-set-2010 2.02.25 org.apache.catalina.startup.Catalina start
GRAVE: Cannot start server. Server instance is not configured.

1 个答案:

答案 0 :(得分:3)

WTP 3.2中似乎存在与Tomcat 7结合的问题。此问题也在Eclipse论坛的this topic中讨论过。原因和解决方法描述如下:

  

看起来启动过程在Tomcat 7中发生了变化   当{server}中的<ResourceLink>的一部分被处理时,<context>   在服务器充分初始化之前。如果您打开服务器   Eclipse中的编辑器和启用“发布模块上下文分离”   XML文件“选项,我相信你会避免这个问题。我会看到   强制在WTP 3.2.1中为Tomcat 7服务器启用此选项。