【求助】J2EE运行项目时遇到问题

tzimiscecat 2013-06-26 04:45:24
我是J2EE的初学者,刚开始学,就按着书上的小例子运用myeclipse10.6和tomcat6.0(郑阿奇版的javaee 使用教程)来验证struts2的使用。。。结果在运行时网页总是显示404错误,把tomcat里的web.xml中的false改成ture也没用。想求高手来帮忙看看ORZ。。。。不然暑假作业交不出会很惨的。。。(我用的struts包是struts2.3.14.3版本的)我建立的项目名叫Struts2使用(h)(t)(t)(p)(:)(//)和(w)(w)(w)是为了防吞。。。你懂得
我的web.xml配置:
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5"
xmlns="(h)(t)(t)(p)(:)(//)java.sun.com/xml/ns/javaee"
xmlns:xsi="(h)(t)(t)(p)(:)(//)(w)(w)(w).w3.org/2001/XMLSchema-instance" xsi:schemaLocation="(h)(t)(t)(p)(:)(//)java.sun.com/xml/ns/javaee
(h)(t)(t)(p)(:)(//)java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<filter> <filter-name>Struts2</filter-name>
<filter-class>org.apache.Struts2.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>Struts2</filter-name> <url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
我的struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation //DTD Struts Configuration 2.3//EN "
"(h)(t)(t)(p)(:)(//)struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="login" class="org.action.LoginAction">
<result name="success">/welcome.jsp</result>
</action>
</package>
</struts>
剩下还有Loginjsp、welcome.jsp、LoginAction.java 3个文件。。问题应该不是3个文件。。在运行时,
如果输入(h)(t)(t)(p)(:)(//)localhost:8080/Struts/login.jsp也会出现404错误,但是message一栏里什么都没有,显示:
type Status report
message
description The requested resource is not available.
。。我弄了好几天了。。。怎么办


...全文
252 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
tzimiscecat 2013-07-01
  • 打赏
  • 举报
回复
╮(╯▽╰)╭,重新装个tomcat7.0就解决了。。。看来可能是版本问题
晓风吹雾 2013-06-27
  • 打赏
  • 举报
回复
引用 6 楼 tzimiscecat 的回复:
[quote=引用 5 楼 shnulaa 的回复:] The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\j2ee\MyEclipse10.6\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;F:\j2ee\Tomcat6.0\bin 这句话的意思是说 APR需要依赖的库文件(比如说是dll,so文件) 在你的java.library.path中没有找到,也就是说java 使用jni调用native方法的时候找不到库文件了。而这些库文件是用来做什么的呢? 他们是用来性能调优,为了能够达到最理想的性能。 所以说出现错误的可能是 1 这些文件确实missing了 2 这些文件存在,但是并没有加到java.library.path中。
那。。。是缺哪些文件,到哪里下载并且放到什么文件夹下呢[/quote] 缺哪些文件我就不知道了。eclipse和tomcat都重新下一个最新的,然后再eclipse添加tomcat容器,这样肯定是没有问题的。
tzimiscecat 2013-06-27
  • 打赏
  • 举报
回复
我用的myeclipse是10.6的应该是完全版的吧。。。需不需要实现安装eclipse?
tzimiscecat 2013-06-27
  • 打赏
  • 举报
回复
我看了其他帖子说是要在bin文件里放一个tcnative 1.dll 但是我的tomcat文件里本来就有这个文件,但是jdk里没有,于是我把这个文件复制进了JDK的bin文件下,可是运行还是出错,显示 2013-6-27 15:29:32 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\j2ee\MyEclipse10.6\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;F:\j2ee\Tomcat6.0\bin 2013-6-27 15:29:32 org.apache.coyote.http11.Http11Protocol init 严重: Error initializing endpoint 坑爹啊~~~~~
tzimiscecat 2013-06-26
  • 打赏
  • 举报
回复
引用 5 楼 shnulaa 的回复:
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\j2ee\MyEclipse10.6\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;F:\j2ee\Tomcat6.0\bin 这句话的意思是说 APR需要依赖的库文件(比如说是dll,so文件) 在你的java.library.path中没有找到,也就是说java 使用jni调用native方法的时候找不到库文件了。而这些库文件是用来做什么的呢? 他们是用来性能调优,为了能够达到最理想的性能。 所以说出现错误的可能是 1 这些文件确实missing了 2 这些文件存在,但是并没有加到java.library.path中。
那。。。是缺哪些文件,到哪里下载并且放到什么文件夹下呢
晓风吹雾 2013-06-26
  • 打赏
  • 举报
回复
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\j2ee\MyEclipse10.6\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;F:\j2ee\Tomcat6.0\bin 这句话的意思是说 APR需要依赖的库文件(比如说是dll,so文件) 在你的java.library.path中没有找到,也就是说java 使用jni调用native方法的时候找不到库文件了。而这些库文件是用来做什么的呢? 他们是用来性能调优,为了能够达到最理想的性能。 所以说出现错误的可能是 1 这些文件确实missing了 2 这些文件存在,但是并没有加到java.library.path中。
tzimiscecat 2013-06-26
  • 打赏
  • 举报
回复
我用的tomcat是老师给的tomcat6X,不是自带的。安装的jdk及配置是绝对没问题的,因为我在cmd上运行java程序是可以正确执行的
oh_Maxy 2013-06-26
  • 打赏
  • 举报
回复
另外,安装jdk,并将自己的环境变量配置好:JAVA_HOME
oh_Maxy 2013-06-26
  • 打赏
  • 举报
回复
tomcat不要用eclipse自带的,自己下载一个tomcat用吧 eclipse自带的tomcat我是没用成功过。。
tzimiscecat 2013-06-26
  • 打赏
  • 举报
回复
我在Console里开到几条错误提示。。。但是看不懂。。求解: 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\j2ee\MyEclipse10.6\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;F:\j2ee\Tomcat6.0\bin 2013-6-26 16:45:58 org.apache.coyote.http11.Http11Protocol init 严重: Error initializing endpoint 严重: Failed to initialize connector [Connector[HTTP/1.1-8080]] 严重: Error filterStart 2013-6-26 16:45:59 org.apache.catalina.core.StandardContext start 严重: Context [/Struts2] startup failed due to previous errors 2013-6-26 16:46:00 org.apache.coyote.http11.Http11Protocol start 严重: Error starting endpoint 严重: Can't find free port 8009 8009 诸如这样的提示。。。。

58,454

社区成员

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

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