JBoss 7 jndi names of ejb's package in war

一个人想着一个人 提交于 2019-12-05 18:35:48

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.

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>

What you need to do is create a jboss-web.xml and put it in META-INF right next to the web.xml. Put this inside it:

<jboss-web>
    <context-root>mywar</context-root>
</jboss-web>

Cheers!

If this was packaged in an EAR, you would use the application.xml to do this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!