You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Dain Sundstrom <da...@iq80.com> on 2007/01/26 00:57:19 UTC
@EJB injection for Jetty
I added a simple hack to get @EJB injection working in Jetty. It is
hack is just a trimmed down version of the Tomcat
DefaultAnnotationProcess or which only handles @EJB injection.
As with the Tomcat version, this is only in there to demonstrate the
@EJB annotation use and is by no means a final solution for
annotation processing.
-dain
Re: @EJB injection for Jetty
Posted by Paul McMahan <pa...@gmail.com>.
I think the NPE you saw was addressed by
http://svn.apache.org/viewvc?view=rev&revision=500424
Best wishes,
Paul
On 1/29/07, Jarek Gawor <jg...@gmail.com> wrote:
> Not sure what happened but it is also working for me know (using latest trunk).
>
> Jarek
>
> On 1/27/07, Prasad Kashyap <go...@gmail.com> wrote:
> > OK. Now I have verified the @EJB injection jack for Jetty on TRUNK and
> > have found it to be working.
> >
> > Cheers
> > Prasad
> >
> > On 1/27/07, Prasad Kashyap <go...@gmail.com> wrote:
> > > No I haven't verified the @EJB injection on Jetty. I believe it is
> > > only on trunk. I was working on getting my M2 build to work. (unable
> > > to resolve dependency o.a.g.specs.geronimo-ejb_3.0_specs//jar)
> > >
> > > When I finally gave on M2 build and work on trunk, I hit the
> > > following problem -
> > >
> > > Missing:
> > > ----------
> > > 1) org.apache.openejb:container:pom:3.0-incubating-SNAPSHOT
> > > Path to dependency:
> > > 1) org.apache.geronimo.modules:geronimo-openejb:jar:2.0-SNAPSHOT
> > > 2) org.apache.openejb:openejb-ejbd:jar:3.0-incubating-SNAPSHOT
> > > 3) org.apache.openejb:container:pom:3.0-incubating-20070126.211327-22
> > >
> > > Cheers
> > > Prasad
> > >
> > >
> > > On 1/26/07, Dain Sundstrom <da...@iq80.com> wrote:
> > > > What did you run? This worked great for me an Prasad.
> > > >
> > > > Anyway, I changed the code to catch Exception instead of just
> > > > NamingExcetpion.
> > > >
> > > > -dain
> > > >
> > > > On Jan 26, 2007, at 9:26 AM, Jarek Gawor wrote:
> > > >
> > > > > Dain,
> > > > >
> > > > > This hack is causing problems:
> > > > >
> > > > > java.lang.NullPointerException
> > > > > at
> > > > > org.apache.xbean.naming.context.ContextFlyweight.listBindings(Context
> > > > > Flyweight.java:92)
> > > > > at
> > > > > org.apache.xbean.naming.context.ContextFederation.getFederatedBinding
> > > > > s(ContextFederation.java:72)
> > > > > at
> > > > > org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(
> > > > > AbstractFederatedContext.java:63)
> > > > > at org.apache.xbean.naming.context.AbstractContext.getBinding
> > > > > (AbstractCo
> > > > > ntext.java:86)
> > > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > > (AbstractContex
> > > > > t.java:128)
> > > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > > (AbstractContex
> > > > > t.java:607)
> > > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > > (AbstractContex
> > > > > t.java:151)
> > > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > > (AbstractContex
> > > > > t.java:593)
> > > > > at javax.naming.InitialContext.lookup(InitialContext.java:351)
> > > > > at
> > > > > org.apache.geronimo.jetty6.InjectionServletHandler.processAnnotations
> > > > > (InjectionServletHandler.java:48)
> > > > > at
> > > > > org.apache.geronimo.jetty6.InjectionServletHandler.customizeServlet(I
> > > > > njectionServletHandler.java:38)
> > > > >
> > > > > I think you need setup the component context properly first (see code
> > > > > in jetty6.handler.ComponentContextHandler) in order to get the JNDI
> > > > > context.
> > > > >
> > > > > Jarek
> > > > >
> > > > > On 1/25/07, Dain Sundstrom <da...@iq80.com> wrote:
> > > > >> I added a simple hack to get @EJB injection working in Jetty. It is
> > > > >> hack is just a trimmed down version of the Tomcat
> > > > >> DefaultAnnotationProcess or which only handles @EJB injection.
> > > > >>
> > > > >> As with the Tomcat version, this is only in there to demonstrate the
> > > > >> @EJB annotation use and is by no means a final solution for
> > > > >> annotation processing.
> > > > >>
> > > > >> -dain
> > > > >>
> > > >
> > > >
> > >
> >
>
Re: @EJB injection for Jetty
Posted by Jarek Gawor <jg...@gmail.com>.
Not sure what happened but it is also working for me know (using latest trunk).
Jarek
On 1/27/07, Prasad Kashyap <go...@gmail.com> wrote:
> OK. Now I have verified the @EJB injection jack for Jetty on TRUNK and
> have found it to be working.
>
> Cheers
> Prasad
>
> On 1/27/07, Prasad Kashyap <go...@gmail.com> wrote:
> > No I haven't verified the @EJB injection on Jetty. I believe it is
> > only on trunk. I was working on getting my M2 build to work. (unable
> > to resolve dependency o.a.g.specs.geronimo-ejb_3.0_specs//jar)
> >
> > When I finally gave on M2 build and work on trunk, I hit the
> > following problem -
> >
> > Missing:
> > ----------
> > 1) org.apache.openejb:container:pom:3.0-incubating-SNAPSHOT
> > Path to dependency:
> > 1) org.apache.geronimo.modules:geronimo-openejb:jar:2.0-SNAPSHOT
> > 2) org.apache.openejb:openejb-ejbd:jar:3.0-incubating-SNAPSHOT
> > 3) org.apache.openejb:container:pom:3.0-incubating-20070126.211327-22
> >
> > Cheers
> > Prasad
> >
> >
> > On 1/26/07, Dain Sundstrom <da...@iq80.com> wrote:
> > > What did you run? This worked great for me an Prasad.
> > >
> > > Anyway, I changed the code to catch Exception instead of just
> > > NamingExcetpion.
> > >
> > > -dain
> > >
> > > On Jan 26, 2007, at 9:26 AM, Jarek Gawor wrote:
> > >
> > > > Dain,
> > > >
> > > > This hack is causing problems:
> > > >
> > > > java.lang.NullPointerException
> > > > at
> > > > org.apache.xbean.naming.context.ContextFlyweight.listBindings(Context
> > > > Flyweight.java:92)
> > > > at
> > > > org.apache.xbean.naming.context.ContextFederation.getFederatedBinding
> > > > s(ContextFederation.java:72)
> > > > at
> > > > org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(
> > > > AbstractFederatedContext.java:63)
> > > > at org.apache.xbean.naming.context.AbstractContext.getBinding
> > > > (AbstractCo
> > > > ntext.java:86)
> > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > (AbstractContex
> > > > t.java:128)
> > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > (AbstractContex
> > > > t.java:607)
> > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > (AbstractContex
> > > > t.java:151)
> > > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > > (AbstractContex
> > > > t.java:593)
> > > > at javax.naming.InitialContext.lookup(InitialContext.java:351)
> > > > at
> > > > org.apache.geronimo.jetty6.InjectionServletHandler.processAnnotations
> > > > (InjectionServletHandler.java:48)
> > > > at
> > > > org.apache.geronimo.jetty6.InjectionServletHandler.customizeServlet(I
> > > > njectionServletHandler.java:38)
> > > >
> > > > I think you need setup the component context properly first (see code
> > > > in jetty6.handler.ComponentContextHandler) in order to get the JNDI
> > > > context.
> > > >
> > > > Jarek
> > > >
> > > > On 1/25/07, Dain Sundstrom <da...@iq80.com> wrote:
> > > >> I added a simple hack to get @EJB injection working in Jetty. It is
> > > >> hack is just a trimmed down version of the Tomcat
> > > >> DefaultAnnotationProcess or which only handles @EJB injection.
> > > >>
> > > >> As with the Tomcat version, this is only in there to demonstrate the
> > > >> @EJB annotation use and is by no means a final solution for
> > > >> annotation processing.
> > > >>
> > > >> -dain
> > > >>
> > >
> > >
> >
>
Re: @EJB injection for Jetty
Posted by Prasad Kashyap <go...@gmail.com>.
OK. Now I have verified the @EJB injection jack for Jetty on TRUNK and
have found it to be working.
Cheers
Prasad
On 1/27/07, Prasad Kashyap <go...@gmail.com> wrote:
> No I haven't verified the @EJB injection on Jetty. I believe it is
> only on trunk. I was working on getting my M2 build to work. (unable
> to resolve dependency o.a.g.specs.geronimo-ejb_3.0_specs//jar)
>
> When I finally gave on M2 build and work on trunk, I hit the
> following problem -
>
> Missing:
> ----------
> 1) org.apache.openejb:container:pom:3.0-incubating-SNAPSHOT
> Path to dependency:
> 1) org.apache.geronimo.modules:geronimo-openejb:jar:2.0-SNAPSHOT
> 2) org.apache.openejb:openejb-ejbd:jar:3.0-incubating-SNAPSHOT
> 3) org.apache.openejb:container:pom:3.0-incubating-20070126.211327-22
>
> Cheers
> Prasad
>
>
> On 1/26/07, Dain Sundstrom <da...@iq80.com> wrote:
> > What did you run? This worked great for me an Prasad.
> >
> > Anyway, I changed the code to catch Exception instead of just
> > NamingExcetpion.
> >
> > -dain
> >
> > On Jan 26, 2007, at 9:26 AM, Jarek Gawor wrote:
> >
> > > Dain,
> > >
> > > This hack is causing problems:
> > >
> > > java.lang.NullPointerException
> > > at
> > > org.apache.xbean.naming.context.ContextFlyweight.listBindings(Context
> > > Flyweight.java:92)
> > > at
> > > org.apache.xbean.naming.context.ContextFederation.getFederatedBinding
> > > s(ContextFederation.java:72)
> > > at
> > > org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(
> > > AbstractFederatedContext.java:63)
> > > at org.apache.xbean.naming.context.AbstractContext.getBinding
> > > (AbstractCo
> > > ntext.java:86)
> > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > (AbstractContex
> > > t.java:128)
> > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > (AbstractContex
> > > t.java:607)
> > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > (AbstractContex
> > > t.java:151)
> > > at org.apache.xbean.naming.context.AbstractContext.lookup
> > > (AbstractContex
> > > t.java:593)
> > > at javax.naming.InitialContext.lookup(InitialContext.java:351)
> > > at
> > > org.apache.geronimo.jetty6.InjectionServletHandler.processAnnotations
> > > (InjectionServletHandler.java:48)
> > > at
> > > org.apache.geronimo.jetty6.InjectionServletHandler.customizeServlet(I
> > > njectionServletHandler.java:38)
> > >
> > > I think you need setup the component context properly first (see code
> > > in jetty6.handler.ComponentContextHandler) in order to get the JNDI
> > > context.
> > >
> > > Jarek
> > >
> > > On 1/25/07, Dain Sundstrom <da...@iq80.com> wrote:
> > >> I added a simple hack to get @EJB injection working in Jetty. It is
> > >> hack is just a trimmed down version of the Tomcat
> > >> DefaultAnnotationProcess or which only handles @EJB injection.
> > >>
> > >> As with the Tomcat version, this is only in there to demonstrate the
> > >> @EJB annotation use and is by no means a final solution for
> > >> annotation processing.
> > >>
> > >> -dain
> > >>
> >
> >
>
Re: @EJB injection for Jetty
Posted by Prasad Kashyap <go...@gmail.com>.
No I haven't verified the @EJB injection on Jetty. I believe it is
only on trunk. I was working on getting my M2 build to work. (unable
to resolve dependency o.a.g.specs.geronimo-ejb_3.0_specs//jar)
When I finally gave on M2 build and work on trunk, I hit the
following problem -
Missing:
----------
1) org.apache.openejb:container:pom:3.0-incubating-SNAPSHOT
Path to dependency:
1) org.apache.geronimo.modules:geronimo-openejb:jar:2.0-SNAPSHOT
2) org.apache.openejb:openejb-ejbd:jar:3.0-incubating-SNAPSHOT
3) org.apache.openejb:container:pom:3.0-incubating-20070126.211327-22
Cheers
Prasad
On 1/26/07, Dain Sundstrom <da...@iq80.com> wrote:
> What did you run? This worked great for me an Prasad.
>
> Anyway, I changed the code to catch Exception instead of just
> NamingExcetpion.
>
> -dain
>
> On Jan 26, 2007, at 9:26 AM, Jarek Gawor wrote:
>
> > Dain,
> >
> > This hack is causing problems:
> >
> > java.lang.NullPointerException
> > at
> > org.apache.xbean.naming.context.ContextFlyweight.listBindings(Context
> > Flyweight.java:92)
> > at
> > org.apache.xbean.naming.context.ContextFederation.getFederatedBinding
> > s(ContextFederation.java:72)
> > at
> > org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(
> > AbstractFederatedContext.java:63)
> > at org.apache.xbean.naming.context.AbstractContext.getBinding
> > (AbstractCo
> > ntext.java:86)
> > at org.apache.xbean.naming.context.AbstractContext.lookup
> > (AbstractContex
> > t.java:128)
> > at org.apache.xbean.naming.context.AbstractContext.lookup
> > (AbstractContex
> > t.java:607)
> > at org.apache.xbean.naming.context.AbstractContext.lookup
> > (AbstractContex
> > t.java:151)
> > at org.apache.xbean.naming.context.AbstractContext.lookup
> > (AbstractContex
> > t.java:593)
> > at javax.naming.InitialContext.lookup(InitialContext.java:351)
> > at
> > org.apache.geronimo.jetty6.InjectionServletHandler.processAnnotations
> > (InjectionServletHandler.java:48)
> > at
> > org.apache.geronimo.jetty6.InjectionServletHandler.customizeServlet(I
> > njectionServletHandler.java:38)
> >
> > I think you need setup the component context properly first (see code
> > in jetty6.handler.ComponentContextHandler) in order to get the JNDI
> > context.
> >
> > Jarek
> >
> > On 1/25/07, Dain Sundstrom <da...@iq80.com> wrote:
> >> I added a simple hack to get @EJB injection working in Jetty. It is
> >> hack is just a trimmed down version of the Tomcat
> >> DefaultAnnotationProcess or which only handles @EJB injection.
> >>
> >> As with the Tomcat version, this is only in there to demonstrate the
> >> @EJB annotation use and is by no means a final solution for
> >> annotation processing.
> >>
> >> -dain
> >>
>
>
Re: @EJB injection for Jetty
Posted by Dain Sundstrom <da...@iq80.com>.
What did you run? This worked great for me an Prasad.
Anyway, I changed the code to catch Exception instead of just
NamingExcetpion.
-dain
On Jan 26, 2007, at 9:26 AM, Jarek Gawor wrote:
> Dain,
>
> This hack is causing problems:
>
> java.lang.NullPointerException
> at
> org.apache.xbean.naming.context.ContextFlyweight.listBindings(Context
> Flyweight.java:92)
> at
> org.apache.xbean.naming.context.ContextFederation.getFederatedBinding
> s(ContextFederation.java:72)
> at
> org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(
> AbstractFederatedContext.java:63)
> at org.apache.xbean.naming.context.AbstractContext.getBinding
> (AbstractCo
> ntext.java:86)
> at org.apache.xbean.naming.context.AbstractContext.lookup
> (AbstractContex
> t.java:128)
> at org.apache.xbean.naming.context.AbstractContext.lookup
> (AbstractContex
> t.java:607)
> at org.apache.xbean.naming.context.AbstractContext.lookup
> (AbstractContex
> t.java:151)
> at org.apache.xbean.naming.context.AbstractContext.lookup
> (AbstractContex
> t.java:593)
> at javax.naming.InitialContext.lookup(InitialContext.java:351)
> at
> org.apache.geronimo.jetty6.InjectionServletHandler.processAnnotations
> (InjectionServletHandler.java:48)
> at
> org.apache.geronimo.jetty6.InjectionServletHandler.customizeServlet(I
> njectionServletHandler.java:38)
>
> I think you need setup the component context properly first (see code
> in jetty6.handler.ComponentContextHandler) in order to get the JNDI
> context.
>
> Jarek
>
> On 1/25/07, Dain Sundstrom <da...@iq80.com> wrote:
>> I added a simple hack to get @EJB injection working in Jetty. It is
>> hack is just a trimmed down version of the Tomcat
>> DefaultAnnotationProcess or which only handles @EJB injection.
>>
>> As with the Tomcat version, this is only in there to demonstrate the
>> @EJB annotation use and is by no means a final solution for
>> annotation processing.
>>
>> -dain
>>
Re: @EJB injection for Jetty
Posted by Jarek Gawor <jg...@gmail.com>.
Dain,
This hack is causing problems:
java.lang.NullPointerException
at org.apache.xbean.naming.context.ContextFlyweight.listBindings(Context
Flyweight.java:92)
at org.apache.xbean.naming.context.ContextFederation.getFederatedBinding
s(ContextFederation.java:72)
at org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(
AbstractFederatedContext.java:63)
at org.apache.xbean.naming.context.AbstractContext.getBinding(AbstractCo
ntext.java:86)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContex
t.java:128)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContex
t.java:607)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContex
t.java:151)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContex
t.java:593)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.apache.geronimo.jetty6.InjectionServletHandler.processAnnotations
(InjectionServletHandler.java:48)
at org.apache.geronimo.jetty6.InjectionServletHandler.customizeServlet(I
njectionServletHandler.java:38)
I think you need setup the component context properly first (see code
in jetty6.handler.ComponentContextHandler) in order to get the JNDI
context.
Jarek
On 1/25/07, Dain Sundstrom <da...@iq80.com> wrote:
> I added a simple hack to get @EJB injection working in Jetty. It is
> hack is just a trimmed down version of the Tomcat
> DefaultAnnotationProcess or which only handles @EJB injection.
>
> As with the Tomcat version, this is only in there to demonstrate the
> @EJB annotation use and is by no means a final solution for
> annotation processing.
>
> -dain
>