openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagara Gunathunga <sagar...@gmail.com>
Subject Issues setting up Openwebbeans Tomcat7 plug-in and Tomcat7-sample
Date Thu, 17 Oct 2013 10:23:47 GMT
Hi Folks,

I managed to setup OWB 1.0.0-alpha-1 Tomcat7 plug-in on Tomcat 7.0.34
server and further tested OWB tomcat7-sample successfully but when I
try to test same sample using OWB Tomcat7 plug-in version 1.2.0 on
same Tomcat version I'm getting following exception.


SEVERE: Servlet.service() for servlet [injector] in context with path
[/tomcat-sample] threw exception
java.lang.NullPointerException
    at org.apache.webbeans.samples.tomcat.MyFilter.doFilter(MyFilter.java:54)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)


It looks like injection of BeanManager instance on MyFilter class[1]  failed.


I have following dependencies on TOMCAT-HOME/lib directory.
.
├── geronimo-atinject_1.0_spec-1.0.jar
├── geronimo-interceptor_1.1_spec-1.0.jar
├── geronimo-jcdi_1.0_spec-1.0.jar
├── openwebbeans-impl-1.2.0.jar
├── openwebbeans-spi-1.2.0.jar
├── openwebbeans-tomcat7-1.2.0.jar
├── openwebbeans-web-1.2.0.jar


And following dependencies on web application lib  directory (WEB-INF/lib)
.
├── asm-all-3.1.jar
├── openwebbeans-ee-1.2.0.jar
├── openwebbeans-ee-common-1.2.0.jar
├── openwebbeans-el10-1.2.0.jar
├── openwebbeans-impl-1.2.0.jar
├── openwebbeans-resource-1.2.0.jar
├── openwebbeans-web-1.2.0.jar
├── tomcat-sample.jar
├── xbean-asm-shaded-3.13.jar
└── xbean-finder-3.13.jar

I have added above dependencies according to the guide here[2 ]. FYI I
have following dependencies when i test using OWB 1.0.0-alpha-1
version (Which is the working version for me)

TOMCAT-HOME/lib
.
├── geronimo-atinject_1.0_spec-1.0.jar
├── geronimo-interceptor_1.1_spec-1.0.jar
├── geronimo-jcdi_1.0_spec-1.0.jar
├── openwebbeans-spi-1.0.0-alpha-1.jar
├── openwebbeans-tomcat7-1.0.0-alpha-1.jar

wen application lib (WEB-INF/lib)

.
├── javassist-3.12.1.GA.jar
├── openwebbeans-impl-1.0.0-alpha-1.jar
├── openwebbeans-resource-1.0.0-alpha-1.jar
├── openwebbeans-web-1.0.0-alpha-1.jar
├── scannotation-1.0.2.jar
└── tomcat-sample.jar


I spent several hours on Google/mail archives and testing with number
of Jar file combinations but still no luck, I'm really appreciate if
some one can point me to the right direction to setup OWB 1.2.0
tomcat7 plug-in.


Note : Even with OWB 1.0.0-alpha-1 version I had to remove following
injection from CurrentDateProvider[3] in order to get it work but I
think it's a separate issue.

// private @Inject Principal principal;



[1] - http://svn.apache.org/repos/asf/openwebbeans/tags/openwebbeans-1.2.0/samples/tomcat7-sample/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
[2] - http://openwebbeans.apache.org/openwebbeans-impl.html
[3] - http://svn.apache.org/repos/asf/openwebbeans/tags/openwebbeans-1.2.0/samples/tomcat7-sample/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java


Thanks !
-- 
Sagara Gunathunga

Blog - ssagara.blogspot.com
Web - http://people.apache.org/~sagara
Linkedin - http://www.linkedin.com/in/ssagara

Mime
View raw message