Failed to lookup JDBC Datasource. Please double check that the JNDI name defined in the resource-description of the EJB's weblogic-ejb-jar.xml file is the same as the JNDI name for the Datasource defined in your config.xml.

解决方案 »

  1.   

    你试试
    DatabSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DataSource");
    然后在XML里面配置
    <res-ref-name>jdbc/DataSource</res-ref-name>
      

  2.   

    嗯,谢谢各位大哥,我现在知道这样配是可以的,不过我想知道一下,DataSource不可以在EJB里面配置的吗?一定要在 Weblogic 里先生成不成?记得以前直接在EJB里写了就可以的了啊…… 
      

  3.   

    DatabSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DataSource");
    还是不行,还是找不到……XML里我已经是这样配置的了
      

  4.   

    这个DataSource是指你在XML里面配的那个,
    就是和数据库直接有关的