Discussion:
[jboss-user] [EJB3] - Re: ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
Fernando de Diego
2012-05-18 20:18:38 UTC
Permalink
Fernando de Diego [https://community.jboss.org/people/fdediego.jboss] created the discussion

"Re: ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy"

To view the discussion, visit: https://community.jboss.org/message/736584#736584

--------------------------------------------------------------
Did you find the solution for this?

I have the same problem. In my app there is a SLSB and my intention is to inject it some beans using Spring, so I added the interceptor "@Interceptors(SpringBeanAutowiringInterceptor.class)".

@Stateless(name="ejb/greeter")
@Interceptors(SpringBeanAutowiringInterceptor.class)
public class GreeterBean implements Greeter{

    public String sayHi() {
        return "Hi!!! Hello World !!!";
    }
...

It then started to throw java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy.

22:16:40,347 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.subunit."pi-ear.ear"."pi-ejb3-0.0.1-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."pi-ear.ear"."pi-ejb3-0.0.1-SNAPSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "pi-ejb3-0.0.1-SNAPSHOT.jar" of deployment "pi-ear.ear"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653) [rt.jar:1.6.0_31]
    at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460) [rt.jar:1.6.0_31]
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286) [rt.jar:1.6.0_31]
    at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222) [rt.jar:1.6.0_31]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69) [rt.jar:1.6.0_31]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52) [rt.jar:1.6.0_31]
    at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070) [rt.jar:1.6.0_31]
    at java.lang.Class.getAnnotation(Class.java:3029) [rt.jar:1.6.0_31]
    at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getRemoteBusinessInterfaces(BusinessViewAnnotationProcessor.java:150)
    at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.processViewAnnotations(BusinessViewAnnotationProcessor.java:123)
    at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:98)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
    ... 5 more

I googled and I saw answers as the one jaikiran gave you, but if I remove the '@interceptors...' line and add one line using SpringBeanAutowiringInterceptor only to see if the class is reached, the class is found.

@Stateless(name="ejb/greeter")
public class GreeterBean implements Greeter{

    public String sayHi() {
        SpringBeanAutowiringInterceptor sb = new SpringBeanAutowiringInterceptor();
        return "Hi!!! Hello World !!!";
    }
...


Please, tell me if you resolved this.

Best regards,
Fer







@Stateless(name="ejb/greeter")
//@Interceptors(SpringBeanAutowiringInterceptor.class)
public class GreeterBean implements Greeter{
    public String sayHi() {
        SpringBeanAutowiringInterceptor sb = new SpringBeanAutowiringInterceptor();
        return "Hi!!! Hello World !!!";
    }
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/736584#736584]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Fernando de Diego
2012-05-19 15:54:10 UTC
Permalink
Fernando de Diego [https://community.jboss.org/people/fdediego.jboss] created the discussion

"Re: ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy"

To view the discussion, visit: https://community.jboss.org/message/736634#736634

--------------------------------------------------------------
I think I got it: it was WTP/JBoss not deploying the application.xml file from the ear. The weird thing is that Maven generates it every time, but the file not always (sometimes yes, sometimes no) is deployed to JBoss. It doesn't even work copying the file by hand, I have to remove de app from the server and redeploy it.

Any explanation?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/736634#736634]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Nico Nico
2012-09-20 03:19:23 UTC
Permalink
Nico Nico [https://community.jboss.org/people/zenzei2k] created the discussion

"Re: ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy"

To view the discussion, visit: https://community.jboss.org/message/760477#760477

--------------------------------------------------------------
I'm getting the same exception. In my case, the problem seems to be the SpringLifecycleInterceptor interceptor class. Only after adding the snowdrop-deployers.jar to my .ear the problem dissapear although I have already install snowdrop in the modules folder, and then added the extension org.jboss.snowdrop to my configuration.

I suppose adding the snowdrop jar to my ear isn't the right solution, so I'l glad to hear to the right one!
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/760477#760477]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Jarkko Rantavuori
2013-04-09 16:57:03 UTC
Permalink
Jarkko Rantavuori [https://community.jboss.org/people/jrantav] created the discussion

"Re: ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy"

To view the discussion, visit: https://community.jboss.org/message/807269#807269

--------------------------------------------------------------
Seeing the same exception with JBoss EAP 6.1.alpha (AS 7.2).

Isn't this a bug as in it's not even telling which class is the problem? It just says

java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

which doesn't really help much.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/807269#807269]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Loading...