hi,
i am not familiar with the method u have used.
but try to access the resource in noramal way we acess the resources.
1. put an resource reference to ur web.xml as follows. ( change the type and
name)

<resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/TestDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

2. then try to acess it as follows; (ur case has to cast to JNDIReleam)
Context initalInitialContext = new InitialContext();
            Context envCtx = (Context) initalInitialContext.lookup
("java:comp/env");
            DataSource dataSource = (DataSource) envCtx.lookup
("jdbc/TestDB");





On 1/15/06, chandra yalla <[EMAIL PROTECTED]> wrote:
>
> Hi Mark,
>
>   Thanks for the replay  , i have changed the museadmin.xml file context
> to mycontext to test the code given below in some site
>
> Server server = ServerFactory.getServer();
> //Note, this assumes the Container is "Catalina"
> Service service = server.findService("Catalina");
> Engine engine = (Engine) service.getContainer();
> Host host = (Host) engine.findChild(engine.getDefaultHost());
> //Note, this assumes your context is "myContext"
> Context context = (Context) host.findChild("myContext");
> Realm realm = context.getRealm();
>
>   above code is not working , i am not able to get service object.
>
>   I tried also with context before changing it in to mycontext , can you
> tell how to access the LDAP information give in real from my application xml
> file. i need this information in my servlet to get all the users in the LDAP
> and display in the JSP.
>
>   Thanks and Regards,
>   Chandra
>
>
>
> Mark Thomas <[EMAIL PROTECTED]> wrote:
>   chandra yalla wrote:
> >
> > Hi.
> >
> > i have requirement to get Users in LDAP using the realm information give
> > in my application xml file museadmin.xml ( i have attached this file)
>
> museadmin.xml is incorrect. It should start
>
> docBase="${catalina.home}/webapps/museadmin" debug="0" privileged="true">
>
> rather than
>
> docBase="${catalina.home}/webapps/museadmin" debug="0" privileged="true">
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events, holidays,
> whatever.
>

Reply via email to