users@glassfish.java.net

Re: GlassFish 3, Stateless EJB Lite, JEE6, SpringBeanAutowiringInterceptor

From: <glassfish_at_javadesktop.org>
Date: Thu, 03 Jun 2010 19:45:28 PDT

It may have to do with the way the interceptor class is packaged and scanned for annotations. It's possible the scanner didn't dive deep enough to detect the method-level annotations for classes under WEB-INF/lib/*.jar, though it works fine for top-level component annotations.

I'd do one of the followings:

(a), add ejb-jar.xml to WEB-INF/lib:

<?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.1" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
    <interceptors>
        <interceptor>
            <interceptor-class>
org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor
            </interceptor-class>
        </interceptor>
    </interceptors>
</ejb-jar>

(b), copy org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor to WEB-INF/classes to ease scanning.
[Message sent by forum member 'cf126330']

http://forums.java.net/jive/thread.jspa?messageID=472687