今天在做一个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. undefined vs. null

    undefined vs. null 一.相似性 在JavaScript中,将一个变量赋值为undefined或null,老实说,几乎没区别. var a = undefined; var a = n ...

  2. RK3288 添加USB转虚拟串口设备

    在系统开启并有日志打印的前提下,插入USB设备,就会打印USB设备和虚拟串口信息. 打印信息如下: 供应商ID(VID):idVendor=1234,产品ID(PID): idProduct=5678 ...

  3. 【备忘录】Sublime Text编辑器如何在选中的多行行首增加字符串

    如题:上面的代码,想在每一行的开头加上一个字符 * 如下: 操作步骤如下: 1.选中要操作的行(我这里Ctrl+A) 2.Ctrl+Shift+L (待操作状态) 3.方向键←   (操作这步骤后,可 ...

  4. php 运行模式

    1.php最常见的五种运行模式. CGI 通用网关接口 FastCGI 常驻内存的CGI CLI 命令行 Web模块  Apache等Web服务器 模块的形式加载php进程 ISAPI 已经不用了 2 ...

  5. 算法训练 安慰奶牛(节点有权值的MST)

    问题描述 Farmer John变得非常懒,他不想再继续维护供奶牛之间供通行的道路.道路被用来连接N个牧场,牧场被连续地编号为1到N.每一个牧场都是一个奶牛的家.FJ计划除去P条道路中尽可能多的道路, ...

  6. MySQL Join算法与调优白皮书(二)

    Index Nested-Loop Join   (接上篇)由于访问的是辅助索引,如果查询需要访问聚集索引上的列,那么必要需要进行回表取数据,看似每条记录只是多了一次回表操作,但这才是INLJ算法最大 ...

  7. centos如何使用utc时间

    1.将本地时间文件改名,做备份文件为localtime2 mv /etc/localtime /etc/localtime2 2.将UTC文件和本地文件做连接ln -s /usr/share/zone ...

  8. Oracle归档与非归档模式

    一.什么是Oracle归档模式 Oracle数据库有联机重做日志,这个日志是记录对数据库所做的修改,比如插入,删除,更新数据等,对这些操作都会记录在联机重做日志里.一般数据库至少要有2个联机重做日志组 ...

  9. python学习(二十七) 元组

    # 元组是不可变的,不能改变元素的值,也不能增加.减少元素my_tuple = (1, 2, 3, 3)print(my_tuple) # 查找元素位置print(my_tuple.index(2)) ...

  10. ALSA声卡笔记2---ASoC驱动框架

    1.简单了解一下ASOC 在嵌入式系统里面的声卡驱动为ASOC(ALSA System on Chip) ,它是在ALSA 驱动程序上封装的一层   分为3大部分,Machine,Platform和C ...