视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
maven + eclipse的那点事
2025-10-02 04:47:46 责编:小OO
文档
1、警告:The tag handler class for "s:form" (org.apache.struts2.views.jsp.ui.FormTag) was not found on the Java Build Path

这个问题终于可以解决了, 在出问题的页面  标签前后删除空格后保存文件 警告即可消失,即为改行的起始,然后保存。

 

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

   --Dynamic Web Moudle Version

    --java Version

 根据自身机器开发环境设置

 

 或者

  右键项目“Properties”,在弹出的“Properties”窗口左侧,单击“Project Facets”,打开“Project Facets”页面。

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

 

3、Struts2 + Spring 

需要在pom.xml中加入:

 

  

   org.apache.struts

   struts2-spring-plugin

   2.3.16

  

  

同时在struts.xml中加入 

 

 

 

 

 

 

 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里

"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

这个声明有问题

用下面这个解决问题

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

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

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

则用

"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

 

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] view plaincopy

1.  

2.  

3.   

4.  

5.   

6.  

 

web.xml v2.4

 

[xml] view plaincopy

1.  

2.3.    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  

4.    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">  

5.   

6.  

 

web.xml v2.5

 

[xml] view plaincopy

1.   

2.http://java.sun.com/xml/ns/javaee   

3.xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  

4.xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"   

5.version="2.5">  

6.   

7.  

 

web.xml v3.0

 

[xml] view plaincopy

1.  

2.   

3.4.        version="3.0"  

5.        xmlns="http://java.sun.com/xml/ns/javaee"  

6.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  

7.        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">  

8.   

9.  

 

 

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解决:

问题提示:An internal error occurred during:"Updating Maven Project"

解决:

1、把该项目从eclipse中删除,不要删除掉项目文件(只是从eclipse项目视图中删除);

2、进入cmd ,然后进入到该项目目录下比如:E:\\workspace\\mavenProject ,其中mavenProject为项目名称;

3、执行命令:mvn eclipse:clean;

4、检查项目目中是否还存在 .classpath、.project、.settings ,如果存在 ,则删除掉;

5、通过右键-->import--> Existing Maven Projects,重新导入即可。

 

8、

hibernate    java.lang.UnsupportedOperationException: The user must supply a JDBC connection

是 hibernate的 配置文件hibernate.cfg.xml配置存在问题 ,检查数据连接的driver_class、url、username、root等参数名及参数值是否正确

 

 9、mysql 中,如果hibernate的 主键 用 uuid.hex,报异常如下:

java.sql.BatchUpdateException: Data truncation: Data too long for column 'SID' at row 1 .

解决:

  修改mysql的字符集和创建表的一样即可 ,比如创建表 create table aa() default charset=utf8 ;

  

  那么通过命令:set  names utf8 ; ,修改 mysql的字符集;

重新运行程序即可。

 

 

10、maven 在 eclipse中创建maven project报一下错误解决:

Could not resolve archetypeorg.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of theconfigured repositories.

Could not resolve artifact

Failed to resolve version fororg.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could notfind metadataorg.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml inlocal (E:\\maven3\\repository)

Failed to resolve version fororg.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could notfind metadataorg.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml inlocal (E:\\maven3\\repository)

 

解决思路:

a、修改conf/settings.xml,在…中间加入以下内容:

      ibiblio.org

      ibiblio Mirror ofhttp://repo1.maven.org/maven2/

     http://mirrors.ibiblio.org/pub/mirrors/maven2

      central

     

   

   

  

      cica.es

      http://ftp.cica.es/mirrors/maven2

      central

     

   

  

   

      skynet.be

     http://maven2.mirrors.skynet.be/pub/maven2

      central

     

   

b、如果机器使用代理,则需要修改代理信息,在之间加入

   

            my-proxy 

            true

            http

      user

     pwd

            10.17.75.2

       3128

           localhost|127.0.0.1

 

 

 11、eclipse 执行 mvn install的时候 报如下错误

[ERROR] Failed to parse plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1 (E:\\maven3\\repository\\org\\apache\\maven\\plugins\\maven-install-plugin\\2.3.1\\maven-install-plugin-2.3.1.jar): error in opening zip file -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginDescriptorParsingException

解决方法:

删除 :E:\\maven3\\repository\\org\\apache\\maven\\plugins\\maven-install-plugin\\2.3.1 目录 ,操作后 :E:\\maven3\\repository\\org\\apache\\maven\\plugins\\maven-install-plugin\下没有2.3.1目录,然后重新执行 mvn Install ;

如果 执行 mvn Clear存在相同问题 ,这只需要删除对应的目录,让Maven重新下载对应的jar即可。

 下载本文

显示全文
专题