openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de>
Subject Re: Enabling OpenWebBeans on Tomcat
Date Tue, 23 Dec 2014 10:54:41 GMT
Hi Ivan!
Do you have some sample on github which we can 'polish'? :)
LieGrue,strub
 

     On Tuesday, 23 December 2014, 10:14, Ivan St. Ivanov <ivan.st.ivanov@gmail.com>
wrote:
   
 

 Hello,
I have a question about integrating OpenWebBeans with a pure Tomcat server.
I looked for some solutions in the internet and here is what I did with my project:
First I added some dependencies to the pom.xml:
<dependency>
    <groupId>javax.enterprise</groupId>
    <artifactId>cdi-api</artifactId>
    <version>1.2</version>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-spi</artifactId>
    <version>1.2.7</version>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-impl</artifactId>
    <version>1.2.7</version>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-web</artifactId>
    <version>1.2.7</version>
</dependency> Having them, I was able to compile and deploy my project, however the
dependency injection simply did not work.
Then I additionally added the following dependency:
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-tomcat7</artifactId>
    <version>1.2.7</version>
</dependency>
And also created context.xml file under the src/main/webapp/META-INF folder of my app with
the following content:
<Context>
    <Listener className=
      "org.apache.webbeans.web.tomcat7.ContextLifecycleListener"/>
</Context>

However, this time I had deployment issue:
Dec 22, 2014 6:54:28 PMorg.apache.tomcat.util.digester.Digester startElementSEVERE: Begin
eventthrew exceptionjava.lang.ClassNotFoundException:org.apache.webbeans.web.tomcat.ContextLifecycleListener       
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)       
at java.security.AccessController.doPrivileged(Native Method)        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)       
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)       
atorg.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144)       
atorg.apache.tomcat.util.digester.Digester.startElement(Digester.java:1288)       
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
I tried to tackle that with adding the OWB jars in the tomcat/lib folder. But gave it up after
the fifth ClassNotFoundError. It is not an option for me anyway: I am not in control of the
productive server, so I cannot touch its lib directory.
I also looked in the OpenWebBeans samples, but they don't even package the jars with them.
Can anyone share their experience with me?
Thanks a lot!Ivan




 
   
Mime
View raw message