How use JNDI in Jserver

Hi,
I want to deploy EJB to jserver. The EJB use JNDI jdbc2.0 datasource to access database. But there only are some sujects how to use JNDI jdbc datasoure in client application in oracle8i 8.1.6 jdbc 2.0 document, no in Jserver. Which one could tell me how to use JNDI jdbc datasoure in Oracle 8.1.6 Jserver.
Thanks in advance.
sun xifeng
null

You have JServer discussion group to post JServer related questions.
Please repost it there.
raghu

Similar Messages

  • How use jndi to create a organization and add a  user  to it.(ÈçºÎ´´½¨Ò»¸ö×éÖ¯µ¥Î»)

    how use jndi to create a organization and add a user to it¡£THANKS£¡
    ÈçºÎ´´½¨Ò»¸ö×éÖ¯µ¥Î»,²¢½«Ò»¸öÓû§Ìí¼Ó½øËü¡£Ð»Ð»£¡

    Hi,
    The command above about creating a group only works for the root site of the site collection, because the scope of the user group is site collection level, these groups
    can be used in all the sites in this site collection.
    With the existing groups in the root site, we can add users into them and grant specific permissions of a specific sub site to these groups.
    Here is a demo about how to assign permission to a group using Client Object Model(though in C#) for your reference:
    http://www.c-sharpcorner.com/UploadFile/54db21/set-permission-to-group-in-sharepoint-2010-programmatically/
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How use Jndi datasoure in Jserver?

    Hi,
    I want to deploy EJB to jserver. The EJB use JNDI jdbc2.0 datasource to access database. But there only are some sujects how to use JNDI jdbc datasoure in client application in oracle8i 8.1.6 jdbc 2.0 document, no in Jserver. Which one could tell me how to use JNDI jdbc datasoure in Oracle 8.1.6 Jserver.
    Thanks in advance.
    sun xifeng

    You have JServer discussion group to post JServer related questions.
    Please repost it there.
    raghu

  • Using JNDI to retrieve a far objects

    hi every body,
    my question is how using JNDI in order to retrieve far "java objects" (in another machine in the same network)
    thanks,

    I can't see where can i find help !!!
    which provider url can i use (or which protocol to use) : RMI, Ldap, file system... ?

  • How to use JNDI lookup

    Hi ,
    I am creating a POC for my project.Its using ATG and spring frameworks using RAD 6.first I have created ATG sample project in that same EAR file i created sample Spring project.Both are running in the same EAR.
    I want to use spring classes from ATG components to use those methods.that is i should pass parameters to spring project methods and i should get the return value after executing those methods.
    I heard that using JNDI look up I can get spring project class objects using that I can invoke spring project methods.
    My requirement is two projects will be running in the same EAR.But one project will not be having information about other projects.both are independent from other.Using JNDI look up i need to invoke Spring project methods.
    Please anyone help me how to do this.
    I used java:comp/env/com/dao/EmpDAO to get instance of my class EmpDAO.But i am getting naming exception.Can anyone help me how to do this
    Thanks in advance.

    If Tomcat is your servlet/JSP engine, they have a nice bit about how to do it:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    MOD

  • How to use jndi datasource on Weblogic instead of adding a DB data source

    Hi All,
    version: 11.1.1.4
    I am trying to figure out how in my ADF applications I can use an existing jndi datasource out on our weblogic servers instead of having to bury the Database db source in my adf applications. Like SOA I would like to reference the DB directly during design so I can pull in entities and build view objects, but when I deploy I want it to reference the jndi datasource out on the weblogic server.
    Is this possible? If so I am not sure how to configure it like I would a DB adapter in SOA.
    As always appreciate the info.
    Thanks,
    S

    If you use ADF in the model layer (application modules) you can configure them to use JNDI Datasources. Just right click on the application module and select 'Configurations...'. In the next dialog you see all the configurations currently available (one named xxxxxlocal and one named xxxxxshared at least). Select the local and hit the edit button. This open the DB connect dialog where you can change the connection from JDBC URL to JDBC Datasource (JNDI). Save your work and when you now start the app it will use the JNDI name.
    Timo

  • How to get the naming attribute of an LDAP using JNDI.?

    Hi,
    How do we fetch the naming attribute of a LDAP using JNDI. Is this possible using JNDI..?
    By default, every LDAP has been set with a naming attribute such as 'uid' or 'cn'. This could be changed according to business needs.
    How to determine this using JNDI.
    Regards,
    Barani

    Are you trying to call the portlet Customization form directly from the browser?

  • Please Help.  How can you monitor a directory using jndi connection to a ldap server?

    How can you monitor a directory using jndi connection to a ldap server? I
    want the ldap server to monitor the content change in a file system
    directory on another computer on the network. Can someone please help.
    Thanks
    Fred

    Hi,
    Why do you want to use LDAP for Hard disk monitoring..???
    U can do this by creating a MD5 checksum for all the files existing in some
    perticular
    directory and every hour or any configurable period u can recalculate the
    checksum
    to find out the change in the content.
    I guess all u need is to get the code for "updatedb" utility of Linux and
    instrument it for ur needs..
    Hope it helps...
    -aseem
    mr wrote:
    How can you monitor a directory using jndi connection to a ldap server? I
    want the ldap server to monitor the content change in a file system
    directory on another computer on the network. Can someone please help.
    Thanks
    Fred

  • How can I configure ang use JNDI datasource on Tomcat 4.0.x ?

    How can I configure ang use JNDI datasource on Tomcat 4.0.x ?
    Please help me , Thanks !

    Hello ,
    You need to go through the JNDI tutorial which you can access at the sun's site. It will explain all the things you need.
    By the way all you want to use JNDI datasource is JNDI class library and some naming or directory service provider, which also you can download from sun.
    Good Luck.

  • How to validate if the baseBN using JNDI..?

    Hi,
    I have the directory server's admin username, admin password, system ip and port along with the BaseDN, how do i check whether the BaseDN that was entered by the user is valid one using JNDI..?
    thanks,
    Barani

    >
    gopalkrishna baliga wrote:
    > The field is defined as CHAR type and I can't change this type.
    Heard about string operator C ontains O nly (CO) ? SAP Help link: [http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm]

  • Help how to look up ejb3 deployed in ear using jndi

    Hi,everyone:
    I'm trying to use jndi to look up ejb3 depoyed in ear-file. The structure of ear file is like: taas.ear\app.jar , the "app.jar" is where the ejbs are deployed.
    If i write code:
    jndiContext.lookup("ServiceProviderDaoImpl/local");There will be exception:
    javax.naming.NameNotFoundException: ServiceProviderDaoImpl not boundHowever, if i deploy the ejbs directly in a app.jar which is not in a ear-file, then same same code will work fine.
    I cannot figure out how to write the correct code to look up the ejbs.
    I use jboss 5.0.1GA.
    Could anyone help me? Thanks a lot.

    Usually the lookup name is:
    earname/ServiceProviderDao/local
    Replace "earname" with the name of your ear of course, without the '.ear' extension.
    Use the JBoss JMX console and then the jndiView service to see under what names your EJBs are bound (under "global namespace" I think the label was).

  • How to use JNDI to lookup remote EJB Home?

    Hello,
    I am writing a servlet to call a remote EJB on another machine.
    I use JNDI to lookup remote EJBHome (not) but fail.
    Any advice?
    Any trick to configure application-client.xml?
    Thanks!

    Use com.evermind.server.rmi.RMIInitialContextFactory instead
    Here an example
    // EmployeeClient.java
    package mypackage5;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.io.*;
    import java.util.*;
    import java.rmi.RemoteException;
    import com.evermind.server.ApplicationClientInitialContextFactory;
    import com.evermind.server.rmi.RMIInitialContextFactory;
    * A simple client for accessing an EJB.
    public class EmployeeClient
    public static void main(String[] args)
    System.out.println("EmployeeClient.main(): client started...");
    try
    * initialize JNDI context by setting factory, url and credential
    * in a hashtable
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://koushikm:23791/application4");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "admin");
    * or set these properties in jndi.properties
    * or use container defaults if that's where client got launched from
    Context context = new InitialContext(env);
    * Lookup the EmployeeHome object. The reference is retrieved from the
    * application-local context (java:comp/env). The variable is
    * specified in the assembly descriptor (META-INF/application-client.xml).
    Object homeObject =
    context.lookup("HelloEJB");
    System.out.println("EmployeeClient.main(): bean found...");
    // Narrow the reference to EmployeeHome.
    HelloEJBHome home =
         (HelloEJBHome) PortableRemoteObject.narrow(homeObject,
    HelloEJBHome.class);
    System.out.println("EmployeeClient.main(): home narrowed...");
    // Create remote object and narrow the reference to Employee.
    HelloEJB remote =
         (HelloEJB) PortableRemoteObject.narrow(home.create(), HelloEJB.class);
    System.out.println("EmployeeClient.main(): remote created...");
    String message=remote.helloWorld("SUCCESS");
    System.out.println(message);
    } catch(NumberFormatException e) {
    System.err.println("NumberFormatException: " + e.getMessage());
    } catch(RemoteException e) {
    System.err.println("RemoteException: " + e.getMessage());
    } catch(IOException e) {
    System.err.println("IOException: " + e.getMessage());
    } catch(NamingException e) {
    System.err.println("NamingException: " + e.getMessage());
    } catch(CreateException e) {
    System.err.println("CreateException: " + e.getMessage());
    Hello,
    I am writing a servlet to call a remote EJB on another machine.
    I use JNDI to lookup remote EJBHome (not) but fail.
    Any advice?
    Any trick to configure application-client.xml?
    Thanks!

  • Using JNDI to access config file located outsite j2ee app

    Hi I'm wanting to store a config file for my J2ee app, somewhere on a tomcat server possibly inside the
    conf/ directory so that I can update this config file without having to redeploy the j2ee app every time a change is made.
    I've been told I can use JNDI to access this file, but I can't seem to find any examples or documentation on how I can do this.
    I'm new to JNDI and would appreciate any help, or suggestions.
    Thanks,
    Tim
    EDIT:
    So far I can access the file with this code:
    Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
              try {
                   Context ctx = new InitialContext(prop);
                   // look up context for name
                   //env.put(Context.PROVIDER_URL, "file:C:\\confluence\\confluence-2.5.1-std\\conf");
                   File f = (File)ctx.lookup("/confluence/confluence-2.5.1-std/conf/test.txt");My new problems are:
    1. The commented line env.put(Context.PROVIDER_URL, "file:C:\\confluence\\confluence-2.5.1-std\\conf"); it says in examples that this should set the dir to look in to the conf dir but if i change the lookup value to just test.txt it cannot find it.
    2. Can I somehow set the context to look into the conf directory of Tomcat without hard coding the path, as the path could change or be different on different machines??
    Edited by: Timothyja on Jan 15, 2008 7:00 PM

    Hi Kiran,
    Looking at the code you sent and the error, it looks like you should be casting the ds object to a javax.sql.DataSource object not a weblogic.jdbc.common.internal.RmiDataSource object.
    You may find some useful info at the following URL:
    http://edocs.bea.com/wls/docs81/jdbc/rmidriver.html#1026007

  • Querying deleted objects container in Active Directory using JNDI

    Hi,
    I am trying to query deleted objects container using JNDI which fails with error 64.
    Has anyone seen this or knows how to query AD using binary data in JNDI.
    Seems to me there is some problem with the search base.
    search base: <GUID=18E2EA80684F11D2B9AA00C04F79F805,dc=engserver,dc=com>.
    filter: objectclass=*
    search scope: subtree
    This is the error:
    Search example failed.
    javax.naming.InvalidNameException: <GUID=18E2EA80684F11D2B9AA00C04F79F805,dc=eng
    server,dc=com>: [LDAP: error code 64 - 00000057: LdapErr: DSID-0C090563, comment
    : Error processing name, data 0, v893 ]; remaining name '<GUID=18E2EA80684F11D2B
    9AA00C04F79F805,dc=engserver,dc=com>'
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2802)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2616)
    at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1744)
    at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1667)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirCon
    text.java:368)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCom
    positeDirContext.java:328)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCom
    positeDirContext.java:313)
    at javax.naming.directory.InitialDirContext.search(InitialDirContext.jav
    a:245)
    at jSearch.main(jSearch.java, Compiled Code)
    Thanks,
    Chetan

    I thought I had posted one of these. How remiss of me !/**
    * deleted.java
    * 5 July 2001
    * Sample JNDI application to search for deleted objects
    * Modified December 2004 to add Win2K3 lastKnownParent
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import com.sun.jndi.ldap.ctl.*;
    class DeletedControl implements Control {
         public byte[] getEncodedValue() {
              return new byte[] {};
         public String getID() {
              return "1.2.840.113556.1.4.417";
         public boolean isCritical() {
              return true;
    public class deleted     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls           
                   SearchControls searchCtls = new SearchControls();
                   //Specify the attributes to return
                   String returnedAtts[]={"distinguishedName","lastKnownParent"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(isDeleted=TRUE))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the results
                   int totalResults = 0;
                   //specify the Deleted control
                   Control[] rqstCtls = new Control[] {new DeletedControl()};
                   ctx.setRequestControls(rqstCtls);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        totalResults++;
                        System.out.println(totalResults + ". " + sr.getName().toString());
                        // Print out some of the attributes, catch the exception if the attributes have no values
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();System.out.println("   " + e.next().toString()));
                             catch (NullPointerException e)     {
                             System.err.println("Problem listing attributes: " + e);
                   System.out.println("Deleted objects: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
              System.err.println("Problem searching directory: " + e);
    }

  • Setting up LDAP Server to lookup Connection Factories using JNDI

    Can someone let me know how to setup LDAP server within 10G to lookup connection factories using JNDI?
    I read through the Advanced Queuing User Guide and Reference document where this is mentioned and it says use the Database Configuration Assistant to do this but I could not find how.
    When I install 10G is LDAP server automatically setup? How do I get to it?
    Thanks

    That is correct. I was indeed able to use the app server (10g) to give the LDAP user permission to access the objects, then used sql commands to register the objects inside the LDAP.
    However, I am finding NOTHING about actually creating a unique connection factory that can be registered in the LDAP. I find reference to registering Queues/Topics/Factories inside the LDAP, but nothing about actually creating the factories.
    In fact, here
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28420/aq_envir.htm#sthref409
    it's listed that you cannot use sql to create a connectionfactory... not to mention the create java commands for factories look strikingly similar to the queue/topic GET commands, and not the create commands. You can add an alias for that factory using sql, but can't actually create the factory using sql... ???

Maybe you are looking for

  • Lion OS & Office for Mac

    I have Office 2004 which is based on Rosetta and not compatible with Lion. I use it for Word. ( I get emails in that format and respond with a Word format. ) I believe the Lion OS is compatible with Office 2008 and 2011. Should I buy the Home Office

  • Macbook pro wireless No work tried everything.

    tried all the work arounds, deleted everything reinstalled from CD mac works fine otherwise but wireliess wont reconnect after sleep/shutdown. Have to run safari and the network diags. its always stopped at ISP. Then click continue and it it connects

  • How to create full editable JComboBox  ?

    I need to create full editable comboBox -- i want to do it by extends the class JComboBox - but i dont realy know how to collect the chars that the user will be insert and show then on the control. Does someone know where can i find some example of e

  • WRT54G2V1 Need Open NAT for Destiny PS3

    I currently have a Linksys WRT54G2V router. My Playstation3 has a wired connection to my router. With my current settings when I play Destiny on my PS3 I have a moderate NAT, and would like an open NAT. My ISP is Charter Communications. I do get a pu

  • Prevent drive from mounting at startup

    There is an archived message on this same subject that never received a reply. I perform my backups to a second internal drive and would like to prevent it from mounting at startup. Any ideas? To clarify: I can come up with many ways to UNmount a dri