openwebbeans-user mailing list archives

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

On Thu, Oct 17, 2013 at 5:25 PM, Mark Struberg <struberg@yahoo.de> wrote:
> Hi Sagara!
>
> Do you have something to share on github or some other way we can reproduce
> this?

First thanks for your prompt response. The good news is once I moved
all dependency Jar files from application's WEB-INF/lib directory to
TOMCAT-HOME/lib directory I got the expected result but still I would
like to keep minimum required set of Jar files on TOMCAT-HOME/lib
directory and move other dependencies into application level lib
directory.  Here I have temporally place my full server archive along
with application source here [1], you can just unzip and run. Once you
move any dependency from TOMCAT-HOME/lib to WEB-INF/lib it will start
to throw various exceptions.  Could you please recommend  what should
go to  TOMCAT-HOME/lib and what should go to WEB-INF/lib directory ?

[1] - http://people.apache.org/~sagara/temp/owb-sample/

>
> It should work fine if you put all the libs into your webapp WEB-INF/lib
> folder
>
> Btw, asm-all-3.1.jar should not be needed at all.
>
> And the most easiest solution would probably be to use the prepackaged
> version, means Apache TomEE [1].
> This is a fully pimped tomcat-7 with OpenWebBeans, MyFaces, BVal, etc. Has
> only 27MB and contains the full JavaEE6 web-profile.
> There is also a tomee-maven-plugin where you can even debug and
> auto-redeploy your app during debug.

Above are very useful information but in my case I'm evaluating OWB to
integrate into a Tomcat based application hosting platform as a CDI
provider, we may need BVal in future but for the moment integrating
Apache TomEE as a whole is not viable option as it require lot of
changes to existing architecture.

Thanks !

>
> LieGrue,
> strub
>
>
> [1] tomee.apache.org
>
>
>
> ________________________________
> From: Sagara Gunathunga <sagaragu@gmail.com>
> To: user@openwebbeans.apache.org
> Sent: Thursday, 17 October 2013, 12:53
> Subject: Issues setting up Openwebbeans Tomcat7 plug-in and Tomcat7-sample
>
> 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
>



-- 
Sagara Gunathunga

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

Mime
View raw message