Eclipse+maven Problem Solving method

Source: Internet
Author: User
Tags stack trace java web server port

1. Warning: The tag handler class for "S:form" (ORG.APACHE.STRUTS2.VIEWS.JSP.UI.FORMTAG) is not found on the Java Build Path
Finally, the problem can be solved, after the page <s:form> tag to delete the blank space after saving the file warning can disappear, that is, the beginning of the change of <s:form>, and then save.

2, Eclipse Java compiler level does does not match the version of the installed Java project facet issues.

JAVACOMPILERFACETECLIPSEPROPERTIESJDK Problem phenomenon: Project icon Error "Java compiler level does not match the version of the installed Java proj ECT facet. ".
Analysis reason: According to the literal meaning of the error message, it should be the problem of inconsistent Java version setting. And this Java version is related to project installation.

Workaround:

Since it is a problem with project, it is natural to start with the project properties. It's simple, actually.

Modify the Org.eclipse.wst.common.project.facet.core.xml of a project
<installed facet= "Jst.web" version= "2.5"/>--dynamic Web Moudle version
<installed facet= "java" version= "1.5"/>--java version
Based on your own machine development environment settings

Or
Right-click the project "Properties" on the left side of the "Properties" window that pops up, clicking "Project Facets" to open the "Project Facets" page.

In the page, in the Java drop-down list, select "1.5"

3. Struts2 + Spring
Need to include in Pom.xml:
<!--struts2 Spring Plugins--
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.16</version>
</dependency>

At the same time join in the Struts.xml
<!--give the action to the Spring container management--
<constant name= "struts.objectfactory" value= "Spring"/>




4. Eclipse:an error occurred while filtering resources
FIX: Maven--Update Project ... resolved this problem for me


5, Org.dom4j.DocumentException:Software caused connection Abort:recv failed

This error could be a configuration file for hibernate. hbm.xml

<! DOCTYPE hibernate-mapping Public "-//hibernate/hibernate mapping DTD 3.0//en"
"Http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >

There's a problem with this statement

Use the following to solve the problem

<! DOCTYPE hibernate-mapping Public "-//hibernate/hibernate mapping DTD 3.0//en"
"Http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >

If not, it is reversed, that is, if the original use

<! DOCTYPE hibernate-mapping Public "-//hibernate/hibernate mapping DTD 3.0//en"
"Http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
Then use

<! DOCTYPE hibernate-mapping Public "-//hibernate/hibernate mapping DTD 3.0//en"
"Http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >

6. Cannot change version of the project facet Dynamic Web Module to 3.0. And one or more constraints has not been satisfied.

You need to modify the project's properties for Project facts, the Dynamic Web moudle version version, and the versions in XML, and then in the MAVEN update

The following are the versions of Web. XML:

Web. XML v2.3

[XML]View PlainCopy 
    1. <? XML version= "1.0" encoding="iso-8859-1"?>
    2. <! DOCTYPE Web-app Public "-//sun Microsystems, INC.//DTD Web Application 2.3//en" "Http://java.sun.com/dtd/web-app_2_3. DTD ">
    3. <Web-app>
    4. </Web-app>

Web. XML v2.4

[XML]View PlainCopy 
  1. <? XML version= "1.0" encoding="UTF-8"?>
  2. <Web-app id="Webapp_9" version="2.4" xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE"
  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. </Web-app>

Web. XML v2.5

[XML]View PlainCopy 
  1. <? XML version= "1.0" encoding="UTF-8"?>
  2. <Web-app xmlns=<a target="_blank" href= "Http://java.sun.com/xml/ns/javaee" >http://java.sun.com/xml/ns/javaee</a>
  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. </Web-app>

Web. Xml v3.0

[XML]View PlainCopy 
  1. <? XML version= "1.0" encoding="UTF-8"?>
  2. <Web-app
  3. version="3.0"
  4. xmlns="Http://java.sun.com/xml/ns/javaee"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xsi:schemalocation="Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">
  7. </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

When the command line creates a MAVEN project into an Eclipse project, open the existing MAVEN project in Eclipse and cannot be resolved through Maven update:

Problem tip: An internal error occurred during: "Updating Maven Project"
Solve:
1. Remove the project from Eclipse and do not delete the project file (just delete it from the Eclipse Project view);
2, into the cmd, and then into the project directory, such as: E:\workspace\mavenProject, where mavenproject for the project name;
3, the execution order: MVN Eclipse:clean;
4, check whether the project is still there. Classpath,. Project,. Settings, if present, delete;
5, by right-click-->import--> Existing Maven Projects, re-import can.

8.

Hibernate Java.lang.UnsupportedOperationException:The User must supply a JDBC connection

is hibernate configuration file hibernate.cfg.xml configuration problems, check the data connection Driver_class, URL, username, root and other parameter names and parameter values are correct

9, in MySQL, if Hibernate's primary key with Uuid.hex, the report exception is as follows:

Java.sql.BatchUpdateException:Data Truncation:data too long for column ' SID ' at row 1.

Solve:
Modifying the MySQL character set is just as easy as creating a table, such as creating a table, create tables AA () default Charset=utf8;

Then through the command: set names UTF8; , modify the MySQL character set;

Re-run the program.

10. Maven creates MAVEN project in eclipse to resolve the error:

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)

Solution Ideas:

A, modify the Conf/settings.xml, add the following content in the middle of <mirrors>...</mirror>:

<mirror>

<id>ibiblio.org</id>

<name>ibiblio Mirror ofhttp://repo1.maven.org/maven2/</name>

<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>

<mirrorOf>central</mirrorOf>

<!--states, North Carolina-->

</mirror>

<mirror>

<id>cica.es</id>

<url>http://ftp.cica.es/mirrors/maven2</url>

<mirrorOf>central</mirrorOf>

<!--Spain, Sevilla--

</mirror>

<mirror>

<id>skynet.be</id>

<url>http://maven2.mirrors.skynet.be/pub/maven2</url>

<mirrorOf>central</mirrorOf>

<!--Belgium--

</mirror>

b, if the machine uses a proxy, you need to modify the proxy information between <proxies>...</proxies> to add

<proxy>

<id>my-proxy</id> <!-up a name--

<active>true</active> <!-fixed to true-->

<protocol>http</protocol><!-fixed to Http-->

<username>user</username><!-If you do not need to set it, then block out username properties

<password>pwd</password><!-If you do not need to set it, then block out password properties

<port>3128</port><!-Proxy Server Port--

<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>

</proxy>

11, Eclipse execution mvn install when reported the following error
[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] 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 on the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginDescriptorParsingException

Workaround:

Delete: E:\maven3\repository\org\apache\maven\plugins\maven-install-plugin\2.3.1 directory, after operation: E:\maven3\repository\org\ apache\maven\plugins\maven-install-plugin\ no 2.3.1 directory, and then re-execute MVN install;

If you have the same problem with mvn clear, you only need to delete the corresponding directory and let maven re-download the corresponding jar.

Eclipse+maven Problem Solving method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.