今天在做一个dubbo服务端的时候,启动成功,dubbo也注册成功,但是启动日志中就出现[java:comp/env/spring.liveBeansView.mbeanDomain] not found这个日志,网上搜搜,果然很多人出现过这个问题。

  1. [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [servletConfigInitParams]
  2. [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams]
  3. [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [jndiProperties]
  4. [org.springframework.jndi.JndiTemplate] - <strong><span style="color:#ff0000;">Looking up JNDI object with name [java:comp/env/spring.liveBeansView.mbeanDomain]</span></strong>
  5. [org.springframework.jndi.JndiLocatorDelegate] -<span style="color:#ff0000;"> <strong>Converted JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found</strong> </span>- 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].
  6. [org.springframework.jndi.JndiTemplate] - Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]
  7. [org.springframework.jndi.JndiPropertySource] - JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with message: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].. Returning null.
  8. [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
  9. [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
  10. [org.springframework.core.env.PropertySourcesPropertyResolver] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
  11. [org.springframework.web.context.ContextLoader] - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
  12. [org.springframework.web.context.ContextLoader] - Root WebApplicationContext: initialization completed in 13003 ms

错误原因:就是spring-context.jar包中提供通过JMX来实时查看spring放在applicationContext里的bean列表功能,会在项目配置文件里找一个叫"spring.liveBeansView.mbeanDomain"的环境变量,没找到,就报错了。

j解决办法就是在项目中的web.xml中添加如下配置:

  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>
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/plg17/article/details/76325378

启动日志中就出现[java:comp/env/spring.liveBeansView.mbeanDomain] not found这个日志的更多相关文章

  1. spring启动找不到spring.liveBeansView.mbeanDomain配置

    做项目时,启动tomcat报错 JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with m ...

  2. 理解JNDI中 java:comp/env/jdbc/datasource 与 jdbc/datasource 的不同之处(转)

    在描述JNDI,例如获得数据源时,JNDI地址有两种写法,例如同是  jdbc/testDS 数据源: A:java:comp/env/jdbc/testDS B:jdbc/testDS   这两种写 ...

  3. JNDI中 java:comp/env 的理解

    J2EE 上下文环境变量前缀,一般有如下几种:java:/comp/env/jdbcjava:/comp/env/urljava:/comp/env/mailjava:/comp/env/jms在部署 ...

  4. javaWeb中JNDI的使用,为什么要加java:comp/env前缀

    转载自(http://blog.csdn.net/guodongsoft/article/details/52399527) 我们在使用JNDI调用某个对象时,会有下述两种方式 context.loo ...

  5. java:comp/env/jdbc/ 的两种配置方法

    1. 在 META-INF 下建立文件: context.xml <?xml version="1.0" encoding="UTF-8"?> &l ...

  6. JNDI:对java:comp/env的研究

    这两天研究了一下 context.lookup("java:comp/env/XXX")和直接context.lookup("XXX")的区别 网上关于这两个的 ...

  7. 详解JNDI的lookup资源引用java:/comp/env

    ENC的概念:     The application component environment is referred to as the ENC, the enterprise naming c ...

  8. 详解JNDI的lookup资源引用 java:/comp/env

    ENC的概念:     The application component environment is referred to as the ENC, the enterprise naming c ...

  9. 数据源引用 java:/comp/env

      编辑 删除 数据源引用 java:/comp/env 2012-01-28 15:59   ENC的概念: The application component environment is ref ...

随机推荐

  1. 如何将angular-ui-bootstrap的图片轮播组件封装成一个指令

    在项目开发中我们经常会遇到图片轮播的功能点: 如果我们开发人员自己原生手写,将会花费很多的时间,最终得不偿失. 接下来就详细说说如何使用angular-ui发热图片轮播模块,并且将它写成一个指令(便于 ...

  2. coding style 的两点

    通俗介绍coding style两点建议: 模块划分 这个如果做得不好,简直不能忍.有的代码非常莫名其妙,有些东西本身不复杂,非要将其拆成好几个部分,然后做成一个一个碎散的模块,这样并不好.举个例子, ...

  3. Form 总结

    禁止input自动完成下拉 //ie: autocomplete="off" //ff: disableautocomplete <input size="40&q ...

  4. configure: error: mcrypt.h not found. Please reinstall libmcrypt.

    编译出现错误: configure: error: mcrypt.h not found. Please reinstall libmcrypt. 解决方法: yum install -y libmc ...

  5. c# 关键字学习

    partial class Test { public string str; public void get() { } } partial class Test { public int i; p ...

  6. kubernetes 学习 pod相关

    1  pod的状态: Pending, Running, Succeeded, Failed, Unknown 2  pod重启策略: Always(自动重启,是默认的) .  OnFailure(容 ...

  7. PKU1988磁铁

    Cube Stacking Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 16258   Accepted: 5579 Ca ...

  8. Python handling an exception

    #try...except... try: You do your operations here; ...................... except ExceptionI: If ther ...

  9. 26_java之进程|线程|线程池

    01进程概念 *A:进程概念 *a:进程:进程指正在运行的程序.确切的来说,当一个程序进入内存运行, 即变成一个进程,进程是处于运行过程中的程序,并且具有一定独立功能. 02线程的概念 *A:线程的概 ...

  10. 根据不同分辨率载入相应CSS样式表

    index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// ...