战争中ejb的JBoss 7 jndi名称 [英] JBoss 7 jndi names of ejb's package in war
问题描述
有人知道如何为在JBoss 7.2(EAP 6.1)下的战争中部署的ejb修改全局jndi名称的模块"组件吗?
Does anyone know how to modify the "module" component of the global jndi names for ejb's deployed in a war under JBoss 7.2 (EAP 6.1)?
根据规范,模块名称与基本战争名称相同,在我的情况下,该名称包括版本号.
Per spec, the module name is the same as the base war name, which in my case includes a version number.
这是甲骨文的规格:
java:global/[<application-name>]/<module-name>/<bean-name>
在我看来,它是屈服的:
In my case it yeilds:
java:/global/mywar-1.0/MyService
我想要的是:
java:/global/mywar/MyService
我知道我可以在部署之前修改war的名称,但希望通过配置文件显式命名模块.我试图使用ejb-jar.xml模块名,但是没有效果.
I know I can modify the name of the war prior to deployment, but would prefer to explicitly name the module via configuration file. I have attempted to use the ejb-jar.xml module-name, but it had no effect.
推荐答案
已解决:我最终不得不为web.xml的更高版本3.0规范添加/更新xsd/命名空间.这允许在web.xml中指定模块名称"元素,该元素将在创建jndi名称时使用.经过测试并在JBoss EAP 6.1上工作.
Solved: I ended up having to include/update the xsd/namespace for the later 3.0 spec for web.xml. This allows for a "module-name" element to be specified in the web.xml which will be used when creating the jndi name. Tested and working on JBoss EAP 6.1.
这是web.xml标头和模块名称元素:
Here's the web.xml header and module-name element:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<module-name>mywar</module-name>
这篇关于战争中ejb的JBoss 7 jndi名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!