WebLogic中JNDI遇到的非常非常小的问题:

错误如下:

javax.naming.NameNotFoundException: Unable to resolve 'jdbc.mydb'. Resolved 'jdbc'; remaining name 'mydb'at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1180)at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:270)at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:187)at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:210)at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:224)at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:253)at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:426)at javax.naming.InitialContext.lookup(InitialContext.java:411)at jsp_servlet.__index._jspService(__index.java:101)at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:238)at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3363)at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)

代码连接如下:

DataSource ds = (DataSource)ctx.lookup(“jdbc.mydb”);

出现这个是由于没有找到JNDI,(其实是废话,报错已经说明了 ^_^);

解决方法:

在Weblogic数据源管理中的

JDBC Data Source-0的设置

中设置目标选项

将服务勾选上,如默认的:AdminServer

保存后即可;

javax.naming.NameNotFoundException:相关推荐

  1. EJB3.0异常总结---Exception in thread “main“ javax.naming.NameNotFoundException: StatelessEjbBean not bou

    Exception in thread "main" javax.naming.NameNotFoundException: StatelessEjbBean not bound ...

  2. 解决javax.naming.NameNotFoundException

    在web.xml中加入: <context-param><param-name>spring.profiles.active</param-name><par ...

  3. Package javax.naming

    提供用于访问命名服务的类和接口. 该包定义了Java命名和目录接口的命名操作(JNDI). JNDI为使用Java编程语言编写的应用程序提供命名和目录功能. 它旨在独立于任何特定的命名或目录服务实现. ...

  4. javax.naming.NoInitialContextException: Need to specify class name in environment or system property

    javax.naming.NoInitialContextException: Need to specify class name in environment or system property ...

  5. 在Filfter中使用注解了spring 的bean,报javax.naming.NamingException: Cannot create resource instance...

    为什么80%的码农都做不了架构师?>>>    严重: Servlet /xcfhinvoices threw load() exception javax.naming.Namin ...

  6. javax.naming.OperationNotSupportedException: Context is read only

    场景: 最近帮忙升级Tomcat版本时发现日志有这个异常: javax.naming.OperationNotSupportedException: Context is read only 原因: ...

  7. javax.naming.NamingException: No naming context bound to this class loader

    1.错误描述 警告: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHo ...

  8. tomcat启动报javax.naming.NamingException: No naming context bound to this class loader

    tomcat启动报如下错误 javax.naming.NamingException: No naming context bound to this class loader      at org ...

  9. javax.naming.CommunicationException:simple bind faild

    发生异常: javax.naming.CommunicationException:simple bind faild: 办法一: 项目启动配置添加 -Dcom.sun.jndi.ldap.objec ...

最新文章

  1. 双圆弧插值算法(二)
  2. python 递归调用
  3. oracle tns连接拒绝,TNS-12564: TNS: 拒绝连接(new)
  4. linux cat EOF 变量自动解析问题
  5. STM32开发 -- 可调直流稳压电源
  6. 高性能服务器开发之C++定时器
  7. sv队列和动态数组的区别_Go 刷 LeetCode 系列:经典(7) 设计双端队列
  8. katalon进行app测试_Katalon API 测试 Demo
  9. Android工具里没有Android,android – AppCompat工具栏没有显示
  10. Django框架——查询集QuerySet
  11. echarts 图例太多放不下怎么办_段码液晶屏笔段太多,引脚放不下怎么办?
  12. Faster R-CNN——学习笔记~
  13. 17秋 SDN课程 第一次作业
  14. 拓端tecdat|R语言逻辑回归(Logistic Regression)、回归决策树、随机森林信用卡违约分析信贷数据集
  15. android 拼图小游戏
  16. 1.74HC138控制LED发光
  17. bandicam——轻松录屏
  18. 【Mybatis】动态SQL之choose标签
  19. kinova_j2s6s300【Cartesian position control Finger position control】
  20. 有关H5第八章的页面布局与规划介绍

热门文章

  1. Hashtable与Dictionary
  2. 计算机windows多用户,windows Server 2012 专业版配置多用户远程桌面连接
  3. Github使用1-入门
  4. jQuery对HTML进行添加元素
  5. pandas对每十行做批量操作_pandas批量处理数据
  6. sql2008安装包_数据库SQL2008下载与安装图文详解
  7. 电脑键盘下划线怎么打_电脑键盘右边的数字键无法使用怎么办?
  8. android 按比例缩放,Android postScale不按比例缩放
  9. php+redis队列流程
  10. 为什么非全站升级HTTPS不可?