myeclipse里关闭tomcat server时报错:ERROR: JDWP Unable to get JNI 1.2 environment

caterpillarlover 2010-10-25 09:04:01
各位大侠好,小弟才接触myeclipse时间不长,在myeclipse里启动tomcat时没有报错,关闭时经常报错,报错信息如下:
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]

操作系统是win xp pro sp3 en,myeclipse的版本是8.6-20100723,jdk的版本是1.6.0_22,tomcat是6.0.29。

stop server时的全部信息如下:
Oct 25, 2010 8:54:17 PM 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_22\bin;D:\Myeclipse\apache-tomcat-6.0.29\bin
Oct 25, 2010 8:54:18 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Oct 25, 2010 8:54:18 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 764 ms
Oct 25, 2010 8:54:18 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 25, 2010 8:54:18 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Oct 25, 2010 8:54:18 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Oct 25, 2010 8:54:18 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Oct 25, 2010 8:54:18 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Oct 25, 2010 8:54:18 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Oct 25, 2010 8:54:19 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Oct 25, 2010 8:54:19 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Oct 25, 2010 8:54:19 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Oct 25, 2010 8:54:19 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Oct 25, 2010 8:54:19 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 25, 2010 8:54:19 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47 config=null
Oct 25, 2010 8:54:19 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1264 ms
Oct 25, 2010 8:54:24 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Oct 25, 2010 8:54:25 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]
...全文
1711 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
Daniel2081 2012-03-15
  • 打赏
  • 举报
回复
但愿是手误,应该是System.exit(0);//终止JVM[Quote=引用 16 楼 zhtbin 的回复:]
System.exist(0);
[/Quote]
ww54653520 2011-12-22
  • 打赏
  • 举报
回复
你开socket或是流了吧,或是干什么没有关闭
钟超 2011-12-15
  • 打赏
  • 举报
回复
对!

[Quote=引用 16 楼 zhtbin 的回复:]

System.exist(0);
[/Quote]
zhtbin 2011-11-24
  • 打赏
  • 举报
回复
System.exist(0);
阿旺_liu 2011-10-25
  • 打赏
  • 举报
回复
这个和tomcat没有关系!楼上说得对,这个不是个错误 只是个警告而已 ,但是和电脑重启不重启没有关系的!
小祥V5 2010-11-02
  • 打赏
  • 举报
回复
这个不是个错误 只是个警告而已
你的电脑卡的话有可能出现 你重启就好了
caterpillarlover 2010-10-29
  • 打赏
  • 举报
回复
to jxsryecheng:

Tomcat的时候运行参数我也改过,但是没有改那么大。我的计算机一共才1.2G内存,改成 -Xmx1024M 合适吗?

另外我用了myeclipse自带的tomcat,也非常经常地出现这个问题。
caterpillarlover 2010-10-29
  • 打赏
  • 举报
回复
谢谢楼上各位,我的tomcat本身就不是安装的,我只是把tomcat的zip包解压,在myeclipse里指定了路径而已。
而且我再次开服务是正常的,再次关闭服务还是有报上面的错。

同样的方法、同样的目录结构在另一台配置稍高一点点的电脑上就没有这个问题。

tomcat 5 正在试。
o0ooooooot 2010-10-28
  • 打赏
  • 举报
回复
两次运行就可以了,不会有错
zhengqiqiqinqin 2010-10-28
  • 打赏
  • 举报
回复
好像是Tomcat6.0有点问题,你要是用5.0的话, 正常配置应该不会出现问题,我以前也用6.0的 经常出问题,问过一些开发人员,他们都这样反应,现在用5.0的就没出过问题。。
Achilles_Dynasty 2010-10-28
  • 打赏
  • 举报
回复
D:\Myeclipse\apache-tomcat-6.0.29\bin你把tomcat装在Myeclipse目录里了?
建议卸载tomcat,装在其他的目录下。重新把Myeclipse和tomcat关联。

或是先关闭Myeclipse,然后删掉MyEclipse工作区间\.metadata\下面的.me_tcat文件夹。重启动试试看。

你这个错误真的不常见。
十橙心橙意 2010-10-28
  • 打赏
  • 举报
回复
是不是给Tomcat启动分配的内存低了点呢!

在配置Tomcat的时候运行参数-Xms256M -Xmx1024M?

如果不知道在哪的话回复我!

zqm211211 2010-10-28
  • 打赏
  • 举报
回复
虽然不知道,但还是顶起来,期望高手解答!!
caterpillarlover 2010-10-26
  • 打赏
  • 举报
回复
各位大哥再帮帮忙呀
caterpillarlover 2010-10-25
  • 打赏
  • 举报
回复
我也试过配置myeclipse.ini,问题依旧。

-startup
../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-install
D:/myeclipse/MyEclipse
-vm
D:/myeclipse/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin/client/jvm.dll
-configuration
configuration
-vmargs
-Xmx512m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=64m


weirdman 2010-10-25
  • 打赏
  • 举报
回复
没遇到过,不清楚
帮顶了
caterpillarlover 2010-10-25
  • 打赏
  • 举报
回复
小弟配置Tomcat时还真没有参考相关文档,只是改了一下conf的用户名和密码。
如果是tomcat没有配置好,会不会连启动都报错呢?我启动tomcat时没有报错呀。
caterpillarlover 2010-10-25
  • 打赏
  • 举报
回复
谢谢楼上,我在网上找了一下这个error,有人说是与内存有关。

http://java.itags.org/java-essentials/19482/

answer:

when jvm did'nt flushed the last compiled result
because of less memory it gives this error ........
十橙心橙意 2010-10-25
  • 打赏
  • 举报
回复
这个错误不常见,我觉得有可能是你配置Tomcat的时候有问题。

不知道你配置Tomcat是不是按照相关文档的。

JNI找不到你的虚拟机吧?Tomcat配置的时候看看JDK有没有配置好。

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧