spring+hibernate+structs 整合出现http404
我在eclipse下调试了两个工程,其中一个只有的structs工程点run没问题已经能运行了,而另一个整合了structs+hibernate+spring的工程却老是出以下错误,调试了一上午还是这样,请问高手是怎么回事啊?该工程在eclipse里只是显示了黄色的叹号,该加的包也都加了,各个xml文件里也没有报错,只是鼠标移动到某些字上时会说"not correctly spelled"我看网上有人说是web.xml被误放在web-info/lib目录下导致的,我的在ecilpse IDE里确实显示web.xml是放在web-info/lib目录下的,但是查看该工程的文件夹web.xml又是在web-info下,可能是eclipse就是这样显示的把?请各位高手帮忙提示下可能是什么地方出错了
HTTP Status 404 - /forum/
--------------------------------------------------------------------------------
type Status report
message /forum/
description The requested resource (/forum/) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.28 --------------------编程问答-------------------- 404错误,只能是路劲异常,查一下,是不是action的字母写 的不一样,尤其是大小写 --------------------编程问答-------------------- 少文件,或者没部署成功,再者就是程序本身的问题 --------------------编程问答-------------------- 具体少了什么文件呢?除了大小写还有什么?具体是哪个配置文件可能有问题? --------------------编程问答-------------------- 1. 进入发布的项目lib目录下,看看有没有包重复,把重复的删除看看
2. 路径大小写什么的检查下 --------------------编程问答-------------------- /forum/这个在哪放的呢?还有web.xml怎么能在lib下? --------------------编程问答-------------------- web.xml是在web-info下的 --------------------编程问答-------------------- eclipse启动tomcat时有入下错误:
六月 05, 2013 3:02:37 下午 org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML document from file [D:\project\coding\EclipseWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\forum\WEB-INF\classes\applicationContext-action.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 114; 必须为元素类型 "beans" 声明属性 "xmlns"。
Caused by: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 114; 必须为元素类型 "beans" 声明属性 "xmlns"。 --------------------编程问答-------------------- Multiple markers at this line
- Attribute "xmlns:xsi" must be declared for element type "beans".
- Attribute "xmlns" must be declared for element type "beans".
- Attribute "xmlns:aop" must be declared for element type "beans".
- Attribute "xmlns:context" must be declared for element type "beans".
- Attribute "xmlns:tx" must be declared for element type "beans".
- Attribute "xsi:schemaLocation" must be declared for element type "beans". --------------------编程问答-------------------- applicationContext-action.xml这文件你自己写的?标签声明部分不匹配,不规范,可以贴出来看看! --------------------编程问答-------------------- <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="homeAction" class="com.hrl.action.HomeAction"
scope="prototype">
</bean>
<bean id="userAction" class="com.hrl.action.UserAction"
scope="prototype">
<property name="userDao" ref="userDao"></property>
</bean>
<bean id="articleAction" class="com.hrl.action.ActicleAction"
scope="prototype">
<property name="articleDao" ref="articleDao"></property>
</bean>
<bean id="replyAction" class="com.hrl.action.ReplyAction"
scope="prototype">
<property name="replyDao" ref="replyDao"></property>
</bean>
</beans>
--------------------编程问答-------------------- 本来上面的applicationContext-action.xml还有一行被我删掉了,好像是<!DOC.......>,网上有帖子说是这个原因造成了错误,可是删掉了还是http404 --------------------编程问答-------------------- 检查beans节点属性部分有没有非法不可见字符或多余空格,删除
看它列位置报在了114,已经超出字符数了 --------------------编程问答--------------------
<beans xmlns="http://www.springframework.org/schema/beans"就这几行的问题,找个规范的applicationContext.xml,从里面copy一份。 --------------------编程问答-------------------- 重新复制了一份applicationContext-action.xml,还是有问题
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
"看它列位置报在了114,已经超出字符数了" 这说明什么问题呢?
怎么看不可见字符? --------------------编程问答-------------------- 而且在eclipse里面用xml editor 打开applicaitonContext-action.xml并没有显示啥错误啊
补充:Java , Java EE