After uploading to a git repository with a maven-built Java Web project, when a colleague clones the project and deploys to Tomcat, the following error is reported, that is, when the Web project is launched, the. xml file is loaded, the spring listener is not found, and the console error is as follows:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
十月
30
,
2015 4
:
42
:
36 下午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Java64\jdk1.
7
.0_55\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Java64\jdk1.
7
.0_55\jre\bin;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.
0
\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Java64\jdk1.
7
.0_55\bin;D:\Program Files\MySQL\MySQL Server
5.5
\bin;D:\developer\apache-maven-
3.1
.
1
\bin;C:\Program Files\nodejs\;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\
1.0
\;C:\Users\van\AppData\Local\Android\sdk\platform-tools;C:\Users\van\AppData\Local\Android\sdk\tools;d:\Program Files\Git\cmd;d:\Program Files\Git\mingw64\bin;d:\Program Files\Git\usr\bin;C:\Users\van\AppData\Roaming\npm;.
十月
30
,
2015 4
:
42
:
36 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property
‘xmlNamespaceAware‘ to
‘false‘ did not find a matching property.
十月
30
,
2015 4
:
42
:
37 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property
‘xmlValidation‘ to
‘false‘ did not find a matching property.
十月
30
,
2015 4
:
42
:
37 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to
‘org.eclipse.jst.j2ee.server:dsx-app‘ did not find a matching property.
十月
30
,
2015 4
:
42
:
37 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler [
"http-bio-8080"
]
十月
30
,
2015 4
:
42
:
37 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler [
"ajp-bio-8019"
]
十月
30
,
2015 4
:
42
:
37 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in
1064 ms
十月
30
,
2015 4
:
42
:
37 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十月
30
,
2015 4
:
42
:
37 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/
7.0
.
53
十月
30
,
2015 4
:
42
:
38 下午 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance
for session ID generation using [SHA1PRNG] took [
132
] milliseconds.
十月
30
,
2015 4
:
42
:
38 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of
class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1720
)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1571
)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:
529
)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:
511
)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:
139
)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
4888
)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5467
)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:
150
)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:
1559
)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:
1549
)
at java.util.concurrent.FutureTask.run(FutureTask.java:
262
)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1145
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
615
)
at java.lang.Thread.run(Thread.java:
745
)
十月
30
,
2015 4
:
42
:
38 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
十月
30
,
2015 4
:
42
:
38 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
十月
30
,
2015 4
:
42
:
38 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/dsx-app] startup failed due to previous errors
十月
30
,
2015 4
:
42
:
38 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler [
"http-bio-8080"
]
十月
30
,
2015 4
:
42
:
38 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler [
"ajp-bio-8019"
]
十月
30
,
2015 4
:
42
:
38 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in
1363 ms
|
This, this mistake really let a person drunk, what is the matter, my local is no problem, ah, why colleague clone down made this mistake. After a half-day study found, do not know what reason, clone down after using Eclipse import Maven project, in his there with the git status command to see, there are two configuration files changed, One is. Classpath, one is. Project, the contents of these two files have changed, and when I restore the two files to their original state, the projects are normal.
Although this can be solved, but it is not perfect, because the new people in the future will appear this problem!
Finally found a solution, thanks to the original author, reference http://www.yihaomen.com/article/java/471.htm
Workaround:
1. Right-click Project, click Properties
2. Select Deployment Assembly
3. Click Add, Java Build Path Entries, Next
4. Choose Maven Dependencies, Finish, Apply, OK
5. Clean project and server. Restart Server
Maven Java Web project startup cannot find a solution for spring Contextloaderlistener