[英]how to fix Javax. Naming.exception: nameNotFoundException <my_JNDI_name> not found
I got this exception while trying to deploy ejb-jar file on a glassfish 2.1:尝试在 glassfish 2.1 上部署 ejb-jar 文件时遇到此异常:
Javax.爪哇。 Naming.exception: nameNotFoundException not found. Naming.exception:未找到 nameNotFoundException。
This drive me to be crazy... I don't know why i got this exception while when i launch the hole application (ear) using Netbeans 6.7.1 with integrated glassfish 2.1 it work like magic !这让我发疯......我不知道为什么当我使用带有集成 glassfish 2.1 的 Netbeans 6.7.1 启动孔应用程序(耳朵)时出现此异常,它就像魔术一样工作!
But when i try to deploy it manually under another glassfish in an other pc it does not work但是当我尝试在另一台电脑的另一台 glassfish 下手动部署它时,它不起作用
And i am having this exception when i try to deploy it So i think that the ejb module does not find out how to link to the database当我尝试部署它时我遇到了这个异常所以我认为ejb模块没有找到如何链接到数据库
So it must be something that the netbeans do and i am not, when deploying the ejb-jar Any help?所以它必须是 netbeans 做的事情,而我不是,在部署 ejb-jar 有帮助吗?
I realise this is a bit old, but having just worked through this, I thought I may as well document it here.我意识到这有点老了,但是刚刚完成了这个,我想我不妨在这里记录一下。
For me the issue was the database connection.对我来说,问题是数据库连接。 In your project you should have a persistence.xml file (mine was in the EJB project), which details the database connection parameters.在您的项目中,您应该有一个 persistence.xml 文件(我的是在 EJB 项目中),其中详细说明了数据库连接参数。 I was using a localhost URL, but when I ran the database project, I noticed in my Services tab under Glassfish that no database connection was being registered.我使用的是本地主机 URL,但是当我运行数据库项目时,我注意到 Glassfish 下的“服务”选项卡中没有注册数据库连接。
Here's what I did:这是我所做的:
This worked for me, hope it's helpful for someone else.这对我有用,希望对其他人有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.