maven + eclipse 问题记录

1、警告:The tag handler class for "s:form" (org.apache.struts2.views.jsp.ui.FormTag) was not found on the Java Build Path这个问题终于可以解决了, 在出问题的页面 <s:form> 标签前后删除空格后保存文件 警告即可消失,即<s:form>为改行的起始,然后保存。

2、Eclipse下Java compiler level does not match the version of the installed Java project facet的问题 .

javacompilerfaceteclipsepropertiesjdk问题现象:项目图标报错“Java compiler level does not match the version of the installed Java project facet.”。分析原因:根据错误信息的字面意思,应该是Java版本设定不一致的问题。而且这个Java版本跟Project安装的有关系。

解决办法:

既然是project出的问题,自然要从项目属性入手。其实很简单,

修改项目的org.eclipse.wst.common.project.facet.core.xml<installed facet="jst.web" version="2.5"/> –Dynamic Web Moudle Version<installed facet="java" version="1.5"/> –java Version根据自身机器开发环境设置或者 右键项目“Properties”,在弹出的“Properties”窗口左侧,单击“Project Facets”,打开“Project Facets”页面。

在页面中的“Java”下拉列表中,选择“1.5”

3、Struts2 + Spring 需要在pom.xml中加入:<!– struts2 spring plugins –><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-spring-plugin</artifactId><version>2.3.16</version></dependency>同时在struts.xml中加入 <!– 将Action交给spring容器管理 –><constant name="struts.objectFactory" value="spring" />4、Eclipse : An error occurred while filtering resources解决:Maven -> Update Project… resolved this problem for me

5、org.dom4j.DocumentException:Software caused connection abort: recv failed

这个错误有可能是hibernate的配置文件.hbm.xml里

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""">

这个声明有问题

用下面这个解决问题

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""">

如果不行,则是颠倒过来,,即如果原来使用

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""">则用

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""">

6、Cannot change version of project facet Dynamic Web Module to 3.0. 和 One or more constraints have not been satisfied.

需要修改 project的 properties的 project facts的 Dynamic Web Moudle Version版本和 web.xml中的版本一直,然后 在通过maven update

以下为 web.xml的各个版本:

web.xml v2.3

<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" ""> <web-app> </web-app>

web.xml v2.4

<?xml version="1.0" encoding="UTF-8"?><web-app id="WebApp_9" version="2.4" xmlns="" xmlns:xsi=""xsi:schemaLocation=" http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> </web-app>

web.xml v2.5

<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns=http://java.sun.com/xml/ns/javaee xmlns:xsi=""xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> </web-app>

web.xml v3.0

<?xml version="1.0" encoding="UTF-8"?> <web-appversion="3.0"xmlns=""xmlns:xsi=""xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> </web-app>

7、An internal error occurred during:"Updating Maven Project"(

mvn archetype:generate -DgroupId=com.mkyong -DartifactId=HibernateExample -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

) –java application

mvn archetype:generate -DgroupId=com.mkyong -DartifactId=HibernateExample -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

) –java web application

命令行创建 maven 项目转为 eclipse项目时, 在eclipse中打开存在的maven项目,不能通过 maven update解决:

将会错过更好的风景,保持一份平和,保持一份清醒。

maven + eclipse 问题记录

相关文章:

你感兴趣的文章:

标签云: