Development environment Configuration (netbeans+ant migration to Eclipse+maven)

Source: Internet
Author: User
Tags netbeans

The new company into the job, take over a separation of personnel projects, get the source code is a compressed package, with NetBeans development, ant management; Front end: Jsp+extjs, backend: springmvc+hibernate+activiti+spring;

To engage in a drive;

Directly import the project, found not recognized;

See the source code inside has build.xml, hence search;

Follow the "Import project through Build.xml in Eclipse" operation;

Some of the open source projects are compiled with ant, and sometimes you can import the project into eclipse by importing the build.xml in the project, as follows:

Select Menu File->new->other...->java->java Project from Existing Ant buildfile, such as:

Tip specified BuildFile does not contain a Javac task

The workarounds are:

Add the following line:

<javac srcdir= "src" destdir= "bin"/>

The whole is:

<?xml version= "1.0" encoding= "UTF-8"?>

<project name= "Hw.makejar" default= "Makejar" basedir= "." >

<target name = "Makejar" description= "Create a jar for the HW project" >

<jar jarfile= "Helloworld.jar" includes= "*.class" basedir= "Bin"/>


<javac srcdir= "src" destdir= "bin"/>


Import again:

Open JSP file, garbled;

Deployment project error, look at the log is a configuration problem, referring to the developer's local folder path;


decided to change Eclipse+maven;

Source management currently has a tfs,svn, self-installed git;

Configure the Pom.xml, configure the jar package in the Lib directory, and set the compile plugin;

Copy Lib to a temporary directory, then one from the MAVEN online repository to get the configuration, check the Maven dependencies in Eclipse, and the temporary directory, and some will delete the temporary directory inside;

With Pom.xml dependency hierarchy exclusion better, with search function;

Download jar package Sometimes good slow, httpclient download good slow;

imgscalr-lib-3.1 only 4.x version or above; The current version is 4.2;

jgraphx-, the current version is jgraphx-;

mybatis-3.1.1, the current version is mybatis-3.2.2

xstream-1.3.1, the current version is xstream-1.4.2;


Artifacttransferexception:failure to transfer From Http:// is cached in the local repository, resolution won't be reattempted until the Update Interval

of central have elapsed or updates are forced. Original error:could not transfer artifact from/ To Central (HTTP://REPO.MAVEN.APACHE.ORG/MAVEN2): The operation was cancelled.

Delete the corresponding folder for the local warehouse, update MAVEN project;

Problem: Some packages are not available in the Web-inf/lib directory, maven online warehouse;

Modify pom.xml Add compilation parameters, project build path inside Add dependency (add Class Folder);














Start Project Error:

org.springframework.beans.factory.BeanDefinitionStoreException: line at XML document from ServletContext Resource [/web-inf/spring-context.xml] is invalid; Nested exception is org.xml.sax.SAXParseException: Document root element "Beans", must match DOCTYPE root "null".

org.xml.sax.SAXParseException: Document root element "Beans", must match DOCTYPE root "null".

Reason: XFire Core Lib has Spring1.2.6 in conflict with Spring 2!

First comment out the pom.xml inside the pdfservlet in the dependence;

Modifying the database password is the same as the local development environment;

Grant all privileges on * * to [email protected] '% ' identified by ' root ' with GRANT option;

Flush privileges;

Modify the Startup file script

The shell determines whether the file exists:

Warfile= "/var/log/httpd/access.log"

If [-F "$warFile"]; Then



Modify hostname to localhost

Root login execution, echo " ' hostname ' localhost localhost.localdomain" >/etc/hosts

Change the login password of MySQL to root;

SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' root ');

Page Error:

org.apache.jasper.JasperException:/web-inf/views/management/systemsettings.jsp (207,95) the function GetUserName must be used with a prefix when a default namespace are not specified

MySQL has a table capitalization problem under Linux

To eliminate case-sensitive issues in Linux, set the following: VI/ETC/MYSQL/MY.CNF

Add in [mysqld]:

Lower_case_table_names = 1

VI when you want to move the mouse up and down, press ESC to exit the edit mode to move;

Restart Tomcat after you have modified it.

/etc/init.d/mysql restart


Re-import the data and restart the project;

Linux creates shortcuts to the Tomcatlog directory, so you don't have to hit the command CD every time.

Ln-s/app/tomcat/logs/catalina.out Tomcatlogs

View current server IP;


After the start of access to the background error:

At least one JAR is scanned for TLDs yet contained no TLDs. Enable debug logging for the logger for a complete list of J ARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

The problem is that your page contains <!----> comments are removed, tomcat7.0.20.

Tomcat 7 has strict syntax requirements for El expressions, such as "${}" because the inclusion of the keyword new will result in parsing errors.

The problem is out, how to solve it? There are three kinds, as follows:

The first: Strictly abide by the Java specification, modify the object's property name, the requirement does not contain the Java keyword;

The second type: Modify the El expression, such as "${}" can be modified to "${owner[' new '}";

Third: Modify the Tomcat property, ignoring the keyword check for El expressions. Modify the $catalina_base/conf/ file to add the Org.apache.el.parser.skip_identifier_check=true option.

Note the new line character of the file under Linux;

It seems like this change does not work;


Info: Validatejarfile (/app/tomcat/webapps/srpm/web-inf/lib/servlet-api-2.5-20081211.jar)-jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending Class:javax/servlet/servlet.class


1) Delete the Servlet-api.jar under Project Web-inf/lib

2) Delete the previous publishing folder

Re-release the run to resolve the issue.

I deleted the war package inside the Servlet-api-2.5-20081211.jar before it started up;

When Tomcat starts, it has to load the package under its Lib first, so there will be a conflict.

Linux moves up one line, moves the cursor when moving forward, then presses PP to delete, moves to the target line, presses p to paste;

Delete line start space:;

The C:url on Linux becomes://

Daddy's Ubuntu, get the PageContext unexpectedly is/;

Server.xml configuration:

Modified to:

Set Eclipse Open JSP file is Utf-8, set content types inside the default encoding for UTF-8;

To access a page error:

org.apache.jasper.JasperException:/web-inf/views/home/welcome.jsp (32,197) The function DisplayName must be Used with a prefix when a default namespace are not specified

Linux does not have this problem;

Change the latest version of Tomcat: 6.0.43, the problem remains;

Replace with the original default Jstl.jar and Standard.jar, also not, the problem is still;

This is called the method inside the class,

The problem with your code is, the code run locally is run in Tomcat 7 and the code run on the server are run on Tomcat 6.

As soon as invocation of methods with parameters (those ()) are the feature of EL 2.2 (and higher) and it is accompanied by Servlet 3.0 compatible Containers (thus Tomcat 7) Your code runs fine locally.

As soon as this code was run on a Servlets 2.5 container (thus Tomcat 6) you get the mentioned error.

Still, "property-like" Access (without ()) is supported by both servlet containers.

Change TOMCAT7 to try;

Swap with Maven plugin launcher:

caused By:java.lang.LinkageError:loader constraint Violation:loader (instance of org/apache/catalina/loader/ WebappClassLoader) previously initiated loading for a different type with name "Javax/servlet/servletcontext"

is because Activiti-mule quoted Servlet-api, ruled out it;

Introduce a NEW:







Tomcat6 still have a problem, change tomcat7 will be OK;


Caused by: org.hibernate.InstantiationException: Could not instantiate test Objectcom.sinotaiyo.srpm.datamodels.UserGroup

lack of commons.collections pack;

java.lang.Error:Unresolved Compilation Problems:

XStream cannot is resolved to a type

XStream cannot is resolved to a type

Jettisonmappedxmldriver cannot is resolved to a type

At Com.sinotaiyo.zFileUtility.JsonHelp.javaBeanToJson (

Lack of package; introduction of XStream package;

LIUNX Terminal backspace cannot delete characters;

The main reason is that the Vim.tiny version is installed, not the full version of Vim.

Two methods:

1. Directly in the terminal Input command sudo apt-get install VIM, follow the steps of the installation of Vim can be.

2. Modify the/etc/vim/vimrc.tiny file, set the set compatible to a set nocompatible, add set backspace=2 This is because sometimes the system will default vim-compatible VI, so use the VI command.


1, pit Many, JSP no love ah, a variety of compatibility issues, good memory of the template engine, good memory of reading and writing separation, just want to do a quiet back end;

2, or to use MAVEN management projects, all configured to Pom.xml, including package dependencies, including plug-ins, including the JDK level, the new people get a lot faster;

3, just contact with the Internet project, are new technologies, and now back to the old generation of technology, how the matter ah, a lot of things to try to know, no one in front of the road;


1, time tight words or with their own familiar development environment, although to build from zero, but omitted to be familiar with the new development environment process, this may be a long process, front many many pits;

2, MAVEN is very powerful, another experience, rely on package management, rich excellent plug-ins are very useful;

Development environment Configuration (netbeans+ant migration to Eclipse+maven)

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: 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.