JNDI & OpenLDAP problem

I am using the JNDI API for working with the OpenLDAP server, and I have the following problem: when adding entries through the JNDI API, these entries can be retrieved and everything works ok. If I try adding entries with another directory client, or through an .ldif file, these entries cannot be found(retrieved) through JNDI... The entries look the same in the server (they are stored in the same place, they have the same attributes....), but the JNDI client finds only the entries that were added through the JNDI API... Can anyone help?
Thank you in advance

I am using the JNDI API for working with the OpenLDAP server, and I have the following problem: when adding entries through the JNDI API, these entries can be retrieved and everything works ok. If I try adding entries with another directory client, or through an .ldif file, these entries cannot be found(retrieved) through JNDI... The entries look the same in the server (they are stored in the same place, they have the same attributes....), but the JNDI client finds only the entries that were added through the JNDI API... Can anyone help?
Thank you in advance

Similar Messages

  • Jndi OpenLdap password problem

    Hello,
    I've searched different forums and google for days now but i can't find a solution for my problem. I'm trying to use OpenLdap and Jndi to authentificate users. I can perform an anonymous bind but if i try to authentificate with a user in my Ldap tree i always get this error:
    javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
    This happens if i use 'simple' for security_authentification. When i use digest-md5 the following problem occurs:
    javax.naming.AuthenticationNotSupportedException: digest-md5
    It is obvious that my OpenLdap server does not support digest-md5. And the first error tells me that my password is wrong.
    If i lookup the passwords with a ldap browser it shows something like this:
    {MD5}$1$pJyUMt74$8gXXepTKoLk9l3xeinY8u/
    so i assume that some kind of a MD5 Hash is used. But i don't know how to generate these hash to do an authentification by JNDI.
    This is my source code:
    java.util.Hashtable env = new java.util.Hashtable();
    env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(javax.naming.Context.PROVIDER_URL, "ldap://xxx:389");
    env.put("java.naming.ldap.version", "2");
    env.put(javax.naming.Context.SECURITY_AUTHENTICATION,"simple");
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, "uid=xxx, ou=xxx, o=xxx, c=DE");
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, xxx); All variables are set correctly. I hope someone can give me a hint how to do this authentification.
    If i generate an MD5 hash from my cleartext password it doesn't match the one in my Ldap tree.
    Thanks in advance.
    Sebastian

    Maybe you should specify jndi name for your bean in deployment descriptor (ejb-jar.xml) of EJB jar module?
    <ejb-jar> 
      <enterprise-beans>
        <ejb>
          <ejb-name>MyBean</ejb-name>
          <jndi-name>JNDINameOfMyBean</jndi-name>
        </ejb>
      </enterprise-beans>
    </ejb-jar>And then lookup for JNDINameOfMyBean.

  • Looking for tips on a OC4J/JNDI lookup problem

    Hello All,
    I am running into a situation where a user I have setup in Oracle Enterprise Manager 10G Instance Level Security is not able to access our JNDI resources. We have tried providing all the roles(including administrators) to this user, but to no success. For some reason it works in standalone though.
    Our exception is fired when deploying the application and the spring configuration tells the app to fetch the jms connection factory from JNDI.
    Caused by: javax.naming.NoPermissionException: Not allowed to look up jms/ConnectionFactory, check the namespace-access tag setting in orion-application.xml for details
    +     at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:873)+
    +     at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:337)+
    +     at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:296)+
    +     at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:278)+
    +     at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:152)+
    +     at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:127)+
    +     at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)+
    +     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)+
    +     at java.lang.Thread.run(Thread.java:595)+
    +     at com.evermind.server.rmi.RMICall.warningExceptionOriginatesFromTheRemoteServer(RMICall.java:109)+
    +     at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:91)+
    +     at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMIClientConnection.java:425)+
    +     at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:233)+
    +     at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:302)+
    +     at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:56)+
    +     ... 43 more+
    I wonder if there is a specific role that OC4J is looking for to allow the app to use JNDI? One thread I read earlier mentioned granting the user RMI permission. Any tips on where this could be configured?
    Our namespace section of the orion application xml file is below...
         <namespace-access>
              <read-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role&gt;">
                             <group name="administrators" />
                        </security-role-mapping>
                   </namespace-resource>
              </read-access>
              <write-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role&gt;">
                             <group name="administrators" />
                        </security-role-mapping>
                   </namespace-resource>
              </write-access>
         </namespace-access>
    Any thoughts or recommendations for isolating and troubleshooting the problem would be highly appreciated.
    Many Thanks in Advance Guys!

    What Mylenium said. Although, perhaps with Forge Freeform and a huge amount of work, you might be able to fake it.

  • JNDI Naming Problem accessing Session Bean from Message Driven Bean

    Hi,
         I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocator (I have implemented ServiceLocator pattern to obtain JNDI reference for all EJBs). When I am calling the session fa�ade EJB from the Struts Action class everything is working fine.
         But when I am trying to call the same EJB from my Message Driven Bean, I am getting a JNDI exception (NameNotFoundException - No Object bound to name �java:comp/env/ejb/EJBJNDIName�). I am trying to get the remote reference from the same ServiceLocator which is successfully providing me a reference while calling from the struts action class. But the same ServiceLocator is not able to provide me a reference while calling from the Message Driven Bean. If I use the JNDI name directly like �EJBJNDIName� in the lookup it is working fine. The lookup for the name is working fine and I am able to call the Session Fa�ade bean with that reference.
         I am really not sure what exactly the problem is. If I have any problem in the ServiceLocator, it should have given me the same error while calling from Struts Action class. But it is working fine with the full name �java:comp/env/ejb/EJBJNDIName� calling from the struts action class. I am not sure whether Message Driven Bean has something to do with it. Why I am not able to get a reference of the EJB with the full name? Please Help.
    Thanks
    Amit

    Hi Bhagya,
    Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
    Thanks
    Amit

  • JNDI lookup problem in WAS 5.1

    Hello all,
    I have generated an EAR using XDoclet and MyEclipse. When I deploy this EAR on WAS 5.1, I get the following exception:
    javax.naming.NameNotFoundException: Context: WarHog/nodes/WarHog/servers/server1, name: ejb/TEDIObjectManagerLocal: First component in name TEDIObjectManagerLocal not found.  Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at com.ibm.rmi.iiop.CDRInputStream.readBoxedIDLEntity(CDRInputStream.java:2112)
         at com.ibm.rmi.iiop.CDRInputStream.readIDLValue(CDRInputStream.java:2177)
         at com.ibm.rmi.iiop.CDRInputStream.fast_read_value(CDRInputStream.java:1734)
         at com.ibm.rmi.io.IIOPInputStream.readValueType(IIOPInputStream.java:2085)
         at com.ibm.rmi.io.IIOPInputStream.readObjectField(IIOPInputStream.java:2057)
         at com.ibm.rmi.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1765)
         at com.ibm.rmi.io.IIOPInputStream.inputObjectUsingClassDesc(IIOPInputStream.java:1348)
         at com.ibm.rmi.io.IIOPInputStream.continueSimpleReadObject(IIOPInputStream.java:420)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObjectLoop(IIOPInputStream.java:404)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:347)
         at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:200)
         at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1367)
         at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
         at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
         at javax.rmi.CORBA.Util.copyObject(Util.java:333)
         at com.wdc.tedi.interfaces._TransformationEngine_Stub.transform(_TransformationEngine_Stub.java:268)
         at com.wdc.tedi.web.TestHarnessBean.translate(TestHarnessBean.java:42)
         at com.wdc.tedi.web.TestHarnessBean.setDataBlob(TestHarnessBean.java:80)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)First of all, I don't really understand what the error means. Is it that the JNDI lookup failed when one of my beans tried to do a lookup on 'ejb/TEDIObjectManagerLocal'? I believe there's some configuration that went wrong (EJB reference binding or something) when I deployed the EAR. The reason I don't think it's a faulty code is because the EAR runs like a charm when I deploy it on Oracle 10g and Weblogic.
    I am really stuck on this problem and shall appreciate any help that I can get. I can send the code, xdoclet tags and configuration if that might assist someone.
    Thanks
    -ybh6336

    Hello all,
    I'm still stuck on this issue. Following are the entries related to my
    application when I do a 'dumpNameSpace':
       28 (top)/nodes/WarHog/servers/server1/ejb/tedi/TEDIObjectManager
       28
    com.wdc.tedi.interfaces._TEDIObjectManagerHome_Stub
       29 (top)/nodes/WarHog/servers/server1/ejb/tedi/DSValueLookup
       29
    com.wdc.tedi.interfaces._DSValueLookupHome_Stub
       30 (top)/nodes/WarHog/servers/server1/ejb/tedi/TransformationEngine
       30
    com.wdc.tedi.interfaces._TransformationEngineHome_StubObservations:
    - I only see the namespace entries for my Session beans. There's one
    entity bean also which does not show up.
    - I don't see anything for the Local Home interfaces, it shows only the
    Home interfaces.
    As additional information, I'm looking up 'TEDIObjectManagerLocal'
    using 'ejb/TEDIObjectManagerLocal'. I also tried using 'local:ejb/ejb/TEDIObjectManagerLocal' (as Karthyk suggested) and
    'java:comp/env/ejb/TEDIObjectManagerLocal', but that does not work
    either.
    Also, the XDoclet tags that I use to generate the interfaces for
    TEDIObjectManager bean are as follows:
    /* @ejb.bean name="TEDIObjectManager"
    *           display-name="TEDIObjectManager"
    *           description="TEDIObjectManager"
    *           jndi-name="ejb/tedi/TEDIObjectManager"
    *           local-jndi-name="ejb/TEDIObjectManagerLocal"
    *           type="Stateless"
    *           view-type="both"
    * @ejb.util generate="physical"
    * @ejb.ejb-ref ejb-name="TEDIObject"
    * view-type = "local"
    * ref-name = "ejb/TEDIObjectLocal"
    * @oc4j.bean jndi-name="ejb/tedi/TEDIObjectManager"
    */My ejb-jar.xml looks like following for that bean:
    <session >
             <description><![CDATA[TEDIObjectManager]]></description>
             <display-name>TEDIObjectManager</display-name>
             <ejb-name>TEDIObjectManager</ejb-name>
             <home>com.wdc.tedi.interfaces.TEDIObjectManagerHome</home>
             <remote>com.wdc.tedi.interfaces.TEDIObjectManager</remote>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
             <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TEDIObjectManagerSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectLocal</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectLocalHome</local-home>
                <local>com.wdc.tedi.interfaces.TEDIObjectLocal</local>
                <ejb-link>TEDIObject</ejb-link>
             </ejb-local-ref>
          </session>AND following for the bean that is referencing it:
    <session >
             <description><![CDATA[TransformationEngine]]></description>
             <display-name>TransformationEngine</display-name>
             <ejb-name>TransformationEngine</ejb-name>
             <home>com.wdc.tedi.interfaces.TransformationEngineHome</home>
             <remote>com.wdc.tedi.interfaces.TransformationEngine</remote>
    <local-home>com.wdc.tedi.interfaces.TransformationEngineLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TransformationEngineLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TransformationEngineSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectManagerLocal</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
                <ejb-link>TEDIObjectManager</ejb-link>
             </ejb-local-ref>
          </session>The entries in ibm-ejb-jar-bnd.xmi (generated using MyEclipse) are as
    follows for the two beans:
    <ejbBindings
             xmi:id="Session_bnd_1"
             jndiName="ejb/tedi/TransformationEngine">
             <ejbRefBindings xmi:id="EJBRefBnd_1"
    jndiName="ejb/TEDIObjectManagerLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_1"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TransformationEngine" />
          </ejbBindings>
    <ejbBindings
             xmi:id="Session_bnd_3"
             jndiName="ejb/tedi/TEDIObjectManager">
             <ejbRefBindings xmi:id="EJBRefBnd_2"
    jndiName="ejb/TEDIObjectLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_2"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TEDIObjectManager" />
          </ejbBindings>I know I'm swamping the post with code, but please let me know if anyone finds something unusual.
    NOTE: When deploying on WAS, in the 'Map EJB references to beans' step, I'm giving the following values for 'TransformationEngine' bean:
    Reference binding: ejb/TEDIObjectManagerLocal
    JNDI Name: ejb/tedi/TEDIObjectManager
    There's one other similar binding that works for 'TEDIObjectManager'
    bean:
    Reference binding: ejb/TEDIObjectLocal
    JNDI Name: ejb/TEDIObject
    Everything in ejb-jar and ibm-ejb-jar-bnd.xmi look similar for this working bean, there is one difference though, I do the lookup on this one using 'java:comp/env/ejb/TEDIObjectLocal', but I've already tried that for the other one.
    Really appreciate your time.
    Thanks
    -yogesh

  • JNDI replication problems in WebLogic cluster.

    I need to implement a replicable property in the cluster: each server could
    update it and new value should be available for all cluster. I tried to bind
    this property to JNDI and got several problems:
    1) On each rebinding I got error messages:
    <Nov 12, 2001 8:30:08 PM PST> <Error> <Cluster> <Conflict start: You tried
    to bind an object under the name example.TestName in the jndi tree. The
    object you have bound java.util.Date from 10.1.8.114 is non clusterable and
    you have tried to bind more than once from two or more servers. Such objects
    can only deployed from one server.>
    <Nov 12, 2001 8:30:18 PM PST> <Error> <Cluster> <Conflict Resolved:
    example.TestName for the object java.util.Date from 10.1.9.250 under the
    bind name example.TestName in the jndi tree.>
    As I understand this is a designed behavior for non-RMI objects. Am I
    correct?
    2) Replication is still done, but I got randomly results: I bind object to
    server 1, get it from server 2 and they are not always the same even with
    delay between operation in several seconds (tested with 0-10 sec.) and while
    it lookup returns old version after 10 sec, second attempt without delay
    could return correct result.
    Any ideas how to ensure correct replication? I need lookup to return the
    object I bound on different sever.
    3) Even when lookup returns correct result, Admin Console in
    Server->Monitoring-> JNDI Tree shows an error for bound object:
    Exception
    javax.naming.NameNotFoundException: Unable to resolve example. Resolved: ''
    Unresolved:'example' ; remaining name ''
    My configuration: admin server + 3 managed servers in a cluster.
    JNDI bind and lookup is done from stateless session bean. Session is
    clusterable and deployed to all servers in cluster. Client invokes session
    methods throw t3 protocol directly on servers.
    Thank you for any help.

    It is not a good idea to use JNDI to replicate application data. Did you consider
    using JMS for this? Or JavaGroups (http://sourceforge.net/projects/javagroups/) -
    there is an example of distibuted hashtable in examples.
    Alex Rogozinsky <[email protected]> wrote:
    I need to implement a replicable property in the cluster: each server could
    update it and new value should be available for all cluster. I tried to bind
    this property to JNDI and got several problems:
    1) On each rebinding I got error messages:
    <Nov 12, 2001 8:30:08 PM PST> <Error> <Cluster> <Conflict start: You tried
    to bind an object under the name example.TestName in the jndi tree. The
    object you have bound java.util.Date from 10.1.8.114 is non clusterable and
    you have tried to bind more than once from two or more servers. Such objects
    can only deployed from one server.>
    <Nov 12, 2001 8:30:18 PM PST> <Error> <Cluster> <Conflict Resolved:
    example.TestName for the object java.util.Date from 10.1.9.250 under the
    bind name example.TestName in the jndi tree.>
    As I understand this is a designed behavior for non-RMI objects. Am I
    correct?
    2) Replication is still done, but I got randomly results: I bind object to
    server 1, get it from server 2 and they are not always the same even with
    delay between operation in several seconds (tested with 0-10 sec.) and while
    it lookup returns old version after 10 sec, second attempt without delay
    could return correct result.
    Any ideas how to ensure correct replication? I need lookup to return the
    object I bound on different sever.
    3) Even when lookup returns correct result, Admin Console in
    Server->Monitoring-> JNDI Tree shows an error for bound object:
    Exception
    javax.naming.NameNotFoundException: Unable to resolve example. Resolved: ''
    Unresolved:'example' ; remaining name ''
    My configuration: admin server + 3 managed servers in a cluster.
    JNDI bind and lookup is done from stateless session bean. Session is
    clusterable and deployed to all servers in cluster. Client invokes session
    methods throw t3 protocol directly on servers.
    Thank you for any help.--
    Dimitri

  • JNDI access problem in JBoss

    I have developed a small application that uses a session bean, that sets and gets a message.
    If a run the application inside JBuilderX it works just find, but when a create a jar file, only the interface shows up, but the application doesn't communicate with the session bean. I've checked that the application server was running (I'm using JBoss 3.2.5).
    The jar file contains all the .class files of my project and the jar files that are in the client directory of JBoss.
    I have found that the problem is that the client cannot access the jndi service.
    The client code is:
    public void initialize() {
    try {
    Context context = getInitialContext();
    Object ref = context.lookup("BeanSesion1");
    beanSesion1Home = (BeanSesion1Home) PortableRemoteObject.narrow(ref, BeanSesion1Home.class);
    catch(NamingException e) {
    e.printStackTrace();
    private Context getInitialContext() throws NamingException {
    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    environment.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    return new InitialContext(environment);
    The exception NamingException is thrown. It seems that the client cannot found "org.jnp.interfaces.NamingContextFactory", "org.jboss.naming:org.jnp.interfaces" and "jnp://localhost:1099"
    (I'm running JBoss server in the same machine I intend to run the client)
    I have also tried not to set an initial context with properties. Instead I wrote a jndi.properties file that contains the following
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    java.naming.provider.url=jnp://localhost:1099
    and put it in the application classpath (for example C:\JBUILDERX\JDK1.4\bin\java -classpath "C:\JBuilderX\proyects\BeanSession\classes;c:\tmp;" beansession.Application
    (jndi.properties is in c:\tmp)
    This didn't work either.
    Does anybody know where the problem is?
    thanks

    You need to have the foolowing file in your classpath too:
    c:\jboss-3.2.?\client\jbossall-client.jar

  • Websphere JNDI lookup problem

    Hi All
    Two separate webapps, have different names for Datasources, on the same host and port. Both application work fine independently.
    When we deploy both applications on the same app server(websphere), whichever we executes first gets its datasource from JNDI lookup and works fine, but when we try second application it have problem in finding its data source from JNDI lookup. If we start this second application first, it will work fine, but now another will have the same problem in its JNDI lookup.
    Any idea why.
    Thanks
    ....Ranvir

    Hi All
    Two separate webapps, have different names for
    Datasources, on the same host and port. Both
    application work fine independently.
    When we deploy both applications on the same app
    server(websphere), whichever we executes first gets
    its datasource from JNDI lookup and works fine, but
    when we try second application it have problem in
    finding its data source from JNDI lookup. If we start
    this second application first, it will work fine, but
    now another will have the same problem in its JNDI
    lookup.
    Any idea why.
    Thanks
    ....RanvirHi Ranvir,
    Do you mean you try to reach the same datasource with different names or do you try to reach different datasources over the same port?
    If you try the first issue you shouldn't get any trouble. At least it works fine with JBOSS for example.
    But if you try to do the latter in my oppinion you don't have a JNDI problem but a problem with socket binding: the two different databases must be contacted over different ports.
    What do WebSphere's logs tell?
    Best regards
    Andy

  • Ejb-ref and JNDI lookup problem

    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files. I tried to
    use session bean to refer entity bean, I failed. The details are as following:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
         <ejb-reference-description>
              <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
              <jndi-name>ejb/CabinHome</jndi-name>
         </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome'
         <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']
         at com.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBean_a4c3ph_EOImpl.java:37)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer> <ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changes for domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

    Slava,
    I took "cabin." out from weblogic-ejb-jar.xml, I got the same error.
    DJ
    "Slava Imeshev" <[email protected]> wrote:
    Hi DJ,
    I think you don't need "cabin." in weblogic-ejb-jar.xml :
    <jndi-name>cabin.CabinHome</jndi-name>
    Regards,
    Slava Imeshev
    "DJ" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files.I
    tried to
    use session bean to refer entity bean, I failed. The details are asfollowing:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <jndi-name>ejb/CabinHome</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remainingname
    'CabinHome'
    <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']
    atcom.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBe
    an_a4c3ph_EOImpl.java:37)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :93)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
    2)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer><ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changesfor
    domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

  • JNDI Lookup Problem (General Problem)

    hi all,
    i am newbie on bea products, but i have some experience on java technologies, how i fount on bea documentations and forums many people has the same problem like this, can anybody help us (me)?
    problem: how is it possible to write simple client for j2ee server application? i found some posts about jndi lookup, and fount about j2ee client, but is there any doc or example how to write this j2ee client ???
    i worked with many application servers and i have no problem with them (JBoss, Sun App Server, IBM Websophere, Oracle AS etc.)
    some people told about jndi tree on Web Logic Server Administration console , i found this tree i my session beans looks like :
    Binding Name:
    TimestenExampleTimestenExample_jarInsertSubscriberBean_InsertSubscriber
    Class:     
    test.InsertSubscriberBean_o7jk9u_InsertSubscriberImpl_1000_WLStub
    why is so strange name for class or binding name ????
    my session bean name is : InsertSubscriber
    and it's implementation : InsertSubscriberBean
    how i can lookup from client ?????
    can anybody show me code snippet ???
    my client looks like :
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NameClassPair;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import org.hibernate.property.Dom4jAccessor.ElementGetter;
    public class Client {
         public static void main(String[] args) {
              Context ctx = null;
              Hashtable ht = new Hashtable();
              ht.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
              ht.put(Context.PROVIDER_URL, "t3://192.9.200.222:7001");
              try {
                   ctx = new InitialContext(ht);
                   InsertSubscriber usagefasade = (InsertSubscriber) ctx
                             .lookup("java:comp/InsertSubscriber");
              } catch (NamingException e) {
                   e.printStackTrace();
              } finally {
                   try {
                        ctx.close();
                   } catch (Exception e) {
                        e.printStackTrace();
    }can anybody show me what is there incorrect ????
    oo yes and i have weblogic.jar file into my client classpath.

    Hi,
    Your EJB client looks fine.
    You should use the JNDI name of your ejb while doing the lookup. i.e :
    InsertSubscriber usagefasade = (InsertSubscriber) ctx.lookup("..use JNDI name of EJB...");
    You can use the JNDI name of the EJB that you see in the JNDI tree of weblogic. [don't use Binding Name or Class name]. you can also specify the JNDI name by "jndi-name" attribute in weblogic-ejb-jar.xml.
    for more info:
    http://e-docs.bea.com/wls/docs81/ejb/ejb11.html
    Thanks,
    Qumar Hussain

  • JWS - EJB JNDI Lookup problem

    Hi,
    I have a client Java application accessing a session EJB in a remote JBoss J2EE server. I'm using JWS 1.2 to deploy my application but when I do a JNDI lookup to get access the the remote's object home interface I get this error:
    "Need to specify class name in environment or system property, or as an applet parameter, or in an application resorce file: java.naming.factory.initial"
    All the jar files are signed and the JNPL file contains <all-permissions/>. This is the code that triggers the exception
    jndiContext = new InitialContext();
    homeRMIReference = jndiContext.lookup(C_SERVICE_NAME);
    Any help would be appreciated.
    Thanks in advance,
    Rafael

    Hi,
    I've finally found the origin of the problem.
    1. JNDI uses a minimum set of properties during initialization phase:
    java.naming.factory.initial
    java.naming.factory.url.pkgs
    java.naming.provider.url
    Therefore these properties must be set in the <resource> topic of the JNLP file. The value of these properties is defined in the jndi.properties file that you can find in jbossjmx.ant.jar (within the jboss/client directory)
    2. You have to add the JBoss files to your bundle. For doing so I've unjared all the .jar files within the jboss/client directory; afterwards I have jared them in a single file "jboss.jar" and I've signed the file. I've added jboss.jar to the <resource> tag within the JNLP file (Note that I've added all the jboss files just to do quick check but usually you will have to add only those files you need (it doesn't make sense to deploy all JBoss files in each client application)
    I hope this helps,
    Rafael

  • JNDI lookup problem (II)

    after reading the reply from Michael Lehmann and changed to 3101. It did connect to the JNDI! now. the problem turn to the domain/application name in the provider_url:
    env.put(Context.PROVIDER_URL, "ormi://10.6.208.6:3101/XXX");
    my question is how you guys define the domain/application name? and how the app server knows which OC4J containing this domain/application for i have several OC4J installed on my appserver?
    Thanks.

    how you guys define the domain/application name? and
    how the app server knows which OC4J containing this >domain/application for i have several OC4J installed on >my appserver?The application name is part of the deployment. On Oracle9iAS for example, I deploy the ear file with a command like this:
    dcmctl redeployApplication -file myEJB.ear -application myEJB
    and myEJB becomes the application part of the provider URL.
    On a stand alone OC4J the command looks like:
    java -jar <oc4j_home>\j2ee\home\admin.jar ormi://127.0.0.1/ admin **** -deploy -file myEJB.ear -deploymentName myEJB
    As for deploying across clusters, this is the magic of DCM or Oracle Enterprise Manager. If you have configured a cluster the DCM infrastructure takes care of the heavy lifting for you. For more information on DCM and related administrative operations, see:
    http://download-west.oracle.com/docs/cd/A97688_08/generic.903/a97681/dcm2.htm#620714
    Where it gets tricky is having a remote client lookup as in your initial example versus working in a client colocated with the EJB. Right now in 9.0.3 colocated lookups work automatically whereas remote lookups require the workaround of identifying the RMI port number or using jndi.properties file to hide the range of ports your client might try.
    In 9iAS 9.0.4, as per this note:
    9.0.3 / EJB / RMI-Ports / Islands-Configuration??
    the process manager gets a new API that lets the client inquire over which ports should be used.
    Mike.

  • EJB3: JNDI connection problem managed server

    Hi all,
    In a JUnit test, I tried to look up a Session EJB from a remote managed server:
    Hashtable<String, String> props = new Hashtable<String, String>();
    props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    props.put(javax.naming.Context.PROVIDER_URL, "t3://server1.ux.yucom.es:1751");
    props.put(javax.naming.Context.SECURITY_PRINCIPAL, "userName");
    props.put(javax.naming.Context.SECURITY_CREDENTIALS, "pwd");
    props.put(weblogic.jndi.WLContext.ALLOW_EXTERNAL_APP_LOOKUP, "true");
    InitialContext context = new InitialContext(props);
    Command command = (Command) context.lookup(jndiName);
    But the code already fails while instantiating the InitialContext, because of a connection problem:
    Caused by: java.net.ConnectException: t3://server1.ux.yucom.es:1751: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection timed out: connect; No available router to destination
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:203)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:352)
         ... 34 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection timed out: connect; No available router to destination
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:251)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:225)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:188)
         ... 36 more
    I'm able to connect to the the Admin server... In this case I receive a javax.naming.NameNotFoundException, obviously, since the remote EJB is only targetted on the managed server and not on the admin.
    This is confirmed by following little test on the command line:
    java -cp %WL_HOME%\server\lib\weblogic.jar weblogic.Admin -url t3://server1.ux.yucom.es:1700 -username <user> -password <pwd> PING
    => OK, packets received
    java -cp %WL_HOME%\server\lib\weblogic.jar weblogic.Admin -url t3://server1.ux.yucom.es:1751 -username <user> -password <pwd> PING
    => Failure:
    Failed to connect to server1.ux.yucom.es:1751: Destination unreachable; nested exception is:
    java.net.ConnectException: Connection timed out: connect; No available router to destination
    Does anyone has an idea why the connection to the managed server fails??
    Is it a configuration problem in WebLogic?
    Thx a lot!
    Wim.

    Hi,
    Are you able to Remotely Access any Simple Web Application deployed on "server1.ux.yucom.es:1751".
    Example: http://server1.ux.yucom.es:1751/TestApp/index.jsp
    If NOT: Means Some where there is a problem with the Port...Just for testing Try Changin Manged Server port to Default HTTP Port (80).
    If Yes: Then there are chances that Your Box is not allowing any t3-Protocol Traffic on 1751 Port. Just for Testing Enable HTTP Tunneling on this Server from Admin Console
    AdminConsole --> Home-->Summary Of Servers --->ManagedServer1 ---> Protocol (Tab) ---> HTTP (SubTab) --->Enable Tunneling (Check This Check Box)    Save the changes.
    And then After restarting your Server ... Try to ping your Server using:
    java -cp %WL_HOME%\server\lib\weblogic.jar weblogic.Admin -url http://server1.ux.yucom.es:1751 -username <user> -password <pwd> PING
    In the Above command Use HTTP protocol instead of T3. If Now u are able to Ping the Server means Your Port 1751 was not allowing any other Protocol except HTTP.
    Thanks
    Jay SenSharma
    http://middlewaremagic.com/weblogic  (Middleware magic Is Here)

  • JMS JNDI configurtaration problem

    IHAC where we are connecting PeopleSoft Integration Broker. Unfortunately PIB doesn't support LDAP for JNDI (go figure). So I have to use a .bindings file.
    Problem is, when I run the HelloWorldMessageJNDI I get the following error:
    Using file:///tmp/mq for Context.PROVIDER_URL
    Looking up Connection Factory object with lookup name: CSoutboundQCF Connection Factory object found.
    Looking up Queue object with lookup name: CSoutboundQ Failed to lookup Queue object.
    Please make sure you have created the Queue object using the command:
           imqobjmgr -i add_q.props
    The exception details:
    javax.naming.NameNotFoundException: CSoutboundQ
           at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
           at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
           at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
           at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
           at javax.naming.InitialContext.lookup(Unknown Source)
           at HelloWorldMessageJNDI.<init>(HelloWorldMessageJNDI.java:187)
           at HelloWorldMessageJNDI.main(HelloWorldMessageJNDI.java:120)

    It's looks almost as the same as my problem in web app., when I forgot wrote tags <resource-env-ref in web.xml..
    e.g. web.xml
    <resource-env-ref>
    <resource-env-ref-name>jms/MainQueue</resource-env-ref-name>
    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
    </resource-env-ref>
    <resource-ref>
    <res-ref-name>jms/MainQueueConnectionFactory</res-ref-name>
    <res-type>javax.jms.QueueConnectionFactory</res-type>
    </resource-ref>
    ....

  • 11g preview version 3: JNDI Lookup problem when calling PL/SQL webservice

    Hi,
    I am experiencing a problem when calling a PL/SQL Webservice from a BPEL flow.
    When I am trying to test my BPEL flow from the SOA Console I get a "Error doing JNDI lookup on target jdbc/MyDBDS"
    The composite application including the BPEL flow is deployed in one application. "CompositeApp" and the web service in another Application called
    "WebServiceApp".
    Both applications are deployed on the same built in OC4J Application Server
    If I test the webservice in isolation from the SOA console it works. It also seems to be working if the webservice and the and the BPEL flow is in the same project.
    If anyone has any ideas on this one I would be very greatful.
    Thanks in advance

    try creating the MyDBDS connection as an application resource in both applications.

Maybe you are looking for

  • How to use Dynamic Internal table

    Hello, I have a requirement where I need to pick a field from final internal table and display that field as ALV columns and I have to pick another field in the same INternal table to display it as a corresponding value for each header DYNAMICALLY. l

  • Replace a file which has a specific ID with another one

    I want to replace a file with another one using JSOM, but preserving all other associated fields (like Author and other custom columns in the document library) How can I select the file I want to replace using the ID field? For example, when I update

  • Iphone passcode and itunes

    Hey, i've got a problem.. i forgot my iphone passcode and then i wanted to set the iphone back, but then there's a note which says that i have to turn off the 'search my iphone' function in the icloud on my iphone. But i don't get through the passcod

  • Update of Extension Manager CC failed

    Is anyone else having this problem with Extension Manager CC update through Creative Cloud? It fails to update on all attempts and retries?

  • AirPort Extreme base station as bridge - is WPA allowed?

    Hello, I have an AirPort Extreme base station that is connected to the Internet via an older Linksys wired router. The Linksys is connected to a cable modem and acts as a router (so it's the DHCP host), while the AirPort acts as a bridge between wire