项目

一般

简介

应用部署出现:Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0异常

由 何 善才 在 大约 3 年 之前添加

异常详情:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'erms2DataSource' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: erms2 [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    at com.apusic.web.container.EventBroadcaster.fireContextInitializedEvent(EventBroadcaster.java:213)
    at com.apusic.web.container.WebContainer.finishContextInitialization(WebContainer.java:1284)
    at com.apusic.web.container.WebContainer.start(WebContainer.java:304)
    at com.apusic.web.http.VirtualHost.addContext(VirtualHost.java:154)
    at com.apusic.web.http.HttpServer.loadWebModule(HttpServer.java:224)
    at com.apusic.web.WebService.loadWebModule(WebService.java:591)
    at com.apusic.deploy.runtime.WebModule.load(WebModule.java:1963)
    at com.apusic.deploy.runtime.J2EEApplication.loadModules(J2EEApplication.java:1303)
    at com.apusic.deploy.runtime.J2EEApplication.startApplication(J2EEApplication.java:1209)
    at com.apusic.deploy.runtime.J2EEApplication.startService(J2EEApplication.java:1065)
    at com.apusic.service.Service.start(Service.java:205)
    at com.apusic.deploy.runtime.J2EEDeployer.deploy(J2EEDeployer.java:508)
    at com.apusic.deploy.runtime.J2EEDeployer.deploy(J2EEDeployer.java:399)
    at com.apusic.deploy.runtime.J2EEDeployer.deploy(J2EEDeployer.java:671)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.apusic.jmx.MBeanDescriptor.invoke(MBeanDescriptor.java:551)
    at com.apusic.jmx.DynamicMBeanSupport.invoke(DynamicMBeanSupport.java:62)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at com.apusic.aasadmin.core.jvm.jmx.util.MBeanInvokeUtils.invoke(MBeanInvokeUtils.java:683)
    at com.apusic.aasadmin.core.jvm.jmx.util.MBeanInvokeUtils.invoke(MBeanInvokeUtils.java:593)
    at com.apusic.aasadmin.core.server.aasengine.app.AASAppServerServiceImpl.deployAppInClient(AASAppServerServiceImpl.java:130)
    at com.apusic.aasadmin.core.app.impl.ApplifeCycleServiceImpl.deployAppInClient(ApplifeCycleServiceImpl.java:52)
    at com.apusic.aasadmin.monitor.web.controller.ApplicationMgmtController.deployApp(ApplicationMgmtController.java:361)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at com.apusic.web.container.ServletComponent.service(ServletComponent.java:87)
    at com.apusic.web.container.ServletFilterWrapper.doFilter(ServletFilterWrapper.java:38)
    at com.apusic.web.container.FilterChainImpl.doFilter(FilterChainImpl.java:48)
    at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:290)
    at com.apusic.web.container.FilterComponent.doFilter(FilterComponent.java:65)
    at com.apusic.web.container.FilterChainImpl.performFilter(FilterChainImpl.java:38)
    at com.apusic.web.container.FilterChainImpl.doFilter(FilterChainImpl.java:45)
    at com.apusic.aasadmin.monitor.web.filter.AuthorityFilter.doFilter(AuthorityFilter.java:295)
    at com.apusic.web.container.FilterComponent.doFilter(FilterComponent.java:65)
    at com.apusic.web.container.FilterChainImpl.performFilter(FilterChainImpl.java:38)
    at com.apusic.web.container.FilterChainImpl.doFilter(FilterChainImpl.java:45)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at com.apusic.web.container.FilterComponent.doFilter(FilterComponent.java:65)
    at com.apusic.web.container.FilterChainImpl.performFilter(FilterChainImpl.java:38)
    at com.apusic.web.container.WebContainer.invoke(WebContainer.java:1166)
    at com.apusic.web.container.WebContainer.doProcessRequest(WebContainer.java:947)
    at com.apusic.web.container.WebContainer.processRequest(WebContainer.java:809)
    at com.apusic.web.http.VirtualHost.processRequest(VirtualHost.java:370)
    at com.apusic.web.http.HttpServer.processRequest(HttpServer.java:317)
    at com.apusic.web.http.HttpConnectionHandler.service(HttpConnectionHandler.java:26)
    at com.apusic.web.http.ConnectionHandler.processRequest(ConnectionHandler.java:360)
    at com.apusic.web.http.ConnectionHandler.processConnection(ConnectionHandler.java:138)
    at com.apusic.web.http.ConnectionHandler.run(ConnectionHandler.java:52)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NameNotFoundException: erms2 [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    at com.apusic.naming.jndi.CNContext.mapException(CNContext.java:1064)
    at com.apusic.naming.jndi.CNContext.doResolve(CNContext.java:609)
    at com.apusic.naming.jndi.CNContext.lookup(CNContext.java:542)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)
    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    ... 86 more
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    at com.apusic.naming.ins.TransientNamingContext.local_resolve(TransientNamingContext.java:485)
    at com.apusic.naming.jndi.NamingContextWrapper$TransientNamingContextWrapper.resolve(NamingContextWrapper.java:145)
    at com.apusic.naming.jndi.CNContext.resolveWithFailover(CNContext.java:628)
    at com.apusic.naming.jndi.CNContext.doResolve(CNContext.java:555)
    ... 98 more

异常原因:

应用配置数据源文件中的jndi名称与中间件配置数据源jndi名称导致的。

应用数据源对应配置:

中间件对应的数据源配置:
 

解决:
 

应用数据源对应配置 value 与中间件中的 jndi名称保持一致便可以解决。