I'm having trouble setting up a simple hello world WAR with OpenWebBeans 1.1.5 and Tomcat 7, following this article [1], which may not be up to date, but I couldn't find anything more recent.

I copied openwebbeans-tomcat7, openwebbeans-web and all dependencies to ${catalina.home}/lib and added the ContextLifecycleListener to server.xml.

When deploying my app to Tomcat, I get this exception:

Caused by: java.lang.IllegalAccessException: Class org.apache.webbeans.web.tomcat.TomcatUtil can not access a member of class org.apache.webbeans.inject.OWBInjector with modifiers "private"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.Class.newInstance0(Class.java:349)
        at java.lang.Class.newInstance(Class.java:308)
        at org.apache.webbeans.web.tomcat.TomcatUtil.inject(TomcatUtil.java:28)
at org.apache.webbeans.web.tomcat.ContextLifecycleListener.containerEvent(ContextLifecycleListener.java:182)


The problem seems to be that TomcatUtil invokes the default constructor of OWBInjector by reflection, but OWBInjector only has a private constructor and a static inject() method.

Is it just my setup, or is this a regression caused by [2]?

[1] http://java.dzone.com/articles/using-apache-openwebbeans
[2] https://issues.apache.org/jira/browse/OWB-689

Best regards,
Harald

Reply via email to