Hi,

 

I am developing a web service, which has to insert the data into Oracle database.  I am not able to get the datasource object created as a global resource.

I also, created a resource link for ‘AXIS’ web module.

 

My Server is tomcat 5.0, and I configured Axis on it, and its working fine with simple test services.

 

My service object calls a DAO class, where I am creating an Initial context and loop up the “datasource”.

 

But my service object throws an exception.

 

Context ctx=new InitialContext();

DataSource ds =  (DataSource)ctx.lookup("jdbc/axisDS");

 

OR

Thinking that axis has to create the server context with binding variables, I used the following code

 

                                    Properties props=new Properties();

 

                                    props.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.naming.java.javaURLContextFactory");

                                    props.put(Context.PROVIDER_URL,"t3://localhost:80");  (my server is running on port 80).

                                    Context ctx=new InitialContext(props);     

DataSource ds =  (DataSource)ctx.lookup("jdbc/axisDS");

 

 

When use this code, Exception is  : “jdbc is not bound in this Context         

 

 

 

Context envCtx = (Context) (new InitialContext()).lookup("java:comp/env");

 

This code throw an exception is “java:comp is not bound in this Context

 

Could you pl, give clear directioins, of creating and calling the datasource from axis.

 

-thanks

 

 

 

Reply via email to