Glassfish中的JNDI查找失败

时间:2011-05-31 09:20:48

标签: java jdbc glassfish jndi

我正在使用maven工作一个web项目。当我在net-beans 6.8上运行服务器时,构建是成功的,但是当部署到服务器时我得到查找失败的异常。请在以下url中找到服务器日志http://pastie.org/1997218。让我知道我在这里错过了什么。错误的堆栈跟踪是

SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/deliver' in SerialContext  [Root exception is javax.naming.NameNotFoundException: deliver not found]
        at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>    (PersistenceUnitInfoImpl.java:111)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:130)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
        ...

1 个答案:

答案 0 :(得分:2)

您的生产服务器似乎缺少您的应用程序所需的数据库资源jdbc/deliver。您已在NetBeans中为测试实例正确配置了它。查看NetBeans中的“服务”选项卡,确保在服务器上设置了类似的数据库。