简体   繁体   English

从独立客户端访问部署在JBoss 7.1.1上的WAR中的@Remote EJB

[英]access @Remote EJB deployed in WAR on JBoss 7.1.1 from standalone client

I'm a bit lost. 我有点迷茫。 I've been googling around for quite long time. 我一直在谷歌搜索很长一段时间。 Is it possible to access EJB with @Remote that is packaged into WAR file from standalone java client? 是否可以使用从独立Java客户端打包到WAR文件中的@Remote访问EJB? I'm using JBoss 7.1.1 and every combination of JNDI names I try I keep getting NameNotFoundException. 我正在使用JBoss 7.1.1和JNDI名称的每个组合,我尝试继续获取NameNotFoundException。

I can't find anything about that in doc. 我在doc中找不到任何相关内容。 It is only said that in the Java EE web profile @Remote is not supported, but I suppose that if I'm running it on JBoss 7.1.1 it is run on the full profile not on the web one (just because it is packaged in WAR). 只是说在Java EE Web配置文件中不支持@Remote ,但我想如果我在JBoss 7.1.1上运行它,它将在完整的配置文件上运行,而不是在web上运行(因为它是打包的)在WAR)。

Try this doc . 试试这个文档 If this is too long for you, you can check out my example code at github 如果这对你来说太长了,你可以在github上查看我的示例代码

Important things to note: 需要注意的重要事项:

  1. See your jboss/bin/client/README.txt for how to easily include the relevant libraries 有关如何轻松包含相关库的信息,请参阅jboss/bin/client/README.txt
  2. Use the ejb:/... name for lookup; 使用ejb:/...名称进行查找; the java:... names you see in log at deploy are note remotely exposed 您在部署日志中看到的java:...名称是远程公开的注释
  3. The two *.properties files: in some cases (when some libraries are missing etc.) you might think you need to add something into them, but they're fine; 两个*.properties文件:在某些情况下(当某些库丢失等)时,您可能认为需要在其中添加一些内容,但它们很好; make sure you set up everything else correctly. 确保正确设置其他所有内容。

You need to generate an EAR file.. that means you have a Java EE application not only web. 您需要生成一个EAR文件..这意味着您有一个Java EE应用程序,而不仅仅是Web。 Then you'll be able to locate and call your remote EJB from a java client. 然后,您将能够从Java客户端找到并调用远程EJB。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM