users@jax-ws.java.net

DataSource usage in JAX-WS servers?

From: Owen Medd <osmedd_at_gmail.com>
Date: Fri, 6 Jan 2006 20:18:45 -0500

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
fax: +1 734 661-0324          cell: +1 734 276-1661