Jndi.properties?  where?

This is a stupid question but I cant quite figure out a good location for
jndi.properties. Where would be a good place to load this file so that it
is only available from within a specific application.
Thanks,
Jeff

Hi,
I think this can be made, but I'm not sure, please let me know the
purpose, are you getting any errors and where is it located as of now and I
can find this.
Regards
Raj
Jeff Bailey wrote:
This is a stupid question but I cant quite figure out a good location for
jndi.properties. Where would be a good place to load this file so that it
is only available from within a specific application.
Thanks,
Jeff

Similar Messages

  • JMS destination and queue in jndi.properties

    I am using activemq to create a very simple jms application.
    But there is a point I have not understand.The administered connection factory object that I use is org.activemq.jndi.ActiveMQInitialContextFactory which is the ActiveMq specific object. Do I have to do the same with the destination object?I read that Destination is also an administered object so I have to use an object of the ActiveMq? Specifically in the jndi properties where I define the queue property the value must be:
    1.an activeMq object
    2.a java class that implements the javax.jsm.Queue interface
    3.a physical name of another server?
    and in the code where I look up the destination object
    Destination destination = (Destination) jndiContext.lookup(queueProp);What exactly will be the queueProp? I would appreciate an example
    Thanking you in advance.

    I've read the documentation but I am afraid I miss some points.
    First of all I use the following code from an example in the net where the <b> activemq.jar is >/b> used and the jndi.properties is not used at all and the following code is working:package jms;
    import org.activemq.ActiveMQConnectionFactory;
    import javax.jms.Connection;
    import javax.jms.DeliveryMode;
    import javax.jms.Destination;
    import javax.jms.ExceptionListener;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.MessageConsumer;
    import javax.jms.MessageProducer;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    * Hello world!
    public class App {
        public static void main(String[] args) throws Exception {
            thread(new HelloWorldBroker(args), true);
            Thread.sleep(1000);
            thread(new HelloWorldProducer(), false);
            thread(new HelloWorldProducer(), false);
            thread(new HelloWorldConsumer(), false);
            Thread.sleep(1000);
            thread(new HelloWorldConsumer(), false);
                   Thread.sleep(1000);
            thread(new HelloWorldConsumer(), false);
            thread(new HelloWorldProducer(), false);
                    Thread.sleep(1000);
                 thread(new HelloWorldProducer(), false);
            thread(new HelloWorldConsumer(), false);
        public static void thread(Runnable runnable, boolean daemon) {
            Thread brokerThread = new Thread(runnable);
            brokerThread.setDaemon(daemon);
            brokerThread.start();
        public static class HelloWorldBroker implements Runnable {
            private final String[] args;
            public HelloWorldBroker(String[] args) {
                this.args = args;
            public void run() {
                org.activemq.broker.impl.Main.main(args);
        public static class HelloWorldProducer implements Runnable {
            public void run() {
                try {
                    // Create a ConnectionFactory
                    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
                    // Create a Connection
                    Connection connection = connectionFactory.createConnection();
                    connection.start();
                    // Create a Session
                    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                    // Create the destination (Topic or Queue)
                    Destination destination = session.createQueue("TEST.FOO");
                    // Create a MessageProducer from the Session to the Topic or Queue
                    MessageProducer producer = session.createProducer(destination);
                    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
                    // Create a messages
                    String text = "Hello world! From: " + Thread.currentThread().getName() + " : " + this.hashCode();
                    TextMessage message = session.createTextMessage(text);
                    // Tell the producer to send the message
                    System.out.println("Sent message: "+ message.hashCode() + " : " + Thread.currentThread().getName());
                    producer.send(message);
                    // Clean up
                    session.close();
                    connection.close();
                catch (Exception e) {
                    System.out.println("Caught: " + e);
                    e.printStackTrace();
        public static class HelloWorldConsumer implements Runnable, ExceptionListener {
            public void run() {
                try {
                    // Create a ConnectionFactory
                    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
                    // Create a Connection
                    Connection connection = connectionFactory.createConnection();
                    connection.start();
                    connection.setExceptionListener(this);
                    // Create a Session
                    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                    // Create the destination (Topic or Queue)
                    Destination destination = session.createQueue("TEST.FOO");
                    // Create a MessageConsumer from the Session to the Topic or Queue
                    MessageConsumer consumer = session.createConsumer(destination);
                    // Wait for a message
                    Message message = consumer.receive(1000);
                    if (message instanceof TextMessage) {
                        TextMessage textMessage = (TextMessage) message;
                        String text = textMessage.getText();
                        System.out.println("Received: " + text);
                    } else {
                        System.out.println("Received: " + message);
                    consumer.close();
                    session.close();
                    connection.close();
                } catch (Exception e) {
                    System.out.println("Caught: " + e);
                    e.printStackTrace();
            public synchronized void onException(JMSException ex) {
                System.out.println("JMS Exception occured.  Shutting down client.");
    }But I want to make it work with jndi.properties.
    So I am trying to use a code where connectionFactory and Destination are loaded from the jndi properties.After experimenting with code
    the following is working
         try {
                   connectionFactory = (ConnectionFactory) jndiContext.lookup("connectionFactory");               
                  Destination destination = (Destination) jndiContext.lookup("QUEUE/MYQUEUE");        
              Connection connection = connectionFactory.createConnection();
              Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);if only I go to the activeqm/bin folder and open the broker.If I did that in the previous code(with no jndi prop)
    there was an exception that was saying that the port was already used.So I do not understand why in the one case opening broker is necessary for the connection and on the other hand it causes a problem.
    Moreover in the case that I invoke broker from bin folder. In this case I would like to ask a question.The activemq.xml is necessary? If yes it is there where we define the queue?
    If not where else apart from the jndi.properties do we define queue?
    Please if is possible provide me with an example of the necessary places that we define a queue.
    Thank you

  • Where to put jndi.properties in Web application to lookup remote EJB?

    Hi All,
    I want to use EJB deployed in an OC4J from web application deployed in another OC4J.
    I've try to put jndi.properties file into WEB-INF/classes; package it into a jarfile and put into WEB-INF/lib, ... In all case, it doesn't work.
    If I hard-coding the env properties as following, it works.
    env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
    env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
    env.put( Context.SECURITY_CREDENTIALS, "welcome1");
    env.put(Context.PROVIDER_URL, "opmn:ormi://fmtresearch:6005:home/TEST");
    But if I put those env properties in jndi.properties file, it doesn't work.
    java.naming.factory.initial=oracle.j2ee.rmi.RMIInitialContextFactory
    java.naming.security.principal=oc4jadmin
    java.naming.security.credentials=welcome1
    java.naming.provider.url=opmn:ormi://fmtresearch:6005:home/TEST
    Note that, the jndi.properties work if it is used in client application.
    Please help me! Thanks.

    This may not help you directly. However, did you try printing the environment properties in the InitialContext you created.
    Another thing.
    You can use this function after creating the initial context to see the JNDI tree and see if it contains anything.
    Thank you.
    Function To list the JNDI Context name-object bindings
    private void listContext2 (Context ctx, int ind, String name, String spaceIndent) {
    String indent = spaceIndent + "[" + Integer.toString (ind) + "]" ;
    try {
    System.out.println (indent + "{" + name + "}");
    NamingEnumeration justList = ctx.list(name);
    while (justList.hasMore()) {
    NameClassPair listItem = (NameClassPair) justList.next();
    String className = listItem.getClassName();
    String subName = listItem.getName();
    boolean isRelative = listItem.isRelative();
    String relativeName = ("".equals(name) ? new String(subName) : new String (name + "/" + subName));
    listContext2 (ctx, (ind+1), relativeName, (" " + spaceIndent) );
    catch (Exception exc) {
    System.out.println ("Exception Occured at listContext2");
    Hope it helps not deviates. Good luck

  • Unable to access  Remote EJB with jndi.properties in classpath

    Hi
    I'm trying to use remote interfaces with my adf web layer.
    Created remote datacontrol for my model part and my model EAR is deployed in another Oracle App Server instance(S1).
    My web layer is deployed in another Oracle App Server(S2). My page def uses the remote interfaces.
    Following are the files which are needed to have ejb ref entry.
    ---- orion-web.xml ----
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <orion-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd"
    schema-major-version="10" schema-minor-version="0"
    servlet-webdir="/servlet/" >
    <ejb-ref-mapping name="MySessionEJB" location="MySessionEJB"
    remote-server-ref="true"
    jndi-properties-file="jndi.properties"></ejb-ref-mapping>
    </orion-web-app>
    --- web.xml ---
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>oracle.adf.view.faces.USE_APPLICATION_VIEW_CACHE</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>CpxFileName</param-name>
    <param-value>com.home.view.DataBindings</param-value>
    </context-param>
    <filter>
    <filter-name>PCF</filter-name>
    <filter-class>oracle.webcache.adf.filter.FacesPageCachingFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>PCF</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>AFCStatsServlet</servlet-name>
    <servlet-class>oracle.webcache.adf.servlet.AFCStatsServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>1</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
    <jsp-config/>
    <ejb-ref>
    <ejb-ref-name>MySessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <remote>com.home.model.MySessionEJBRemote</remote>
    <ejb-link>MySessionEJB</ejb-link>
    </ejb-ref>
    </web-app>
    and this jndi.properties file in placed in the WEB-INF/classes folder.
    java.naming.factory.initial=oracle.j2ee.rmi.RMIInitialContextFactory
    java.naming.security.principal=oc4jadmin
    java.naming.security.credentials=welcome123
    java.naming.provider.url=opmn:ormi://S1:6003:Test_Instance/test-ejb
    The same web application if I run it in Jdeveloper its able to open the welcome.jspx which calls the remote EJB method on load. But when I deploy it Oracle Server 10.1.3.1.0 the error "500 Internal Server Error" shows up and in log file following exception can be found
    avax.faces.el.EvaluationException: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg
    =JBO-29000: Unexpected exception caught: javax.naming.NameNotFoundException, msg=MySessionEJB not found
    Seems like the jndi properties is ignored during the Context creation for lookup.
    Please advice where I'm missing the configuration.

    http://docs.sun.com/source/819-0079/dgjndi.html

  • JNDI Properties file

    Hi,
    Im having trouble setting up my first J2EE EJB and client program. I have managed to pinpoint the problem to be with the selection of the JNDI service provider (keep getting a NoInitialContextException).
    Both client and EJB are on the same machine, and Im using Sun's app server v8 . Could someone tell me what I should have in the jndi.properties file, and where this file should be put. I have tried hard-coding the details into the program, but w/o success.
    I assume that using the jndi.properties file will assign a provider globally across all applications in this server - is this true?
    Thanks.

    I read somewhere that the standard j2ee.jar file (which I have in my classpath) contains a default jndi.properties file to allow basic JNDI access.
    If this is true, then the problem is not with these properties. Heres what I have:
    I compiled the classes using javac, no problems (j2ee.jar is in the classpath).
    I am trying to run the client using java -classpath ClientApp.jar FirstClient, where ClientApp.jar is the stubs/skeletons produced at deployment. This method keeps throwing a NoInitialContextException.: need to specify class name . . .
    I also tried using appclient, but that threw even more errors (not entirely sure whats going on here).
    I have checked over my code, and as far as I can see the problem is not in there - Im sure its something to do with the classpath or something - is there a classpath I should be adding to get the client working?
    Why is J2EE so hard to learn? I find myself struggling more with footery errors than I do actuially reading and learning about how to use it.
    Thanks.

  • Jndi.properties in the class path

    Hi,
    i deployed a webservice to the embedded oc4j in JDEV(10.1.3).
    Form this webservice an external oc4j (9.0.4) is looked up.
    First problem:
    I have some problems to initial the InitialContext. It seems to me that the jndi.properties file is not found.
    I think its perhaps a classloader problem.
    Second problem:
    If i hardcode the props, the extarnal oc4j is connected, but the lookup hangs up.
    May be it a the different versions are the problem.
    Any help appriciated.
    Thanks and regads
    Chris

    Ok. I finally i found a solution for the second problem, after i could take a look into the logs of the external oc4j.
    Thanks to heimberger and his blog.
    In 10.1.3 there where some changes to ormi (new protocol version 1.3). For a communication between 10.1.3 and older versions of oc4j a patch is needed. Its metalink 4676768. The older version must be able to negotiate the version of ormi.
    Hope that will do the job.
    But i still can not make the 10.1.3 embedded oc4j take the jndi.properties from the application classpath.
    I wonder if nobody has had the same problem.
    Regards
    Chris

  • Edit JNDI properties in Oracle9i Jdeveloper

    Hi All,
    When create a client for EJB in Oracle9i JDeveloper Version 9.0.3, adds in code in each client created to set the JNDI properties. I want to know from where and how does the OC4J server read these JNDI parameters from. Is there any file like "jndi.properties" from where the server reads the parameters.. ???. Is it possible to edit these sever settings(regarding JNDI parameters). If yes please let me know as to how this could be achived.
    Thanks in advance,
    Reshma

    Hi All,
    When create a client for EJB in Oracle9i JDeveloper Version 9.0.3, adds in code in each client created to set the JNDI properties. I want to know from where and how does the OC4J server read these JNDI parameters from. Is there any file like "jndi.properties" from where the server reads the parameters.. ???. Is it possible to edit these sever settings(regarding JNDI parameters). If yes please let me know as to how this could be achived.Inside the server they are set automatically. If you want to override them, you have it do it programatically when you create the initial context.
    Rob

  • Jndi.properties - javax.naming.NoInitialContextException

    hi
    i'm new to netbeans (5.5) and the Sun 9 appserver. I've been using JBoss & Eclipse to date.
    I'm getting the javax.naming.NoInitialContextException and I believe it's because I'm not using jndi.properties like in jboss.
    The problem is that I cannot seem to find where it should go and what it should look like.
    Can someone please help ?
    Thanks

    All the documentation you need is here:
    http://docs.sun.com/app/docs/coll/1343.3
    I would particularly point you to http://docs.sun.com/app/docs/doc/819-3659/6n5s6m5bn?a=view

  • Jndi.properties for WAR trouble

    Hi All.
    To access a remote enterprise bean, I have to populate the required JNDI properties in my web-tier code, when creating the context.
    Trouble how to do this using jndi.properties file ? When I append path of file to CLASSPATH obviously it works (tested using simple session client) but when I deploy my war – properties file is invisible for my delegate. So question : How to include jndi.properties file in classpath for that WAR, or where I have to place it ?

    InitialContext takes care of that already.
    Do you use InitialContext to connect to your own components in the same container too? If so, specify the content of jndi.properties explicitely.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                               

  • Using jndi.properties

    How can I use a jndi.properties file for JBoss within JDev? I haven't deployed one before and I'm not sure where it should go within JDev. Thanks.

    At home, this works for me:
    c:\jboss-3.2.3\server\default\conf
    and then add to your classpath

  • Problem with the JNDI properties while executing a client test

    Hello Everybody,
    I'm trying to learn Jdeveloper, and I have followed the tutoriel " Learn Oracle Fronn Oracle" Volum 2, so i am trying to create a simple oriented bean message with EJB 3.0, and a client test to deliver a message, and the problem is that i can't display my message in the Embedded OC4J WINDOW.
    This is the errors displayed:
    Line:-----
    D:\jdevstudio10132\jdk\bin\javaw.exe -client -classpath D:\jdevstudio10132\EJB30MDB\SimpleMDB\classes;D:\jdevstudio10132\j2ee\home\lib\ejb30.jar;D:\jdevstudio10132\j2ee\home\lib\activation.jar;D:\jdevstudio10132\j2ee\home\lib\ejb.jar;D:\jdevstudio10132\j2ee\home\lib\jms.jar;D:\jdevstudio10132\j2ee\home\lib\jta.jar;D:\jdevstudio10132\j2ee\home\lib\mail.jar;D:\jdevstudio10132\j2ee\home\lib\servlet.jar;D:\jdevstudio10132\rdbms\jlib\aqapi.jar;D:\jdevstudio10132\toplink\jlib\toplink-essentials.jar;D:\jdevstudio10132\j2ee\home\oc4j.jar;D:\jdevstudio10132\j2ee\home\oc4jclient.jar;D:\jdevstudio10132\j2ee\home\lib\javax77.jar -Dhttp.proxyHost=10.0.0.99 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.0.0.1|doi-sonia -Dhttps.proxyHost=10.0.0.99 -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=localhost|127.0.0.1|doi-sonia oracle.mdb.jmsclient.TestJMSClient
    Looking up TCF
    javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:292)
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at com.evermind.naming.FilterContext.lookup(FilterContext.java:126)
         at com.evermind.server.ApplicationClientContext.lookup(ApplicationClientContext.java:63)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at oracle.mdb.jmsclient.TestJMSClient.main(TestJMSClient.java:20)
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:207)
         at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:682)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:58)
         at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:78)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:68)
         at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:646)
         at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:190)
         at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:174)
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:283)
         ... 5 more
    Process exited with exit code 0.
    Line:-----
    and and there is the TestJMSClient code:
    Line:-----
    package oracle.mdb.jmsclient;
    import javax.jms.Connection;
    import javax.jms.ConnectionFactory;
    import javax.jms.Destination;
    import javax.jms.Message;
    import javax.jms.MessageProducer;
    import javax.jms.Session;
    import javax.jms.Topic;
    import javax.naming.InitialContext;
    public class TestJMSClient {
    public static void main(String[] args) {
    try {
    System.out.println("Looking up TCF");
    ConnectionFactory connectionFactory =
    (ConnectionFactory) new InitialContext()
    .lookup("jms/TopicConnectionFactory");
    Connection connection = connectionFactory.createConnection();
    connection.start();
    System.out.println("Starting Topic Session");
    Session topicSession = connection.createSession(false,
    Session.AUTO_ACKNOWLEDGE);
    Destination topic = (Destination)new InitialContext().lookup("jms/demoTopic");
    MessageProducer publisher = topicSession.createProducer(topic);
    Message message = topicSession.createMessage();
    message.setJMSType("theMessage");
    message.setLongProperty("time", System.currentTimeMillis());
    message.setStringProperty("subject", "Test EJB 3.0 MDB");
    message.setStringProperty("message",
    "Test message Send to first EJB 3.0 MDB");
    publisher.send(message);
    System.out
    .println("Message Sent to JMS Topic, Check Server Console to See whether MDB got activated!");
    publisher.close();
    topicSession.close();
    connection.close();
    }catch (Throwable ex) {
    ex.printStackTrace();
    Line:-----
    I am not sure if the JNDI properties should have a correct configuration to make this application work:
    Line:-----
    java.naming.factory.initial=oracle.j2ee.naming.ApplicationClientInitialContextFactory
    java.naming.provider.url=ormi://localhost:23891/current-workspace-app
    java.naming.security.principal=oc4jconn
    java.naming.security.credentials=welcome
    Line:-----
    Above, it's the code given by the tutoriel, i change welcome by my pass word, but the problem still existing.
    Any idea or help would be greatful
    Thanks

    I use Oracle Jdeveloper 10.1.3.2.0 , Oracle 10g(10.2) Express Edition and PL/SQL Developer V: 7.1.0.13337, XP as OS .
    this is my netstat-a cmd, i expect you can answer, if you want any information about my system, ask me and i will answer you, thanks a lot:
    Connexions actives
    Proto Adresse locale Adresse distante Etat
    TCP est-tatia:epmap est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:microsoft-ds est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:1053 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:1110 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:1521 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:8888 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:9127 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:19780 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:23791 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:23943 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:netbios-ssn est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:1056 est-tatia.ABL.local:1521 ESTABLISHED
    TCP est-tatia:1059 10.0.0.101:13000 ESTABLISHED
    TCP est-tatia:1387 10.0.0.101:epmap TIME_WAIT
    TCP est-tatia:1388 10.0.0.101:1026 TIME_WAIT
    TCP est-tatia:1390 10.0.0.101:epmap TIME_WAIT
    TCP est-tatia:1391 10.0.0.101:1026 TIME_WAIT
    TCP est-tatia:1521 est-tatia.ABL.local:1056 ESTABLISHED
    TCP est-tatia:1038 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:1044 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:1132 localhost:1521 ESTABLISHED
    TCP est-tatia:1137 localhost:1138 ESTABLISHED
    TCP est-tatia:1138 localhost:1137 ESTABLISHED
    TCP est-tatia:1139 localhost:1140 ESTABLISHED
    TCP est-tatia:1140 localhost:1139 ESTABLISHED
    TCP est-tatia:1385 localhost:1386 ESTABLISHED
    TCP est-tatia:1386 localhost:1385 ESTABLISHED
    TCP est-tatia:1389 localhost:23791 ESTABLISHED
    TCP est-tatia:1521 localhost:1132 ESTABLISHED
    TCP est-tatia:8080 est-tatia.ABL.local:0 LISTENING
    TCP est-tatia:23791 localhost:1389 ESTABLISHED
    TCP est-tatia:30523 est-tatia.ABL.local:0 LISTENING
    UDP est-tatia:microsoft-ds *:*
    UDP est-tatia:isakmp *:*
    UDP est-tatia:1025 *:*
    UDP est-tatia:1026 *:*
    UDP est-tatia:1151 *:*
    UDP est-tatia:4500 *:*
    UDP est-tatia:15000 *:*
    UDP est-tatia:15001 *:*
    UDP est-tatia:ntp *:*
    UDP est-tatia:netbios-ns *:*
    UDP est-tatia:netbios-dgm *:*
    UDP est-tatia:1900 *:*
    UDP est-tatia:ntp *:*
    UDP est-tatia:1027 *:*
    UDP est-tatia:1048 *:*
    UDP est-tatia:1287 *:*
    UDP est-tatia:1289 *:*
    UDP est-tatia:1900 *:*
    **************************************************************************

  • Application specific key-value pairs in jndi.properties

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

    We have a similar problem.
    We would like to configure our PROVIDER_URL for a specific web application - not
    for the entire server. Since the URL should be different in development, test
    and production environments, we would prefer to just set it in the deployment
    descriptor. And we have a lot of code that just uses
    ctx = new InitialContext();
    when looking up EJBs, queues etc.
    Actually, to take the problem one step further, it should be expected that later
    we will have EJB's deployed on different machines/clusters - so we will actually
    need specific urls for each EJB.
    Is there a good way to do this? Or will we have to custom-develop our own jndi
    configuration standard using application parameters to set which JNDI provider
    each EJB should be looked up with?
    Alternativaely, can we "import" the JNDI trees of the app server in the JNDI tree
    of the web servers?
    So, how should we go about this?
    Robert Patrick <[email protected]> wrote:
    Vasim wrote:
    Hi Robert,
    You are right. But The object "myVar" which I am trying to look upis not in
    the JNDI tree nor am I interesed in binding it . But my requirementis that
    I have one application specific variable which I am trying to lookup and I
    dont want to have a separare config file for this..and hence the question..So, put the properties you want in the jndi.properties file and load
    the properties
    file from your code by doing something like this:
    Properties props = new Properties();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl == null)
    cl = System.getSystemClassLoader();
    InputStream is = cl.getResourceAsStream("jndi.properties");
    props.load(is);
    Personally, I would not use this file and would create an application-specific
    file
    or, as Daniel suggested, define your properties as a System property
    and use
    System.getProperty("myVar").
    btw, is jndi.properties only for those objects which are bound to jnditree?
    jndi.properties is only used for creating the JNDI InitialContext. The
    whole idea
    of this file is that in remote client code (without the jndi.properties
    file), you
    need to do something like this to tell the JNDI classes how to connect
    to the JNDI
    provider:
    Properties props = new Properties();
    props.put(Context.PROVIDER_URL, "t3://myservername:7001");
    props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    InitialContext ctx = new InitialContext(props);
    but inside the server, you only need to do this because the server is
    the provider
    and already knows how to connect to itself:
    InitialContext ctx = new InitialContext();
    Therefore, the jndi.properties file allows you to externalize this property-setting
    code that sets up the properties to be passed to the InitialContext constructor
    so
    that the remote client code can now look exactly like the code inside
    the server.
    The InitialContext constructor will look for this jndi.properties file
    in your
    classpath and load it to get the necessary configuration information
    to determine
    how to connect to the JNDI provider.
    Hope this helps,
    Robert

  • Application specific key-value pair in jndi.properties

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

  • What needs to be in my jndi.properties file to get oracle accessed by a jndi client

    I am trying to write a connection pool class that use jndi
    to locate the data base. I use "bindds" bind my OracleDataSource
    object with the name of 'test/jdbc/test'. I should then be able to do a lookup like: OracleDataSource ods =
    (OracleDataSource) ctx.lookup (test/jdbc/test)
    All Oracle code examples use (Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.fscontext.RefFSContextFactory");
    Is this correct? And what other things should be in my jndi.properties file to access the naming service with comes with
    Oracle (Jserver)? For example to I need to include a Context.PROVIDER_URL value. I would think Oracle would have some
    standard way of accessing its own Naming service. Thanks David

    This implies that ODP.NET does NOT need to be installed on a client. However, I cannot find OraOPs9.dll on a machine with Client Release 9.2 installed. Should OraOps?.dll automatically come with a Client installation of 9.2 or higher?
    ODP.NET needs to be installed on the client. OraOps9.dll is part of ODP.NET, not the Oracle Client.
    Also, if an application is built with the 10g ODP.NET, can it be run from a machine with OraOps9.dll?
    If an application is built with 10g ODP.NET, it can be run with 9.2 ODP.NET as long as you do not use any 10g APIs. The new features in 10g ODP.NET are included in the doc and the ODP.NET FAQ for your reference.

  • Jndi.properties

    Hi Folks!
    First of all, please excuse my bad english ;-)
    Our problem:
    We have a Struts based web application running under OC4J 10g. We want to access our EJB's which are deployed on an other OC4J container. To do this, we have put our jndi.properties file in /WEB-INF/classes , but then we try to retrieve the initial context, the file is not loaded (this works this Tomcat etc.). The same, then we put this file into /WEB-INF/lib. After this, we monitored there the files has been searched: only at $J2EE_HOME/applib. Why??? Is there a way how we can say there to search for this file? We will pack the jndi.properties into the WAR file.
    Any suggestions?
    Thanks!

    Halil-Cem,
    Please excuse me for posting two years late, but I was searching the forum archives for "jndi.properties" and came across your post.
    You asked:
    Is there a way how we can say there to search for this file?Yes, through the "orion-web.xml" file. Mine has the following entry:
    &lt;!-- Uncomment this element to control web application class loader behavior.
        <web-app-class-loader search-local-classes-first="true"  include-war-manifest-class-path="true" />
    -->Hope it helps.
    Good Luck,
    Avi.

Maybe you are looking for