0

I'm trying to deploy a bean that uses @Interceptros annotation in Jboss. According to documentation I've created beanRefContext.xml and here is Bean code

@Stateless
@LocalBean
@Interceptors(SpringBeanAutowiringInterceptor.class)
public class ClienteBean implements ClienteBeanLocal {


public ClienteBean() {
    // TODO Auto-generated constructor stub
}

@Autowired
private IClienteDAO cliente;

@Override
public List<ClienteDTO> selectALL() throws Exception {
    return cliente.selectALL();
}

}

I am deploying it inside an EAR. When I try to deploy in Jboss 6 I get the following error:

Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseClassArray(Unknown Source) [:1.7.0_09]
    at sun.reflect.annotation.AnnotationParser.parseArray(Unknown Source) [:1.7.0_09]
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(Unknown Source) [:1.7.0_09]
    at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source) [:1.7.0_09]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source) [:1.7.0_09]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source) [:1.7.0_09]
    at java.lang.Class.initAnnotationsIfNecessary(Unknown Source) [:1.7.0_09]
    at java.lang.Class.getAnnotations(Unknown Source) [:1.7.0_09]
    at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.readAnnotations(IntrospectionTypeInfoFactoryImpl.java:610) [jboss-reflect.jar:2.2.0.GA]
    at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getAnnotations(IntrospectionTypeInfoFactoryImpl.java:126) [jboss-reflect.jar:2.2.0.GA]
    at org.jboss.reflect.plugins.InheritableAnnotationHolder.getDeclaredAnnotations(InheritableAnnotationHolder.java:96) [jboss-reflect.jar:2.2.0.GA]
    at org.jboss.reflect.plugins.ClassInfoImpl.getAnnotations(ClassInfoImpl.java:181) [jboss-reflect.jar:2.2.0.GA]
    at org.jboss.reflect.plugins.AbstractAnnotatedInfo.getUnderlyingAnnotations(AbstractAnnotatedInfo.java:63) [jboss-reflect.jar:2.2.0.GA]
    at org.jboss.scanning.plugins.visitor.ClassHierarchyResourceVisitor.handleClass(ClassHierarchyResourceVisitor.java:76) [:1.0.0.GA]
    at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.doVisit(ReflectResourceVisitor.java:108) [:1.0.0.GA]
    at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:86) [:1.0.0.GA]
    ... 53 more

How can I solve it?

CoolBeans
  • 20,654
  • 10
  • 86
  • 101

1 Answers1

1

Seems JBoss is not seeing SpringBeanAutowiringInterceptor.class. In your EAR file put your spring jars on the lib directory. See if that works.

If you are using maven to assemble your EAR file you can do something like this: http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-module-location.html

gabzprime
  • 11
  • 1