Hi Christopher, Comments inline below:
>I have this working in a function called getDB() within the Web Service but >I don't understand how it recognizes the Context it is in because I do not >have a WEB-INF/web.xml file that would normally define the resource such as You must have a web.xml file to map the AxisServlet to the Servlet container? It's as simple as adding your xml to that file. For reference, a simple web.xml file for a project I'm working on is attached. As you can see, all I've done is added the resource-ref element and children to it. Once that's done you can lookup the JDBC pool as usual. >Does Axis know of the application specific WEB-INF/web.xml ? I have set up >Data Sources correcty when useing the JWS SDK and within that I needed a >resource identified correctly in my application specific WEB-INF/web.xml , >but Axis seems to not even care about that file. Axis might not care but the Servlet container does take note of that xml file, and that's what provides the InitialContext implementation. One thing of note - DataSources with Axis has given me no end of hassle. It seems that no matter what I do, how often I call Connection.close() to return it to the pool, the server runs out of connections and then throws an Exception (db pool could not get idle connection). Anyone else on the list had similar experiences? Hope this helps! Richard
<?xml version="1.0" encoding="ISO-8859-1" ?> <web-app> <display-name>Something</display-name> <description>Something Else</description> <servlet> <servlet-name>AxisServlet</servlet-name> <display-name>Apache-Axis Servlet</display-name> <servlet-class> org.apache.axis.transport.http.AxisServlet </servlet-class> </servlet> <servlet> <servlet-name>AdminServlet</servlet-name> <display-name>Axis Admin Servlet</display-name> <servlet-class> org.apache.axis.transport.http.AdminServlet </servlet-class> <load-on-startup>100</load-on-startup> </servlet> <servlet> <servlet-name>SOAPMonitorService</servlet-name> <display-name>SOAPMonitorService</display-name> <servlet-class> org.apache.axis.monitor.SOAPMonitorService </servlet-class> <init-param> <param-name>SOAPMonitorPort</param-name> <param-value>5001</param-value> </init-param> <load-on-startup>100</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AxisServlet</servlet-name> <url-pattern>/servlet/AxisServlet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>AxisServlet</servlet-name> <url-pattern>*.jws</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>AxisServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>SOAPMonitorService</servlet-name> <url-pattern>/SOAPMonitor</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>AdminServlet</servlet-name> <url-pattern>/servlet/AdminServlet</url-pattern> </servlet-mapping> <mime-mapping> <extension>wsdl</extension> <mime-type>text/xml</mime-type> </mime-mapping> <mime-mapping> <extension>xsd</extension> <mime-type>text/xml</mime-type> </mime-mapping> <welcome-file-list id="WelcomeFileList"> <welcome-file>index.html</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>index.jws</welcome-file> </welcome-file-list> <resource-ref> <res-ref-name>jdbc/TestDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </web-app>