2018-08-20 20:10:59,620 [localhost-startStop-1] DEBUG [org.springframework.jndi.JndiLocatorDelegate] - Converted JNDI name [java:comp/env/spring.profiles.active] not
found - trying original name [spring.profiles.active]. javax.naming.NameNotFoundException: Name [spring.profiles.active] is not bound in this Context. Unable to find
[spring.profiles.active].
2018-08-20 20:10:59,620 [localhost-startStop-1] DEBUG [org.springframework.jndi.JndiTemplate] - Looking up JNDI object with name [spring.profiles.active]
2018-08-20 20:10:59,620 [localhost-startStop-1] DEBUG [org.springframework.jndi.JndiPropertySource] - JNDI lookup for name [spring.profiles.active] threw
NamingException with message: Name [spring.profiles.active] is not bound in this Context. Unable to find [spring.profiles.active].. Returning null.
从控制到打印的logo看,项目的日志级别应该至少有DEBUG级别:log4j.rootLogger = DEBUG,console,file
去配置文件中将debug级别换掉,或是用info。则不会再有此异常信息:log4j.rootLogger = info,console,file
试试web.xml中添加以下配置项
<param-name>spring.profiles.active</param-name>
<param-value>dev</param-value>
</context-param>
<context-param>
<param-name>spring.profiles.default</param-name>
<param-value>dev</param-value>
</context-param>
<context-param>
<param-name>spring.liveBeansView.mbeanDomain</param-name>
<param-value>dev</param-value>
</context-param>
这个是debug报的警告,项目启动应该没有问题