Where do I have to specify the JNDI reference?

I want to lookup with the string "java:comp/env/myMap/testBean".
In this case I have to define somewhere a JNDI reference "myMap/testBean" to my bean. But where do you specify this? On the server, somewhere in your bean or on the client?
Rik

Thanks for your reply
I don't completely understand, the tag you mentioned in the ejb-jar.xml is just the ejb-name as it says. My problem was:
I have an entity bean: ejbTest
JNDI-name: ejbTestJndi
Home-interface: ejbTestHome
Remote-interface: ejbTestRemote
In my client-application I have the following code to find my entity bean ejbTest:
Context ctx = new InitialContext();
Object ref = ctx.lookup("ejbTestJndi");
This works without any errors. But I want to use the following code to find my entity bean ejbTest:
Context ctx = new InitialContext();
Object ref = ctx.lookup("java:comp/env/...");
What do I have to write after "java:comp/env/" to find my entity bean ejbTest? Can I write for example "java:comp/env/abc/myEntityBean"? If yes, where should I define "abc" and "myEntityBean"?
Greetz
Rik

Similar Messages

  • Is it possible to activate LR5 on a second (privately owned) computer and where do I have to enter the license key?

    is it possible to activate LR5 on a second (privately owned) computer and where do I have to enter the license key?

    Lightroom doesn't use activation. The EULA allows you to install Lightroom on two computers, one a desktop the other a laptop. To apply the serial number you go to the Help menu then choose Lightroom Registration.

  • Can any one tell me where do we have to change the Language for Vendor curr

    Hello
    Can any one tell me where do we have to change the Language for Vendor currerncy?
    Is it in the vendor master record or in the Currency settings.
    Please tell me the path or Tcode for it.
    Best Regards,
    Sairam.

    hi sai
    do you want to change the currency or langauge ?

  • Always on listener on named instance. Do I have to specify the port while connecting a listener created on a named instance?

    Hi all. Here again.
    Scenario: I have to consolidate several physical servers with one SQL server instance install on each one. I decided to consolidate all in one server installing different named instances. In order to avoid application connection string change I had the idea
    of configuring different listener pointing to different alwayson group.
    To meet this requests, I configured the cluster, I installed a principal SQLServer Instance and configured the alwayson groups with the required listeners.
    All ok so far, alwayson is great.
    So, I installed a named instance, I configured the necessary alwayson groups and the related listener but...
    NOTE: The db in the principal and in the named instance have the same name.
    If I connect the listener pointing the ag belonging the named instance I connect to the principal instance!
    the only way I have to connect to the named instance is to specify the port that must be different from the 1433 as usual.
    Anyway, why I cannot use the 1433 port if dealing with a different ip?
    Listener are the following:
    Named instance
    10.100.21.100 : 1455
    Principal instance
    10.100.21.50  :
    1433
    Thankyou

    Hi all.
    I reviewed the architecture installing only named instances and I solved.
    Anyway, i'm going to explain better my configuration in order to understand where I went wrong.
    I have two servers, SQLCLU01 and SQLCLU02 partecipating to AVSQLCLU cluster
    Each server has two SQL instances, the principal SQLPROD and the named instance SQLTEST
    Each instance contain the OneToOne database.
    I created an AG named AgOneToOneProd laying on the SQLPROD instance with its
    OneToOne listener described here down (sys.dm_tcp_listener_states;)
    7 10.100.21.50
    1 1433
    0 TSQL
    0 ONLINE
    2014-05-07 10:23:04.113
    DnsName:OneToOne
    Port:1433
    IpconfigurationFromCluster:('IP Address: 10.100.21.50')
    So I tried to create an AG named AgOneToOneTest laying on the SQLTEST named instance with its
    OneToOneTest listener but the port 1433 is unavailable even if the listener IP is different. I managed in creating the listener changing the port like this
    7 10.100.21.100
    1 1455
    0 TSQL
    0 ONLINE
    2014-05-07 10:36:05.347
    DnsName:OneToOneTest
    Port:1455
    IpconfigurationFromCluster:('IP Address: 10.100.21.100')
    So, the issue is:
    Connecting to OneToOne.mydomain.local i can see the OneToOne database and crud operation are performed against the SQLPROD instance.
    But connecting to OneToOneTest.mydomain.local the OneToOne database I'm connected to is still the one belonging to the
    SQLPROD instance.
    The only way to let my application connected to the SQLTEST instance is to specify the port in the DSN.
    Anyway, summary here, issues are bolded
    OneToOne.mydomain.local -------> SQLPROD
    OneToOneTest.mydomain.local -------> SQLPROD
    OneToOneTest.mydomain.local,1455 -------> SQLTEST
    The same by IP
    10.100.21.100,1455 --------> SQLTEST
    10.100.21.100 --------> SQLPROD
    and.....
    10.100.21.100,1433 --------> SQLPROD
    May be... Do I missed some best practices in creating listeners against a principal + named instances?
    Thankyou
    Stefano
    Ste'

  • HT1369 An update(newer version) was taking place for my iPod touch and I was knocked off line, Now, my iPod won't turn on or off and the screen only shows the Apple insignia and an empty oblong circle  where  it would have  filled when the update was succ

    A newer verion update for my iPod touch was taking place when I got knocked off line,Now,I have no connection to be able to use my iPod.Just a Black screen with the Apple insignia and an oblong circle that would have filled when the update was finished appears and the iPod won't turn on or off. What can I do to remedy the situation.?

    Try putting the iPad into recovery mode and see if that fixes it : http://support.apple.com/kb/ht4097

  • Why i have to specify the parameters (property and name) in both tags?

    Recently i learned how to populate a html:select with data from a DB table with a int value and a String value (value and label of an option). For that i create a business object that represent one pair value&label (i called categoryBO) and another business object that contains a list of the business objects categoryBO. So in my JSP i have the next code:
    <html:select name="lista" property="listaPropiedades">
    <html:optionsCollection name="lista" property="listaPropiedades" value="varValor" label="varLabel" />
    </html:select> Well i understand the next: name is the name of the business object that contains the list with the objects that represents the options in the select tag; property is the name of the list object, in the business object i need to have the getters and setters for that list; then value is the name of the variable that contains the data that will be the value of each option and label is the name of the variable that contains the data that will be the value of each label.
    But i have the next questions:
    1. Why i have to establish the parameters property and name for bot html:select and html:optionsCollection? Why not only in html:select or only html:optionsCollection?
    2. In the ActionForm for my JSP i don�t know what data type have to use to declare the variable that's linked with the option or with the select. I'm using Object for now.
    3. Why the only way to populate the html:optionsCollection in the Action is passing the object in the request object as an atribute in the next way:
    request.setAttribute("lista", objectThatContainsList);instead
    ((ActionForm)form).setListaPropiedades(objectThatContainsList);why's that? I have the same question when i'm populatina a normal html table using a logic:iterate tag or using a display:table tag from displaytag library.

    Ok, you have one big misconception here - you're using the same name/property for both the select component and its contents.
    The html:select should refer you to ONE selected value (in this case an int). It should tie to a field on your action form.
    The html:optionsCollection should refer to a list of beans used to populate this select component.
    <html:select property="selectedItem">
    <html:optionsCollection name="myList" property="listOfProperties" value="varValor" label="varLabel" />
    </html:select>
    1. Why i have to establish the parameters property and name for bot html:select and html:optionsCollection? Why not only in html:select or only html:optionsCollection?Because they actually refer to two different things, and should be two different values.
    html:options gets the list of possible values
    html:select stores the "selected" option. (consider what you would have if you just used a standard html:input here, and typed the id directly in - THATS the property to bind to)
    2. In the ActionForm for my JSP i don�t know what data type have to use to declare the variable that's linked with the option or with the select. I'm using Object for now.You do now - because it is declared/mapped seperately
    3. Why the only way to populate the html:optionsCollection in the Action is passing the object in the request object as an atribute in the next way:Its not.
    The way you mentioned is also valid. If both the "selectedItem" and "listOfItems" are properties on your action form, you can leave out the "name" attribute, and they will be found there.
    However if you are dealing with request scoped beans, you will have to populate the list on each access of the page - you will need a "load" action to poupulate the bean with the items for the dropdown, and make sure that it is always populated when you return to it (eg on an error condition).
    That is why setting it as an attribute is sometimes preferable.
    Cheers,
    evnafets

  • Is there a way to improve the sign in experience so that users don't have to specify both address and username?

    I've wondered this for a long time-is there a way to set up Lync so that I can have users sign in with just the sign in address, and not have to specify the username as well? Things tend to go like this:
    User launches lync client-types sign in address and password (in this case [email protected])
    Sign in will fail, and now they'll need to specify the username (in this case CTT1\user) and retype their password
    Now sign in succeeds (and it'll remember credentials)
    Is there a way to fix things in DNS so that step 2 isn't required?  It's a pain for the out of the box experience for new users, and the fact that the login has to fail to be able to specify the username in the first place is a little counterintuitive.
    Is there a record we can create so that the domain name (in this case CTT1) is inferred from the SIP domain? 

    Well if you want a "single signon" experience, the Workstation will need to de join to the domain :-)  otherwise it will prompt for the Username and password for authentificaiton.
    You can then check the save password box.
    For remote user that are NOT on the domain, same behavior, you will be prompted to enter Username/Password.
    If a post is helpful, please take a second to hit the green arrow on the left, or mark as answer, thanks.
    Jean-Philippe Breton | Senior Microsoft Consultant | MCTS, MCITP, MCT, Lync MVP

  • How to set the JNDI resources and params

    I am trying to connect my Crystal reports to my JSP page.
    I am using MySql DB and TomCat 4.1
    My web.xml is in the right place and contains the JNDI name (jdbc/MyDB)
    I was able to accomplish the following:
    1) Setting the connection pool and
    2) Able to specify the JDBC database option and was also able to generate the report in the designer using this JDBC option connectivity.
    However, when I try to run the report from the JSP page, it gives me the following error:
    javax.servlet.jsp.JspException: Report location is not specified in the configuration file     at
    com.crystaldecisions.report.web.viewer.taglib.ReportServerControlTag.doEndTag(Unknown Source)
         at org.apache.jsp.testing_jsp._jspx_meth_crviewer_viewer_0(testing_jsp.java:159)My CrystalReportEngine-config.xml resides in
    C:\Program Files\Apache Group\Tomcat 4.1\webapps\WebModule1\WEB-INF\classes
    and it contains the following
    <CrystalReportEngine-configuration>
      <reportlocation>../..</reportlocation>
      <timeout>10</timeout>
      <keycode>Azzzzzzzzzzzzzzzzzzzzzz</keycode> </CrystalReportEngine-configuration>
    My report that I am trying to execute resides in the root of my application (where it supposed to be).
    This lead me to believe that I probably need to specify a JNDI datasource.!! Do you agree? If so, how can I specify the
    JNDI Provider URL
    JNDI Username (is this the tomcat admin user name)?
    JNDI PWD
    Initial CONTEXTReally appreciate any help you can offer

    Can anyone tell me where to post the previouse message to get a solution, or may be a hint?
    If i am doing anything wrong to not get a response, please let me know so i can reward it or correct it.
    thanks

  • How come I get all account information without specifying the username pass

    I intsalled the sun directory server and try a couple of sample programs available on the net to see how can i get the infromation form the server.
    The following is the actually code but how come i don't have to specify the user name and passoword??
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://192.168.1.196:13769/o=JNDITutorial,dc=opendataldap,dc=com");
    DirContext ctx = new InitialDirContext(env);
    //To read the attributes of an object from the directory, use DirContext.getAttributes()
    Attributes answer = ctx.getAttributes("cn=Ted Geisel, ou=People");
    for (NamingEnumeration ae = answer.getAll(); ae.hasMore();) {
    Attribute attr = (Attribute)ae.next();
    System.out.println("attribute: " + attr.getID());
    /* Print each value */
    for (NamingEnumeration e = attr.getAll(); e.hasMore();
         System.out.println("value: " + e.next()))
    }

    Were u able to connect and retrieve the values??
    If not, you should add these into env variable
    env.put(Context.SECURITY_PRINCIPAL, "cn=Directory Manager");
         env.put(Context.SECURITY_CREDENTIALS, "adminpwd");

  • How to add or modify an entry using the JNDI

    Hi all,
    Usually I have used the netscape library to write directory application, now I have to use the JNDI ...
    Could I have some examples about the add modify and delete entry on the directory?
    Thanks a lot!
    M@x

    Download the LDAP Service provider at http://java.sun.com/products/jndi/index.html#download_ldap
    It has some example code too

  • Oaf requirement:have to display the order number but save the order id

    this is a standard practice with d2k forms.i have a requirement where in i have to store the order id in the table but have to display the user with the corresponding order numbr at all times..can any1 please help me with this***urgent***

    Hooray! I get to post my daily reply saying the following:
    OA Framework is so radically different than just straight Java coding that Oracle has a separate [url http://forums.oracle.com/forums/forum.jspa?forumID=210] forum for OA Framework.
    That is the appropriate place for this question.

  • Where do I have to put R3ta_hints.txt?

    Dear all,
    I want to split some tables with R3ta and I put the program and the file R3ta_hints.txt to the kernel-directory of my system.
    The whr.files are created but in the log-files I found the message that R3ta_hints.txt is not available.
    Where do I have to put the file?
    Thanks for your help.
    Carsten

    The file R3ta_hints.txt has to be in the sapinst-directory.

  • WRT350N : how to specify the default gateway?

    Hello,
    I would like to use my wrt350n as a dhcp server, but want to specify another router as the default gateway.
    I have my wrt350n (192.168.1.254) and another modem/router (192.168.1.1). When a client connects to the wrt350n, it automatically receives as default gateway the adress of the wrt350 (192.3168.1.1). I would like to change that to reference the other adress 192.168.1.1.
    Thanks for your comments
    Raph
    Solved!
    Go to Solution.

    Hello,
    Thanks for your answer.
    I try to give you more information.
    The modem router (bbox2 : 192.168.1.1) is connected to an ethernet port on the WRT350 (192.168.1.254). I would like to desactivate the DHCP server on the bbox2 (because limited to 802.11g), and activate it on the wrt350, to have a wireless network in 802.11n. The problem when I do that, is at the dhcp server, the default gateway returns is always the ip adress of the wrt350 (so no internet access). Nevertheless, I have to specify the ip of the bbox (192.168.1.1) for the internet traffic. I don't find a way to change the value of the default gateway returns by the wrt350. I can set different values for DNS, but not for the gateway.
    Actually, I turn on the dhcp server on the bbox and turnoff it on the wrt350, but my wireless spped is limited to 54Mbits (802.11g), and this not annoying for surfing purpose, but annoying when streaming video from my san connected to the wrt350n.
    I don't know if it's clear now?
    Thanks for your feedback

  • Solaris: How do I specify the user under which the WLS runs?

    I just upgraded from WLS 5 to 8. OS is Solaris 8.
    Configuration is one single admin server which also acts as the only managed server.
    The admin server must start up as root so that the users don't have to specify the port :443 at the URL (don't ask me why, but it seems to be the fact on Solaris).
    After starting, I want the server java process to actually run as another user than root. How to I do this?
    It worked on the old Solaris server with WLS 5.1, and I have an idea that it had something to do with the command line option -Dweblogic.system.user=. That option has no effect when trying it with WLS 8.1.
    This must be a common task when running WLS on Solaris. But I cannot figure it out, and a thousand users are waiting for the application to start up. Can anyone tell me how to do this?
    Regards,
    Anders.

    If you logged in as userx and started server, the weblogic server process will be started as userx.
    If you want usery to start server, then you need to give permissions accordingly, though you have installed the weblogic as root.
    -Dweblogic.system.user=, option works only when this user has rwx permissions to various files under weblogic dir (log files, applications, .....).
    Regards
    Sree

  • URGENT: JNDI Reference being lost

    Hi,
    We have 2 Weblogic 5.1 Servers in a clustered mode. I have an unclusterable
    object bound in the JNDI tree just for reference purposes. This object
    implements Serializable, but it has a thread reference, and hence it cannot
    be clustered. This object is bound from both servers with different names
    lets call them OBJ_A and OBJ_B. Client Threads running on Server A can only
    lookup OBJ_A and Client Threads running on Server B can only lookup OBJ_B
    although due to the fact that the JNDI tree is clustered, the reference of
    OBJ_A and OBJ_B is available on both Servers A and B. Let me make it more
    clear by saying that the reference of OBJ_A on Server B is useless to the
    Client Threads running on that Server (B) and also the reference of OBJ_B on
    Server A is useless to the Client Threads running on that Server (A)
    At startup everything is fine. However, I am noticing that after a while (a
    while being 1-2 days or less) the JNDI reference of OBJ_A on Server A
    disappears although I can see that the Thread that it represents is alive
    and running, it keeps outputting its heartbeat. The funny thing is that, the
    reference of OBJ_B on Server A still remains, and also the references of
    OBJ_A and OBJ_B on Server B remain in the JNDI tree too.
    Has anyone seen such a problem or a similar problem where the cluster-wide
    JNDI tree loses its references and does not broadcast it to other servers?
    Coz if the object was taken out of the JNDI tree, it should have gone from
    the other server as well.
    I have several such objects listed in the JNDI tree, and their references
    from Server A just disappear whereas they are still present in the JNDI tree
    on Server B where they are really useless.
    Please let me know if you have any insights.
    Thanks
    Abhijit

    Thanks Cameron, I am afraid I dont know if this will help. Basically I dont
    care if JNDI replicates the entries or not.. but why should it forget a
    reference when the object has not unbound itself, neither has the Thread it
    runs on died. The object has also not been garbage collected.
    So not sure yet.. but will try the option you mentioned.
    Does anybody know if JNDI will release references of objects after certain
    periods of inactivity? i.e. if no client 'looks up' an object for a certain
    time, its binding will be released from the JNDI tree?
    Thanks for your help.
    Abhijit
    "Cameron Purdy" <[email protected]> wrote in message
    news:[email protected]...
    One thing I would suggest is using WL's option to not replicate theentries
    that you are describing. I can't remember the name of the option off-hand,
    but it's something like "don't replicate". Check the WL JNDIdocumentation.
    >
    Peace,
    Cameron Purdy
    Tangosol Inc.
    Tangosol Coherence: Clustered Coherent Cache for J2EE
    Information at http://www.tangosol.com/
    "Abhijit Adhyapak" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    We have 2 Weblogic 5.1 Servers in a clustered mode. I have anunclusterable
    object bound in the JNDI tree just for reference purposes. This object
    implements Serializable, but it has a thread reference, and hence itcannot
    be clustered. This object is bound from both servers with different
    names
    lets call them OBJ_A and OBJ_B. Client Threads running on Server A canonly
    lookup OBJ_A and Client Threads running on Server B can only lookup
    OBJ_B
    although due to the fact that the JNDI tree is clustered, the referenceof
    OBJ_A and OBJ_B is available on both Servers A and B. Let me make itmore
    clear by saying that the reference of OBJ_A on Server B is useless tothe
    Client Threads running on that Server (B) and also the reference ofOBJ_B
    on
    Server A is useless to the Client Threads running on that Server (A)
    At startup everything is fine. However, I am noticing that after a while(a
    while being 1-2 days or less) the JNDI reference of OBJ_A on Server A
    disappears although I can see that the Thread that it represents is
    alive
    and running, it keeps outputting its heartbeat. The funny thing is that,the
    reference of OBJ_B on Server A still remains, and also the references of
    OBJ_A and OBJ_B on Server B remain in the JNDI tree too.
    Has anyone seen such a problem or a similar problem where the
    cluster-wide
    JNDI tree loses its references and does not broadcast it to otherservers?
    Coz if the object was taken out of the JNDI tree, it should have gonefrom
    the other server as well.
    I have several such objects listed in the JNDI tree, and theirreferences
    from Server A just disappear whereas they are still present in the JNDItree
    on Server B where they are really useless.
    Please let me know if you have any insights.
    Thanks
    Abhijit

Maybe you are looking for