在搭建dorado eclipse开发环境时,我遇到了一个很有意思的问题,目前我还明白为什么,但问题终于被我查找出来了.改天有时间了再好好研究一下,先把问题记录于此.
先把配置开发环境的过程记录下来:
首先在jdk安装,tomcat解压,这两步是肯定没有问题的,所有我想问题肯定不会出在这.
然后就是安装dorado eclipse插件.
DoradoEclipsePlugin安装配置:
下载地址:
http://www.bstek.com/download?subpath=eclipse$2F/DoradoEclipsePlugin$2D1$2E2$2E5$2D20080917$2Eexe/ |
该插件是一个可执行程序,你需要在下载完成之后安装它。选择Eclipse安装目录的时候,选择你自己的Eclipse的安装路径。
全部安装完成之后,启动Eclipse,可以看到包含DoradoEclipsePlugin的Eclipse开发平台。
在Eclipse中配置Tomcat服务器,以便开发之后通过Eclipse平台启动应用服务器运行项目。配置方法:找到【Servers】—>【右键New】—>【Server】。
直 最后,可以启动服务验证是否配置成功。Tomcat选中点【右键】—>【Start】,最后你应该能看到控制台的打印信息,如下图所示:
打开Eclipse的Preferences配置DoradoEclipsePlugin的Server。步骤:【Window】—>【Preferences】—>【Dorado Studio】—>【Server】—>【Tomcat】。
点击【OK】完成配置。
点出上图中标记的按钮启动dorado服务,控制如打印信息如下所示:
2010-10-18 20:20:47 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server} Setting property 'debug' to '0' did not find a matching property.
2010-10-18 20:20:48 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property.
2010-10-18 20:20:48 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'debug' to '0' did not find a matching property.
2010-10-18 20:20:48 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-10-18 20:20:48 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 362 ms
2010-10-18 20:20:48 org.apache.catalina.core.StandardService start
信息: Starting service Tomcat-Standalone
2010-10-18 20:20:48 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
2010-10-18 20:20:48 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2010-10-18 20:20:48 org.apache.catalina.startup.Catalina start
信息: Server startup in 522 ms
上面配置成功是因为我用的是Tomcat 6.0.18版本.但我刚开始时使用是Tomcat 6.0.20版本,同样的配置顺序,除了Tomcat外,其余的东西也都一模一样,但不是配置不成功,在最后一步启动dorado服务时,都是会出现如下的错误:
2010-10-18 19:44:16 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server} Setting property 'debug' to '0' did not find a matching property.
2010-10-18 19:44:17 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property.
2010-10-18 19:44:17 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'debug' to '0' did not find a matching property.
2010-10-18 19:44:17 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-10-18 19:44:17 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 356 ms
2010-10-18 19:44:17 org.apache.catalina.core.StandardService start
信息: Starting service Tomcat-Standalone
2010-10-18 19:44:17 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.20
2010-10-18 19:44:17 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2010-10-18 19:44:17 org.apache.catalina.connector.MapperListener init
警告: Error registering contexts
java.lang.NullPointerException
at org.apache.catalina.connector.MapperListener.registerHost(MapperListener.java:332)
at org.apache.catalina.connector.MapperListener.init(MapperListener.java:129)
at org.apache.catalina.connector.Connector.start(Connector.java:1146)
at org.apache.catalina.core.StandardService.start(StandardService.java:531)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
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:413)
2010-10-18 19:44:17 org.apache.catalina.startup.Catalina start
信息: Server startup in 563 ms
把我都快整崩溃了.我刚开始以为是dorado eclipse插件的版本与ecllipse有问题,于是换了解压版的手动添加到eclipse 还是报这个错误,于是又到dorado官网(www.bstek.com)上下了bstek-ide-all-in-one-0.1.rar(包含eclipse与dorado eclipse插件)直接解压,然后配置,还是报这个错误.这时我已肯定不是dorado插件的问题了,于是开始看是不是tomcat的版本有问题,刚好公司使用的tomcat 版本与我家里的不一样,拷回来一试,果然成功了.这时我又使用我自己的tomcat6.0.20,还是报警告: Error registering contexts
java.lang.NullPointerException.
解决此问题的办法竟然是换tomcat,真崩溃!不知道其他版本的tomcat的结果是怎么样的.