Javax.naming.NameNotFoundException

Source: Internet
Author: User
Tags log4j

[Java]View PlainCopy
  1. 2015-08- :463 [localhost-startstop-1] DEBUG [ Org.springframework.jndi.JndiTemplate]-Looking up Jndi object with name [java:comp/env/ Spring.liveBeansView.mbeanDomain]
  2. 2015-08-27 09:< Span class= "number" >53:16,463 [localhost-startstop- 1] debug [org.springframework.jndi.jndilocatordelegate] - converted  JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found -  trying original name [spring.livebeansview.mbeandomain].  javax.naming.namenotfoundexception: name [spring.livebeansview.mbeandomain] is not  Bound in this context. unable to find [ spring.livebeansview.mbeandomain].  
  3. 2015-08-27  09:53:16,463 [ Localhost-startstop-1] debug [org.springframework.jndi.jnditemplate] -  Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]   
  4. 2015-08- :464 [localhost-startstop-1] DEBUG [ Org.springframework.jndi.JndiPropertySource]-Jndi lookup for name [Spring.liveBeansView.mbeanDomain] threw Namingexception with Message:name [Spring.liveBeansView.mbeanDomain] was not bound in this Context. Unable to find [Spring.liveBeansView.mbeanDomain].  Returning null.

The above is a burst of abnormal information, from which can be very clear to see the exception from the Jndi data source configuration, but my project is not configured to use Jndi, as to the cause of this exception, consulted a lot of information, some people say it is the problem of jar, some say that the problem of spring configuration, Some overseas analysts said is spring internal problems, specific what factors caused I did not go to study, hope to see friends, can leave a message, thank you, PS (self-understanding, whether right or wrong are brave to say out, do not say never know right and wrong, hinder the angle of thinking), This project is used by: spring3.2+springmvc+druid+mybatis3.2.2/spring-mybatis1.2.0

Two solutions are attached below:

1: From Control to print logo, the log level of the project should have at least the DEBUG level: Log4j.rootlogger = Debug,console,file

Remove the debug level from the config file, or use info. There is no longer this exception message: Log4j.rootlogger = Info,console,file

2: Add the following configuration in Web. XML, this method is to see foreign friends to provide, the test has the effect

[HTML]View PlainCopy
  1. <context-param>
  2. <param-name>spring.profiles.active</param-name>
  3. <param-value>dev</param-value>
  4. </context-param>
  5. <context-param>
  6. <param-name>spring.profiles.default</param-name>
  7. <param-value>dev</param-value>
  8. </context-param>
  9. <context-param>
  10. <param-name>spring.livebeansview.mbeandomain</param-name>
  11. <param-value>dev</param-value>
  12. </context-param>

Javax.naming.NameNotFoundException

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.