SSM框架搭建出现这问题 5C

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.

4个回答

从控制到打印的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报的警告,项目启动应该没有问题

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐