JNDI properties Encryption.

Hi All,
I am using OC4J application server 10.1.3.1.0.
my application is standalone application(thick client).
to get the lookup of remote application.
we are using jndi.properties as follows .
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://ipaddress:6005:group/application,opmn:ormi://ipaddress:6006:group/application
java.naming.security.principal=myusername
java.naming.security.credentials=password1
oracle.j2ee.rmi.loadBalance=lookup
Now i want one clarification that can i able to encrypt the username and password for security purpose because every client machine is able to see this properties.
if yes can u suggest the solutions ASAP.
thanks in advance
Mohan Reddy

try it out

Similar Messages

  • 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.

  • JNDI properties for JCAPS

    Hi I have installed the Logical Host of JCAPS .Also I can explore the different
    MBeans of it using JConsole.
    If I want to access those MBeans programmatically what would be the
    JNDI properties ?
    For examplke if I want to access JBoss 3.2.5 MBeans My sample code would be something like ....
    InitialContext ctx = null;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
    ctx = new InitialContext(env);
    So what would be my INITIAL_CONTEXT_FACTORY,PROVIDER_URL,URL_PKG_PREFIXES etc
    in this case ?
    If somebody has any idea please reply . When I was working with JBoss 3.2.5, I got all the related information from JBoss Administration Guide .
    Does JCAPS has any specific doc which can help me in this regard ?
    Regards,
    Ayan

    I use the following properties to connect to the jndi tree.
            env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
            env.put("java.naming.provider.url", "iiop://localhost:18002");But!
    I don't see any of my jcd's when I walk this tree.
    Can anyone tell me why? I'm expecting to see a list of jcds.
    When I look into the sun-ejb-jar.xml file, I see that I should be able to lookup the deployed service with the following name;
    ic.lookup("java:comp/env/ejb/local/stc/testHarness3Deployment1/deployedServices/CMap1_Collaboration_11")Are my assumptions correct, or is my jndi knowledge faulty?

  • 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

  • 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 location in EAR

    Hello,
    in a environment of Tomcat+APACHE as webserver and OC4J as a backend server, putting jndi.properties in WEB-INF/classes will do the job, BUT if we use the OHS as the webserver, I am not succeeding to let the webapp view the sessions even after puting in WEB-INF/classes or in the EAR file META-INF, unless I deploy the ear of the webapp with the sessions ear as his parent.
    My aim is to deploy the webapp without a parent, all my interfaces are in the WEB_INF/lib/xxx.jar, so I should not be needing the sessions applications.
    Note: context.getEnvironment().size() is retrieving 0 !!
    Thanks

    Generally speaking, jndi.properties should be placed in the root of the classpath. In your case: WEB-INF/classes.
    In orion-web.xml include
    <web-app-class-loader search-local-classes-first="true"
    include-war-manifest-class-path="false" />
    Two possible workarounds are:
    - Create a JAR with just the jndi.properties. Add it to your WEB-INF/lib.
    - Last resort: Put it in $OC4J_HOME/j2ee/home/applib

  • 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

  • External JNDI Client, jndi.properties/connection

    How can I lookup up a object
    jms/ConnectionFactory, which I've confirmed is in this namespace with a external java program client.
    I have the Client jars in the class path. It connects, tries to lookup jms/ConnectionFactory.
    But I get
    javax.naming.NameNotFoundException. 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:72)
         at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
         at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    jndi.properties are:
    java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
    java.naming.provider.url=iiop://localhost:3700
    java.naming.factory.url.pkgs=com.sun.enterprise.naming
    If I connect from a web-app, I can lookup the object via java:comp/env/jms/ConnectionFactory

    one way is to not use the java:comp/env context and use the <jndi-name> listed in
    a sun-[ejb/web].jar.
    example of ejb lookup from rich standalone client.
    Properties env = new Properties();
    //Sun App server 7 specific
         env.put("java.naming.factory.initial",
              "com.sun.jndi.cosnaming.CNCtxFactory");
         env.put("java.naming.provider.url", "iiop://localhost:3700");
    System.out.println("ENV stuff done");
         Context initial = new InitialContext(env);
    System.out.println("new initial env done");
         Object objref = initial.lookup("ConfigManager"); <---- this is the actual
    jndi name in sun-ejb-jar.xml.
    <ejb>
    <ejb-name>ConfigManager</ejb-name>
    <jndi-name>ConfigManager</jndi-name>
    a datasource resource would be
    <resource-ref>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
         <jndi-name>jdbc/OracleDS</jndi-name>
    so Object objref = initial.lookup("jdbc/OracleDS"); would work for a datasource.

  • JNDI properties not hard coded

    I'd like to sustain the portability of my web application so I don't want to hard code JNDI factory driver or provider URL into my application not even inside jndi.properties file. What are the solutions for not hard coding this information inside web application? Context init properties?

    That was my first approach and that's the solution if I need these parameters inside e.g. Servlet. But now I have one JavaBean functioning as ConnectionFactory that shares connection with all other Servlets and JSP-s but problem is that I don't know how to access the ServletContext of my application (for reading init parameters) from JavaBean (I don't want each time I need to use connection to send the same parameters). So, question is how to access the application init parameters from JavaBean?

  • Jndi properties for sasl, external mechanism

    We're having trouble connecting to an LDAP server over SSL. We have created the client/trust keystores, but do not know what the jndi properties should be. We want the authentication to come from the certificate not simple name/password. Do we leave principals, credentials and authorizationId with null values?

    If this to perform external authentication against Active Directory, have a look at the post titled "JNDI, Active Directory & Authentication (part 4) (SASL EXTERNAL)" available at
    http://forum.java.sun.com/thread.jspa?threadID=641047&tstart=0
    Good luck.

Maybe you are looking for

  • An error occurred querying a data source - with REST services

    Hi, I have a SharePoint 2013 form library library with an info-path form. I need to get the logged in user's 'Display Name' on my form load automatically. I used REST service to fetch the current user details. In the preview mode of the form, its sho

  • Webservice development  method

    Hi,          I want to develop a webservice in webdynpro for consuming BAPI(BAPI_MATERIAL_AVAILABILITY). Can someone provide me the related document to reach this requirement? Thanks, Kundan

  • Compressor/FCP quits unexpectedly possibly due to ProMedia plug-in

    Hi all I am sending a finished project to Compressor from FCP, without rendering first. Much of the project is comprised of embedded Motion files. I keep getting a "quit unexpectedly possibly due to the ProMedia plug-in" alert. After repairing the HD

  • Populate drop down in a selection screen

    Hi All, I have created a selection screen where i have a drop down field .How do i populate the drop down? In the backend i have a table type in the export param. which contains all the drop downs values. Please help. Thanks tubai.

  • Audition CC crashes with Multiband Compressor

    The company I work for just upgraded from CS6 to CC. I'm working on a 30 minute TV show, and my normal workflow for dialog editing includes using multiband compressor on almost every track. It works fine for the first track I apply it too, but Auditi