Compile Error

Encountered problem 1:
Startup error: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

If you are a maven project, tomcat does not publish the jar package added by the maven dependency when publishing the project,
you need to set eclipse:
Project -> Properties -> Deployment Assembly -> Add -> Java Build Path Entries -> Select Maven Dependencies -> Finish -> OK
also publish the corresponding Maven dependency packages to tomcat, those jars will be automatically published to the specified directory during debugging, and tomcat can also find those jars.
Encountered problem 2:
jsp referenced js, css errors, the reason is that js, css files should be in the resources folder


encountered problem 3:
The xml file shows a red cross. First of all, this file is an xml file, then all the content in it conforms to the xml syntax specification. The outermost layer of the <project></project> at the beginning is also a tag of an xml file. The latter one Long strings are also called attributes, where xmlns represents the namespace, xmlns="http://maven.apache.org/POM/4.0.0" which represents the default namespace, and the following xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" The elements or attributes in this namespace must be written in the form of xsi:. For example, schemaLocation is one of his attributes, so it is written as xsi:schemaLocation, and the default namespace Without something like xsi, in fact, the xml tag name has a professional name called QName, and if there is no previous xsi: this is generally called NCName. So you can see that the <dependency> in mvn is the element under the default namespace. The last line means that the schema file that defines this namespace is referenced, so that tools like eclipse can parse and verify your xml file. Whether it conforms to the grammar specification. Equivalent to <import namespace="xxx" schemaLocation="xxx.xsd"/>.


After the cmd file is run, it is not closed by default. Adding pause at the end of the file

encounters problem 4:
After the project name is changed, tomcat starts with parentheses.
Change the contents of the project settings file.


Encountered problem 5:
Import the maven Dependenceis project in the Deployment Assembly in Properties.
Right click on Maven project --> Macven --> Enable Dependency Management.

Encountered problem 6:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.912 s
[INFO] Finished at: 2017-02-17T11:35:16+08:00
[INFO] Final Memory: 10M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.jasig.maven:maven-translate-plugin:0.0.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.jasig.maven:maven-translate-plugin:jar:0.0.1: Could not transfer artifact org.jasig.maven:maven-translate-plugin:pom:0.0.1 from/to mojo-snapshot (https://nexus.codehaus.org/content/repositories/codehaus-snapshots/): nexus.codehaus.org: Unknown host nexus.codehaus.org -> [Help 1]
[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.

Because some files are blocked by domestic network, using maven Alibaba Cloud central warehouse will download quickly.
Configuring the setting.xml file


encountered problem 7:
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.core.StandardService.startInternal (StandardService.java:444)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1127)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 11 more

There is a problem with the filter, filter-name, and filter-mapping content in web.xml.

Encountered problem 8:
2017-02-24 18:15:26,985 WARN  [DispatcherServlet.java:1147] : No mapping found for HTTP request with URI [/SpringExample/] in DispatcherServlet with name 'SpringMVC'

spring配置:<url-pattern>/*</url-pattern>改成<url-pattern>/</url-pattern>
    <!-- Spring mvc servlet -->
    <servlet>
        <servlet-name>SpringMVC</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>SpringMVC</servlet-name>
        <!-- Filter all resources -->
        <url-pattern>/</url-pattern>
    </servlet-mapping>


Encountered problem 9:
The most common error of MyBatis, the console outputs the log infinitely at startup
http://blog.csdn.net/isea533/article/details/51277786

Problem 10
is easy to use locally, but not the test server.
1 nested exception is java.lang.NoSuchMethodError: com.baozun.event.OrderSubmittedEvent.<init>(Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Long;)V

2 org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchFieldError: storeId
	at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1303) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
	at ]

This problem is the most pitiful, the most pitiful, the most pitiful, and it took an afternoon to investigate the
reason
: 1. I can't find the method
maven project dependencies have the same file, and changed a useful file, But the test environment uses the purchased file
. 2. The parameters in the method cannot be found.
There may be a lack of get or set methods

. Solution:
Delete the same file in one of the dependent projects.


Encountered problem 11.
It is easy to use locally, but not the test server.
DEBUG DispatcherServlet.java:1198 org.springframework.web.servlet.DispatcherServlet -Handler execution resulted in exception - forwarding to resolved error view: ModelAndView: materialized View is [org.springframework.web.servlet.view.json.MappingJackson2JsonView: unnamed] ; model is {exception={stackTrace=java.lang.IllegalArgumentException: An invalid character [44] was present in the Cookie value

java.lang.IllegalArgumentException: An invalid character [44] was present in the Cookie valueView

tomcat version
under tomcat
[root@i bin]# ./catalina.sh version
Using CATALINA_BASE:   /service/appservers/it-web-usercenter
Using CATALINA_HOME:   /service/appservers/it-web-usercenter
Using CATALINA_TMPDIR: /service/appservers/it-web-usercenter/temp
Using JRE_HOME:        /usr/lib/jvm/jdk1.8.0_111
Using CLASSPATH:       /service/appservers/it-web-usercenter/bin/bootstrap.jar:/             service/appservers/it-web-usercenter/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.5.15
Server built:   May 5 2017 11:03:04 UTC
Server number:  8.5.15.0
OS Name:        Linux
OS Version:     2.6.32-642.el6.x86_64
Architecture:   amd64
JVM Version:    1.8.0_111-b14
JVM Vendor:     Oracle Corporation


In the 8.5.15.0 version, the storage of cookies cannot use ","
Solution: replace it with "#".

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326801266&siteId=291194637