geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul McMahan" <paulmcma...@gmail.com>
Subject Re: Using @Resource in servlet
Date Tue, 12 Dec 2006 14:33:17 GMT
Correct - annotations are not implemented in the tomcat6-jee5 assembly
yet.  I am planning to start looking at that after the holidays.  My
very early thoughts were that the annotations could be merged into the
deployment descriptor before the builder processes it.  But at this
point I've spent very little time investigating that approach.  I
think ideally Geronimo could have one approach that works across all
the Java EE5 components that support annotations.

Best wishes,
Paul

On 12/12/06, David Jencks <david_jencks@yahoo.com> wrote:
> This is probably not implemented yet.  It certainly doesn't work with
> jetty6 yet.
>
> We're going to need to scan the code and hook the output of the
> annotation scanner into the naming builder framework to get the stuff
> needed bound in jndi, and then do something to inject these
> resources.  It's possible that both jetty and tomcat have some way of
> going from jndi to injection and they might have scanners of some
> sort but I don't see how they can hook into our naming builders
> without us writing a bunch of code.
>
> thanks
> david jencks
>
> On Dec 12, 2006, at 12:14 AM, Krishnakumar B wrote:
>
> > hi,
> >
> > I am trying a sample application that uses @Resource to get a
> > reference to the Datasource deployed on the server ( SystemDatasource
> > ).
> >
> > Server Version : 2.0-SNAPSHOT-Tomcat6-JEE5
> >
> > I have tried
> > @Resource  javax.sql.DataSource SystemDatasource &
> >
> > @Resource (mappedName="java:comp/env/jdbc/SystemDatasource")
> > javax.sql.DataSource SystemDatasource;
> >
> > Both give errrors. I think the usage i am trying is not correct.
> >
> > Dec 12, 2006 1:36:15 PM org.apache.catalina.core.ApplicationContext
> > log
> > SEVERE: StandardWrapper.Throwable
> > java.lang.NullPointerException
> >        at com.test.servlet.SampleServlet.init(SamleServlet.java:80)
> >        at org.apache.catalina.core.StandardWrapper.loadServlet
> > (StandardWrapper.
> > java:1161)
> >        at org.apache.catalina.core.StandardWrapper.allocate
> > (StandardWrapper.jav
> > a:806)
> >        at org.apache.catalina.core.StandardWrapperValve.invoke
> > (StandardWrapperV
> > alve.java:133)
> >        at org.apache.catalina.core.StandardContextValve.invoke
> > (StandardContextV
> > alve.java:175)
> >        at
> > org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSu
> > bjectValve.java:56)
> >        at org.apache.geronimo.tomcat.GeronimoStandardContext
> > $SystemMethodValve.
> > invoke(GeronimoStandardContext.java:325)
> >        at
> > org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(Gero
> > nimoBeforeAfterValve.java:47)
> >        at org.apache.catalina.core.StandardHostValve.invoke
> > (StandardHostValve.j
> > ava:128)
> >        at org.apache.catalina.valves.ErrorReportValve.invoke
> > (ErrorReportValve.j
> > ava:105)
> >        at org.apache.catalina.core.StandardEngineValve.invoke
> > (StandardEngineVal
> > ve.java:109)
> >        at org.apache.catalina.valves.AccessLogValve.invoke
> > (AccessLogValve.java:
> > 542)
> >        at org.apache.catalina.connector.CoyoteAdapter.service
> > (CoyoteAdapter.jav
> > a:212)
> >        at org.apache.coyote.http11.Http11Processor.process
> > (Http11Processor.java
> > :818)
> >        at org.apache.coyote.http11.Http11Protocol
> > $Http11ConnectionHandler.proce
> > ss(Http11Protocol.java:624)
> >        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run
> > (JIoEndpoint.java:44
> > 5)
> >        at java.lang.Thread.run(Thread.java:595)
> >
> > Any pointers as to how to provide the @Resource reference.
> >
> > Regards
> > Krish
>
>

Mime
View raw message