NameNotFoundException 在 weblogic 中

huangapple go评论162阅读模式
英文:

NameNotFoundException in weblogic

问题

I have a web application that has been written in java.When I run my webLogic server, the server is running. But when I send a SOAP request it gives Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI'.

我有一个用Java编写的Web应用程序。当我运行我的WebLogic服务器时,服务器正在运行。但是当我发送SOAP请求时,它会显示"Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI'."

I tested my jndi configuration, it is working(pass and username are correct).I realized there is no deployed instance of this data source in monitoring tab on weblogic. I think problem is here. Do you have any idea?

我测试了我的JNDI配置,它是有效的(用户名和密码是正确的)。我注意到在WebLogic的监控选项卡中没有部署此数据源的实例。我认为问题出在这里。你有什么想法吗?

MY error code : Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'efaturaQdbDataSource' defined in class path resource [applicationContext-efatura-data.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI' at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 98 more Caused by: javax.naming.NameNotFoundException: Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI' at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139) at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252) at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182) at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206) at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254) at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201) at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ... 105 more

我的错误代码:`由于org.springframework.beans.factory.BeanCreationException引起:在类路径资源[applicationContext-efatura-data.xml]中定义的名为'efaturaQdbDataSource'的bean创建错误:调用init方法失败;嵌套异常是javax.naming.NameNotFoundException:无法解析'xxx-yyyy-zzz-JNDI'。已解析'';剩余名称'xxx-yyyy-zzz-JNDI'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 98 more
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
at org.springframework.jndi.J

英文:

I have a web application that has been written in java.When I run my webLogic server, the server is running. But when I send a SOAP request it gives Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI'.

I tested my jndi configuration, it is working(pass and username are correct).I realized there is no deployed instance of this data source in monitoring tab on weblogic. I think problem is here. Do you have any idea?

MY error code : Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'efaturaQdbDataSource' defined in class path resource [applicationContext-efatura-data.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 98 more
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'xxx-yyyy-zzz-JNDI'. Resolved ''; remaining name 'xxx-yyyy-zzz-JNDI'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 105 more

答案1

得分: 0

感谢您分享整个堆栈跟踪,现在问题更容易理解。

由于:org.springframework.beans.factory.BeanCreationException:在类路径资源[applicationContext-efatura-data.xml]中定义的名为'efaturaQdbDataSource'的bean创建错误。

我认为您正面临名为efaturaQdbDataSource的数据源的问题。因此,您应该首先创建数据源,按照此指南进行操作。按照这些步骤后,您将在JNDI树中看到数据源。

根据我的经验,这是管理数据源的最佳方式,而不是将其包含在应用程序中,为什么呢?因为这样可以将数据源的配置和管理与应用程序分开,这在您的应用程序处于生产环境时非常有用。

英文:

Thanks a lot for sharing the whole stack trace, now the problem is more understandable.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'efaturaQdbDataSource' defined in class path resource [applicationContext- 
 efatura-data.xml]

I think you are facing issues with the data source called efaturaQdbDataSource. Therefore, you should create the data source first following this guide. After following these steps you will see the data source within the JNDI tree.

In my experience this is the best way to manage a data source instead of including it as part of your application why? because you will split the configuration of the data source and its administration from your application, which is useful when your application is in production.

huangapple
  • 本文由 发表于 2020年8月12日 16:05:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/63372344.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定