users@jax-ws.java.net

Re: DataSource usage in JAX-WS servers?

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Wed, 11 Jan 2006 13:36:12 -0800

JAX-WS standalone (not in a Java EE container) only does resource
injection for WebServiceContext.

Owen Medd wrote:

> So I've successfully dealt with grabbing WebServiceContext's using the
> @Resource annotation and read documentation that I could possibly use
> @Resource to reference DataSource's. It's unclear to me whether this
> is an EJB 3.0 annotation that is not available to me (yet) using only
> the JAX-WS 2.0 ea3 code or whether I'm just doing something wrong.
>
> This line of code seems like it should work:
> @Resource(name="jdbc/etlMCOM") private DataSource ds;
> but all I ever get for ds is null. This line works fine to grab the
> WebServiceContext:
> @Resource private WebServiceContext ctx;
>
> I have a little jsp that successfully accesses this DataSource, so I'm
> pretty confident the DataSource itself is okay.
>
> Is there a different way to access DataSources? Hints appreciated.
>
> Owen
> --
> InterGuide Communications, 1611 Dexter Avenue, Ann Arbor, MI 48103
> phone: +1 734 786-3264 email: osmedd_at_gmail.com
> <mailto:osmedd_at_gmail.com>
> fax: +1 734 661-0324 cell: +1 734 276-1661


-- 
 - Doug