java - How to include ejb-jar.xml in .war -


my ejb-jar.xml contained in war not loaded when package inside .ear use on jboss-eap-6.0.0/maven3

here .ear file contains:

 -- lib/other.jar  -- mesejbs.jar (with meta-inf/ejb-jar.xml)  -- monwar.war (with web-inf/ejb-jar.xml) 

here mesejbs.jar/meta-inf/ejb-jar.xml:

<?xml version="1.0" encoding="utf-8"?> <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="3.0"     xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">      <interceptors>         <interceptor>             <interceptor-class>monpackage.ejb.log.loginterceptor</interceptor-class>         </interceptor>     </interceptors>      <assembly-descriptor>         <interceptor-binding>             <ejb-name>*</ejb-name>             <interceptor-class>monpackage.ejb.log.loginterceptor</interceptor-class>         </interceptor-binding>     </assembly-descriptor> </ejb-jar> 

loginterceptor succcessfully invoked.

here monwar.war/web-inf/ejb-jar.xml:

<?xml version="1.0" encoding="utf-8"?> <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="3.0"     xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">      <interceptors>         <!-- default interceptors -->         <interceptor>             <interceptor-class>monpackage.web.interceptors.securityinterceptor</interceptor-class>         </interceptor>     </interceptors>      <assembly-descriptor>         <interceptor-binding>             <ejb-name>*</ejb-name>             <interceptor-class>monpackage.web.interceptors.securityinterceptor</interceptor-class>         </interceptor-binding>     </assembly-descriptor> </ejb-jar> 

but securityinterceptor never invoked !

how activate securityinterceptor?

i've understood problem. not du ejb-jar.xml in war. right. it's du cdi not enabled both ejbmodule , webmodule. here explanations : https://issues.jboss.org/browse/weld-778

so put ejbmodule in webmodule :

 -- lib/other.jar  -- monwar.war (with web-inf/ejb-jar.xml)      -- web-inf/lib/mesejbs.jar (with meta-inf/ejb-jar.xml) 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -