Maven duplicate declaration of version

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for cn.com.etianan.ebusiness:online:war:0.0.2-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.com.etianan.ebusiness:basicBizInfo:jar -> duplicate declaration of version (?) @ line 197, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.com.etianan.ebusiness:claimService:jar -> duplicate declaration of version (?) @ line 250, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.com.etianan.ebusiness:productDirectory:jar -> duplicate declaration of version (?) @ line 254, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.com.etianan.ebusiness:permission:jar -> duplicate declaration of version (?) @ line 279, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.com.etianan.ebusiness:payment:jar -> duplicate declaration of version (?) @ line 287, column 15
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.mortbay.jetty:maven-jetty-plugin @ line 360, column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building online 0.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://localhost:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] Downloading: http://maven-beabuild-plugin.googlecode.com/svn/maven2/releases/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:10.535s
[INFO] Finished at: Tue Dec 31 11:21:09 GMT+08:00 2013
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to nexus (http://localhost:8081/nexus/content/groups/public): Connection to http://localhost:8081 refused: Connection refused: connect -> [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/PluginResolutionException

原因是因为出现了重复的dependency节点。删除重复节点,留下一个即可。

Tomcat启动超时 unable to start within 45 seconds

当启动tomcat时候出现

Server Tomcat v6.0 Server at localhost was unable to start within 45
seconds. If the server requires more time, try increasing the timeout
in the server editor.

tomcat_time_out.jpg

的错误,那表示你的tomcat启动超时了,有时候你重新启动下就好了,但有时需要重新启动很多次,如果你不想这样的话,你只需修改下tomcat的启动 时间就行了,步骤如下:

修改 workspace\.metadata\.plugins\org.eclipse.wst.server.core\servers.xml文件。

<server hostname="localhost" id="JBoss v5.0 at localhost" name="JBoss v5.0 at localhost" runtime-id="JBoss v5.0" server-type="org.eclipse.jst.server.generic.jboss5" server-type-id="org.eclipse.jst.server.generic.jboss5" start-timeout="1000" stop- timeout="15" timestamp="0">

start-timeout="45" 改为 start-timeout="1000" 或者更长 重启eclipse就可以了。

或者在界面修改

tomcat_time_out2.jpg

JSP:Invalid character constant

代码:

<%
    out.print('abc');
%>

报错信息:

An error occurred at line: 27 in the jsp file: /tunps.com/emp_import.jsp
Invalid character constant
25: 
26: <%
27:     out.print('abc');
28: %>
29: 
30: 

原因:单引号修改为双引号,这是Java字符串,不是PHP!!!!!!!!!!!!!!!!!!!!!!!!!!= =#

Page directive must not have multiple occurrences of pageencoding at

org.apache.jasper.JasperException: /tunps/emp_import.jsp (line: 32, column: 1) Page directive must not have multiple occurrences of pageencoding at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:103) at org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:196) at org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:589) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450) at org.apache.jasper.compiler.Node$Root.accept(Node.java:474) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Validator.validateDirectives(Validator.java:1805) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:196) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.tunps.platform.util.filter.SystemValidationFilter.doFilter(SystemValidationFilter.java:75) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.tunps.platform.util.filter.ActionHelperFilter.doFilter(ActionHelperFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.tunps.platform.util.antixss.AntiXssFilter.doFilter(AntiXssFilter.java:57) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.tunps.platform.util.filter.PerformanceAuditFilter.doFilter(PerformanceAuditFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.tunps.platform.util.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:43) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) /tunps/emp_import.jsp (line: 32, column: 1) Page directive must not have multiple occurrences of pageencoding

原因是JSP页面出现了两个设置页面字符集的指令造成重复,去掉其中一个即可。

<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>

<%@page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>