JNDI lookup/properties

Hi
Is there anobody that has got this figured out totally. From all the question on Sun and Oracles forums it seemst that the Lookup with JNDI is a massive problem for everybody.
Is there some utility written by someone that can actually be run agains OC4J to tell you what is available in the JNDI lookup tree? This will make it a lot easier to find answers to all these questions.
I 'm now trying to get the MDB environment going but can't get the JSP from the messagelogger example to look up the queue. NameNotFound exception. a Utility that will tel you what is available and what not will make a stunning tool. Now I havent got any idea if the problem is in hte OC4J setup or the JSP.
Tks
Andre

Hi
Is there anobody that has got this figured out totally. From all the question on Sun and Oracles forums it seemst that the Lookup with JNDI is a massive problem for everybody.
Is there some utility written by someone that can actually be run agains OC4J to tell you what is available in the JNDI lookup tree? This will make it a lot easier to find answers to all these questions.
I 'm now trying to get the MDB environment going but can't get the JSP from the messagelogger example to look up the queue. NameNotFound exception. a Utility that will tel you what is available and what not will make a stunning tool. Now I havent got any idea if the problem is in hte OC4J setup or the JSP.
Tks
Andre

Similar Messages

  • JNDI lookup issue in weblogic 10 server

    Hi all,
    I have a serious problem in getting the datasource lookup. My application uses EJB3 and JPA and it is deployed in weblogic10. I configured datasource in the domain (ex:mydomain) using weblogic 10 admin console. Now when i try to call from a client program, it is giving me javax.naming.NameNotFoundException. I use eclipse IDE to deploy the application. From the IDE, i can start the oracle 10.3 server and it automatically deploys the application into the server in mydomain. The admin console shows that the application deployed fine. And i can see the webcontent WAR file and EJB jar deployed. Coming back to the issue.... I verified user_projects\domains\mydomain\config\jdbc\datasource-jdbc.xml and user_projects\domains\mydomain\config\config.xml file enteries. My entries are present in those files.
    When i start the server i am getting below error...
    << Stacktrace >>
    javax.naming.NameNotFoundException: While trying to look up jdbc in /app.; remaining name 'jdbc'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
         at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
         at weblogic.deployment.PersistenceUnitInfoImpl.lookUpAppScopedDataSource(PersistenceUnitInfoImpl.java:529)
         at weblogic.deployment.PersistenceUnitInfoImpl.reconfig(PersistenceUnitInfoImpl.java:549)
         at weblogic.ejb.container.deployer.EJBModule.reconfigPersistenceUnits(EJBModule.java:529)
         at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:515)
         at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    << Client program snippet >>
    Hashtable ht = new Hashtable();
                   ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   ht.put(Context.PROVIDER_URL, "t3://10.237.76.132:7001");
                   InitialContext ctx = null;
                   ctx = new InitialContext(ht);
                   Object obj = (Object)ctx.lookup(EmployeeBean.RemoteJNDIName);
                   EmployeeRemote empRemote = (EmployeeRemote)PortableRemoteObject.narrow(obj,com.acs.test.emp.EmployeeRemote.class);
                   List empList = empRemote.getEmployeeDetails(1);
                   System.out.println("SUCCESS"+empList.size());
    << Persistence.xml >>
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Persistence deployment descriptor for dev profile -->
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="cmsepool">
    <jta-data-source>java:/mydatasource</jta-data-source>
              <class>com.acs.test.emp.EmployeeVO</class>
              <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
              <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
    </properties>
    </persistence-unit>
    </persistence>

    Make sure that this Datasource you created is Targetted to Admin Server and full Cluster (incase of cluster domain). From Admin Console, select your datasource and check for the Targets tab. Since its JNDI lookup error, most probably it may not be deployed properly.
    HTH
    Ravi Jegga

  • Problem in JNDI lookup.

    Hi,
    I have a JSP running on tomcat. And it accesses an EJB running on weblogic thru a local bean. When the following JNDI lookup code is executed, I get errors. Errors follow the code. Please Help.
    Thanks!
    public InitialContext getInitialContext() throws NamingException
    // Utils.Trace("****** in getInitialContext ******");
    // web logic server and jsp engine NOT weblogic
    if (url != null && url.length() > 0)
    //Hashtable env = new Hashtable();
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    // assumes that JSP and EJB container are on the same box,
    // otherwise EJB hostname should be specified
    //env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    env.put(Context.PROVIDER_URL, url);
    System.out.println("Using t3 services");
    return new InitialContext(env);
    // weblogic server and weblogic jsp, or inprise server (JBuilder's default JSP)
    else
    System.out.println("Not Using t3 services");
    return new InitialContext();
    The ERRORS are
    =====================================================================
    org.apache.jasper.JasperException: weblogic/common/T3Services
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:479)
    root cause
    javax.servlet.ServletException: weblogic/common/T3Services
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)
         at org.apache.jsp.login_jsp._jspService(login_jsp.java:276)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:479)

    Your JSP trying to load the weblogic context factory to perform the lookup, but can't find it. Your servlet engine must have access to the weblogic.jndi.WLInitialContextFactory class (in weblogic.jar).

  • Problem in Jndi lookup for  ITaskService

    HI,
    I am trying to initiate oracle bpm Human task programatically by using Java remotely.
    for this I am using following JNDI lookup for ITaskService.
    Hashtable ht = new
                  Hashtable<IWorkflowServiceClientConstants.CONNECTION_PROPERTY,java.lang.String>();
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY, 
                     "weblogic.jndi.WLInitialContextFactory");
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:7001");
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "username"); 
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "password");
              Context ctx  = new InitialContext(ht);
    ITaskService taskService = (ITaskQueryService)ctx.lookup("ejb/bpel/services/workflow/TaskServiceBean");
    taskService.initiateTask(task);
    It the right approach or not.
    Please help.

    To access human workflow api remotely try using the following code :
    Map properties = new HashMap();
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:8001");
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "welcome1");
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "weblogic");
    IWorkflowServiceClient wfSvcClient =
      WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT, properties, null);
      //Get the task query service
      ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();
      //Login as weblogic
      IWorkflowContext ctx = querySvc.authenticate("weblogic","welcome1".toCharArray(),null);
    after getting the workflow context, you can call any method like query task list. perform actions etc. just see the api doc.
    Regards,
    Anshul

  • Anyone knows how to do JNDI lookup with OracleAQ?

    Hi all;
    Can anybody point me some guide/idea on how to implement JNDI lookup with OracleAQ?
    (Creating connectionFacotry , parameters for "java.naming.factory.initial", java.naming.provider.url etc..)
    Thanks
    -Ratha
    Edited by: Ratha on Sep 27, 2011 3:50 AM

    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Properties;
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, PROVIDER_URL);
    env.put(Context.SECURITY_PRINCIPAL, JNDI_USER);
    env.put(Context.SECURITY_CREDENTIALS, JNDI_PWD);
    InitialContext = new InitialDirContext(env);
    where JNDI_USER is the userid If ACL is configured at the JNDI server
    where JNDI_PWD is the password If ACL is configured at the JNDI server
    Context.INITIAL_CONTEXT_FACTORY is the initial Context factory and depends on ur JNDI service provider.
    PROVIDER_URL is the url of the JNDI server containing protocol/ip/port
    Hope it helps
    -aseem

  • JMS Wrappers can't cache JNDI lookups when using secured queues

    Hi All!
    We are working on a jms client, inside a webapp(servlets), using Weblogic 9.2 and Weblogic 10.3.
    As we want to use secured queues and keep being efficient we tryed to use Weblogic JMS Wrappers, that should work according to the docs:
    Enhanced Support for Using WebLogic JMS with EJBs and Servlets
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/j2ee.html
    But we are facing a problem:
    When we define a JMS Wrapper and try to cache JNDI lookups for the QueueConnectionFactory and Queue, as the docs recommend for efficiency, the connection to the queue is ignoring the user/pwd.
    The JMS Wrapper is using <res-auth>Application</res-auth>.
    We are creating the connection using createQueueConnection(user, pwd) from QueueConnectionFactory and after several tests it seems that the user and password are ingored unless a jndi lookup is made in the same thread, as if when there are not any thread credentials present user and password are ignored for the connection...
    so the question is:
    That behaviour goes against Weblogic JMS Wrapper documentation, doesn't it?
    Is there then any other way to access efficiently secured queues using a servlet as a client? (iit's not an option for us to use mdbs, or ejbs).
    If it helps, this seems related to this still opened spring-weblogic issue: SPR-2941 --> http://jira.springframework.org/browse/SPR-2941 and SPR-4720 --> http://jira.springframework.org/browse/SPR-4720
    Thanxs
    And here goes our DDs and code to reproduce:
    First in pretty format:
    web.xml --> http://pastebin.com/f5f85e8d4
    weblogic.xml --> http://pastebin.com/f2fbe10cc
    Client code --> http://pastebin.com/f586d32d9
    And now emmebded in the msg:
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app
      xmlns="http://www.bea.com/ns/weblogic/90"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
      http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
        <description>WebLogic Descriptor</description>
        <resource-description>
            <res-ref-name>jms/QCF</res-ref-name>
            <jndi-name>weblogic.jms.ConnectionFactory</jndi-name>
        </resource-description>
    </weblogic-web-app>weblogic.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 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">
          <display-name> QCFWrapperCredentialsTest </display-name>
          <description> QCFWrapperCredentialsTest  </description>
          <servlet id="Servlet_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <servlet-class>QCFWrapperCredentialsTest</servlet-class>
             <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping id="ServletMapping_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <url-pattern>/Test</url-pattern>
          </servlet-mapping>
         <resource-ref>
            <res-ref-name>jms/QCF</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>And our test client:
    import java.io.*;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.servlet.http.*;
    public class QCFWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
    }Edited by: user2525402 on Feb 9, 2010 7:14 PM

    Thanks Tom,
    Quite a useful response .-)
    Leaving aside the fact that weblogic behaviour with jms wrappers and secured queues seems to not be working as the docs says...
    Talking about workarounds:
    Both workarounds you suggest works, but as you already noted, creating a new JNDI context just to inject credentials into the threads is overkill when high performance is needed.
    I also found more information about the same issue here: http://sleeplessinslc.blogspot.com/2009/04/weblogic-jms-standalone-multi-threaded.html
    And he suggest the same workaround, injecting credentials
    So I tried the second approach, successfully, injecting credentials into the thread using the security API.
    This way, using JMS wrappers and injecting credentials into the thread we get the best performance available, caching resource using wrappers and using credentials in a somewhat efficient way.
    Now the test snippet looks like this:
    import java.io.*;
    import java.security.PrivilegedAction;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.security.auth.Subject;
    import javax.security.auth.login.LoginException;
    import javax.servlet.http.*;
    import weblogic.jndi.Environment;
    import weblogic.security.auth.Authenticate;
    public class JMSWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            final HttpServletRequest fReq=req;
            final HttpServletResponse fRes=res;
            PrivilegedAction action = new java.security.PrivilegedAction() {
                public java.lang.Object run() {
                    performRequest(fReq,fRes);
                    return null;
            try {
                Subject subject=createSingleSubject(serverT3URL,user,pwd);
                weblogic.security.Security.runAs(subject, action);
            } catch (Exception e) {
                e.printStackTrace();
        public void performRequest(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
        private Subject createSingleSubject(String providerUrl, String userName, String password) {
            Subject subject = new Subject();
            // Weblogic env class
            Environment env = new Environment();
            if(providerUrl!=null)
                env.setProviderUrl(providerUrl);
            env.setSecurityPrincipal(userName);
            env.setSecurityCredentials(password);
            try {
              // Weblogic Authenticate class will populate and Seal the subject
              Authenticate.authenticate(env, subject);
              return subject;
            catch (LoginException e) {
              throw new RuntimeException("Unable to Authenticate User", e);
            catch (Exception e) {
              throw new RuntimeException("Error authenticating user", e);
    }Thanks a lot for the help

  • JNDI lookup() for a Resource Adapter fails

    Hi guys,
    I've deployed a Resource Adapter on Weblogic (v10.3.4). It's JNDI name is: jca/HelloAdapter
    Moreover, in the Outbound Connection Pools tag, I've created a javax.resource.cci.ConnectionFactory entry with JNDI name: eis/HelloAdapter.
    I want to write a simple Java test to lookup my Resource adapter. The code I am using is the following:
          Hashtable<String, String> properties = new Hashtable<String, String>();
          properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
          properties.put(Context.PROVIDER_URL, "t3://localhost:8001");
          properties.put(Context.SECURITY_PRINCIPAL, "weblogic");
          properties.put(Context.SECURITY_CREDENTIALS, "weblogic1");
          Context ctx = null;
          try {
              ctx = new InitialContext(properties);
              javax.resource.cci.ConnectionFactory cf =
                (javax.resource.cci.ConnectionFactory) ctx.lookup("jca/HelloAdapter");
          } catch (NamingException e) {
              e.printStackTrace();
          }I get the following exception:
    javax.naming.NameNotFoundException: No Object found:  jca/HelloAdapter|null
         at weblogic.connector.deploy.JNDIHandler.lookupObject(JNDIHandler.java:881)
         at weblogic.connector.deploy.JNDIHandler.getObjectInstance(JNDIHandler.java:843)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:424)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)Any ideas please ? Thank you for your time
    Regards,
    George

    Sorry guys,
    I suppose my thread subject is out of the scope of the specific list.
    Sorry for the inconvenience

  • JNDI lookup in xml file

    I want to use JNDi lookup for DB. Where should i specify them. Rigtnow i have given the hibernate connections in persistance xml file with user name pwd etc. But i dont want to do this. I want to use JNDI lookup and configure my weblogic for the JNDI. What are the changes I need to make in the application context and persistance xml files. Pls help?
    my persistance .xml file looks like this,
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    version="1.0"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="jpaPersistance" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.ggg.jp.model.bo.individual</class>
    <exclude-unlisted-classes/>
    <properties>
    <property name="hibernate.archive.autodetection" value="class, hbm"/>
    <property name="hibernate.show_sql" value="true"/>
    <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="hibernate.connection.password" value="test"/>
    <property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
    <property name="hibernate.connection.username" value="test"/>
    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
    </properties>
    </persistence-unit>
    </persistence>
    Application context looks like this,
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    <!-- <bean/> definitions here -->
    <context:annotation-config/>
    <bean id="demoDataServiceImpl" class="com.gg.jp.model.services.impl.DemoDataServiceImpl" />
    <bean id="recordGeneratorWebServiceHandler" class="com.gg.jp.webservice.RecordGeneratorWebServiceHandler">
    <property name="service" ref="demoDataServiceImpl"/>
    </bean>
    <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="persistenceUnitName" value="jpaPersistance"/>
    </bean>
         <tx:annotation-driven/>
         <bean id="transactionManager"
         class="org.springframework.orm.jpa.JpaTransactionManager" >
         <property name="entityManagerFactory" ref="entityManagerFactory"/>
         </bean>
         </beans>

    Me again!
    So I found that I can't do jndi lookup (NamingException) for the datasource as mentioned, in the init method.
    However, the very same jndi lookup was successful in the overridden authenticate method, called by oc4j when trying to authenticate the user.
    Go figure!
    TIA,
    - nik.

  • How to create InitialContext for JNDI lookup in a cluster?

              I am new to clusters in WL7 and I wanted to know how a client would create an InitialContext
              object to perform a JNDI lookup for a remote object deployed across serveral servers
              in the cluster. Is the following correct?
              Physcial Servers in the cluster
              machine1:9001
              machine2:9001
              machine3:9001
              Code for creating InitialContext
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, "machine1:9001,machine2:9001,machine3:9001");
              Context c = new InitialContext( p);
              Thanks,
              Raffi
              

    Hi Ivaylo,
    There's another alternative solution to your problem. You can have the screen 120 as a user-defined selection screen. i.e., instead of creating this screen through the screen painter, you can create it from within your ABAP Program. This way, you can directly use the SELECT-OPTIONS statement within your screen. You then will no longer have to bother about how to handle the data for the field.
    Especially in the case where your screen 120 has few elements, this approach, in my opinion, will be the best.
    Please let me know if you need any further clarifications on how to go about it if you choose to follow this approach.
    Regards,
    Anand Mandalika.

  • JNDI lookup from Tomcat to EJB Container

    Hello!
    i am currently trying to use a combination of Catalina and an external EJB Server (running on another machine).
    i am really struggeling with doing the jndi lookup. i have no idea where and how to set the properties in the web server and do the mapping from the ejb-refs to the jndi name? (since tomcat doesnt seem to have a deploymentplan?!)
    maybe someone here knows the problem and can help, please?
    (i am not sure but this might also be the wrong discussion group for that??)
    thanks
    wolfgang

    Hello Wolfgang,
    I solved this problem by setting the proper jndi properties in the startup phase (MyInitServlet) by System.setProperty(...).
    This seems ugly, but it works.
    Tilo

  • Stand-alone JNDI lookup of an EJB in an Enterprise Application (EAR) build

    Hi All,
    I am having some difficulty doing JNDI look up an EJB 3.0 Bean that is part of an Enterprise Application (EAR) build. Below are all the related codes:
    package ejb;
    import javax.ejb.Local;
    @Local
    public interface Hello1Local {
        public String getHello1();
    package ejb;
    import javax.ejb.Stateless;
    @Stateless
    public class Hello1Bean implements Hello1Local {
        public String getHello1() {
            return "I am Hello1 Bean!";
    package ejb;
    import javax.ejb.Remote;
    @Remote
    public interface Hello2Remote {
        public String getHello2();
    package ejb;
    import javax.ejb.Stateless;
    import javax.ejb.EJB;
    @Stateless
    @EJB(name="ejb/Hello1",
         beanInterface=Hello1Local.class,
         beanName="Hello1Bean")
    public class Hello2Bean implements Hello2Remote {
        @EJB private Hello1Local hello1bean;
        public String getHello2() {
            return hello1bean.getHello1();
    There is no problem looking up Hello2 Bean using an Application Client such as the following:
    public class LocalHelloApplicationClient {
        @EJB(name="Hello2")
        private static Hello2Remote hello2Bean;
        public static void main(String[] args) {
            System.out.println("hello2Bean.getHello2(): " + hello2Bean.getHello2());
    }There is also no problem doing JNDI lookup (from a Stand-Alone Client the same bean if both Hello1 and Hello2 were created by themselves. ie not part of an Enterprise Application (EAR) build. However, I am wondering whether it is possible to do JNDI lookup of the same bean (Hello2) that is part of an Enterprise Application (EAR) built. Below are the type of JNDI lookup entries that I have tried without success:
    public class StandalonePojoCallHelloWorld {
        public static void main(String [] args)
            try
                InitialContext jndiContext = new InitialContext();
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("ejb.Hello2Remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.Hello2.remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.ejb.Hello2Remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.Hello2Remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.LocalHelloEnterpriseApplication-ejb.Hello2Remote");
                System.out.println("hello2Bean.getHello2(): " + hello2Bean.getHello2());
            catch (javax.naming.NamingException ne)
             ne.printStackTrace();
    They all came up with the same error message:
    javax.naming.NameNotFoundException: LocalHelloEnterpriseApplication.LocalHelloEnterpriseApplication-ejb.Hello2Remote not found
            at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
            at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
            at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
            at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:129)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)Any suggestion would be appreciated.
    Thanks,
    Jack

    Hello
    I've somme problems to get access to ejb interface from remote stand-alone client.
    Here is my EJB code :
    package stateless;
    import javax.ejb.Stateless;
    @Stateless(name = "TestSB", mappedName = "ejb/stateless/TestSB")
    public class TestEJBBean implements TestEJBRemote {
        public String getMessage() {
           return "Hello EJB World";
    }And the remote interface :
    package stateless;
    import javax.ejb.Remote;
    @Remote
    public interface TestEJBRemote {
        String getMessage();
    } In client side, i just edit main.java like this :
    package testclient;
    import java.io.FileInputStream;
    import java.util.Properties;
    import javax.naming.InitialContext;
    import stateless.TestEJBRemote;
    public class Main {
        public static void main(String[] args) throws Exception {
            Properties props = new Properties();
            props.load(new FileInputStream("jndi.properties"));
            InitialContext ctx = new InitialContext(props);
            TestEJBRemote testEJB = (TestEJBRemote) ctx.lookup("ejb/stateless/TestSB");
            System.out.println(testEJB.getMessage());
    }here is my jndi.properties file (my glassfish server IP is 192.168.0.10) :
    java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
    java.naming.factory.url.pkgs = com.sun.enterprise.naming
    java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
    org.omg.CORBA.ORBInitialHost = 192.168.0.10
    org.omg.CORBA.ORBInitialPort = 3918when i run client on the same machine than the glassfish app server, it works fine.
    But i run it on the different machine than the glassfish app server (on the same LAN without firewall), it fails with this error message :
    eclan@eclan-laptop:~/NetBeansProjects/TestClient$ java -jar dist/TestClient.jar
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 3918"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4038"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4138"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 3918"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4038"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4138"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    eclan@eclan-laptop:~/NetBeansProjects/TestClient$ THANKS YOU FOR YOUR HELP
    Justin

  • Env-entry-mapping in orion-application-client not available in JNDI lookup

    I have an application client module in my EAR file that I've configured to auto-start.
    It has a few env-entry defined in it's application-client.xml.
    When I deploy the EAR file to OC4J 10.1.3, the application client module gets started and can access these env-entry properties from its JNDIContext.
    Now, comes the problem. During the deployment process, I edit the Deployment Plan, and change the env-entry property values, and then deploy the application.
    However, the application client module still gets the original values when it does the JNDI lookups of those env-entry names.
    I have checked to see that OC4J creates an orion-application-client.xml during deployment and it shows the env-entry-mapping elements with the updated values.
    Why is the JNDI lookup returning the values from application-client.xml and not the overriden values set in orion-application-client.xml?
    I have tried this on OC4J 10.1.3, as well as 10.1.3.1.0 - got same behavior.
    Is this a bug in OC4J? This seems to work fine with ejb modules, but not application client modules.
    Thanks,
    Kalpak

    Avi!
    Of course, I had tried it before I wrote the question. I put the modified xml file into the application area. After that AS restarts OC4J instance. And then I find my xml without any changes I made! I tried to do the same thing from the AS console. The same!
    Leonid

  • Doing a jndi lookup() for an EJB deployed on Glassfish v3

    Hello.
    I have deployed a Stateful Sesion EJB on a Glassfish v3 AppServer.
    It is running under 'localhost' on my laptop pc.
    I am also running a stand-alone java application on the same pc... it attempts to get a remote connection from the client-app to the Glassfish Server and then do a jndi lookup() to get a reference to my EJB.
    here is the client source code:
    public class LookupTest {
    static Properties props = null;
    public static void main(String[] args) {
    try {
    props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
         props.put(Context.PROVIDER_URL, "iiop://localhost:3700");
         Context ctx = new InitialContext(props);
         System.out.println( "the context is: " + ctx);
         System.out.println( "the environment contains: " + ctx.getEnvironment() );
         System.out.println( " ");
         // do a lookup.
         Object elementObj = ctx.lookup("SerialContextProvider");
         System.out.println(elementObj);
    } catch (NamingException e) {
    e.printStackTrace();
    When I run this app, there are no Errors or Exceptions. It appears that the connection succeeds. But there are no EJB references in the context that is created. The only item that seems to be present in the context is an item named "SerialContextProvider", as noted in the return value from a list("") method invocation. Why can i not see the EJB within the context? Is my code wrong ??
    Thanks,
    Andy Jerpe
    Edited by: user1169567 on Nov 28, 2010 12:12 PM

    Ok, but the communication seems to be OK over the wire because if I use netstat -a I can see the ESTABLISHED connection with the server in the right RMI port.
    TCP PORTAL35:1581 caapiranga:12405 ESTABLISHED
    and then when I stop the instance in the OAS, the client shows an exception telling that the connection was lost.
    An curious thing is that the ons.log doesn't log this connection ;/

  • JNDI lookup name in a standalone oc4j instance

    Hi,
    Could you please let me know how to create a JNDI lookup name for a database in a stanalone OC4j Instance?
    Both OC4J and oracle 9i database are in the same server.
    Thanks in advance,
    Sukonya

    Hi,
    I have the oracle 9i database as well as the oc4j instance in my local machine.I am trying to deploy a J2ee Application on the OC4j instance,using eclipse IDE.I have not created any connection pool or datasource in the oc4j instance but after i build the application I see that the connection pool and datasource instance have been created in the OC4j instance.
    following are the contents of the build.xml file(for the ant build tool)
    <?xml version="1.0" encoding="UTF-8" ?>
    - <project name="TicketLoggingSystem" default="bind-web-app" basedir="../">
    <property name="app.server" value="D:/oc4j/j2ee/home" />
    <property name="dest.dir" value="${basedir}/dest" />
    <property name="war.file" value="${dest.dir}/TicketLoggingSystem.war" />
    <property name="ear.file" value="${dest.dir}/TicketLoggingSystem.ear" />
    <property name="web.inf" value="${basedir}/WEB-INF" />
    <property name="web.classes" value="${dest.dir}/classes" />
    <property name="app.xml" value="${basedir}/application.xml" />
    <property name="src.dir" value="${basedir}/src" />
    <property name="oc4j.host" value="localhost" />
    <property name="oc4j.admin.port" value="23791" />
    <property name="oracle.home" value="D:/oc4j" />
    <property name="j2ee.home" value="${oracle.home}/j2ee/home" />
    <property name="oc4j.admin.username" value="oc4jadmin" />
    <property name="oc4j.admin.password" value="welcome" />
    <property name="oc4j.ormi" value="ormi://${oc4j.host}:${oc4j.admin.port}" />
    <property name="app.name" value="TicketLoggingSystem" />
    <property name="jdbc.url" value="jdbc:oracle:thin:@localhost:1521:80" />
    <property name="jdbc.username" value="scott" />
    <property name="jdbc.password" value="tiger" />
    <property name="connection.driver" value="oracle.jdbc.driver.OracleDriver" />
    <property name="connection.datasource" value="oracle.jdbc.pool.OracleDataSource" />
    <property name="xa.location" value="jdbc/xa/MpsiDS" />
    - <!-- Delete dest folder
    -->
    - <target name="init">
    <delete dir="${dest.dir}" includeemptydirs="true" />
    <mkdir dir="${dest.dir}" />
    <mkdir dir="${web.classes}" />
    </target>
    - <!-- Compile all Java files
    -->
    - <target name="wscompile">
    - <javac srcdir="${src.dir}" destdir="${web.classes}" deprecation="on" debug="on">
    <exclude name="**/*.properties,**/*.xml" />
    - <classpath>
    <fileset dir="${web.inf}/lib" includes="*.jar" />
    <fileset dir="${app.server}/lib" includes="servlet.jar" />
    </classpath>
    </javac>
    </target>
    - <!-- Build Web archive file
    -->
    - <target name="buildWar" depends="init,wscompile">
    - <war destfile="${war.file}" webxml="${web.inf}/web.xml">
    - <fileset dir="${basedir}">
    <include name="content*/**" />
    </fileset>
    <webinf dir="${web.inf}" includes="*.xml,*.tld" excludes="web.xml" />
    <classes dir="${web.inf}/classes" />
    <lib dir="${web.inf}/lib" includes="*.jar" />
    </war>
    </target>
    - <!-- Build Enterprsie Archive
    -->
    - <target name="buildEar" depends="buildWar">
    - <ear destfile="${ear.file}" appxml="${app.xml}">
    <fileset dir="${dest.dir}" includes="*.war" />
    </ear>
    </target>
    - <!-- Checking availability of oc4j
    -->
    - <target name="check-oc4j-available">
    <echo message="------> Checking to see if OC4J is started ." />
    <echo message="[checking oc4j on machine =${oc4j.host}]" />
    <echo message="[port=${oc4j.admin.port}]" />
    - <condition property="oc4j.started">
    <socket server="${oc4j.host}" port="${oc4j.admin.port}" />
    </condition>
    </target>
    - <!-- Remove data source
    -->
    - <target name="remove-data-source" depends="check-oc4j-available" if="oc4j.started">
    <echo message="Removing DataSource" />
    - <java jar="${j2ee.home}/admin.jar" fork="true">
    <arg value="${oc4j.ormi}" />
    <arg value="${oc4j.admin.username}" />
    <arg value="${oc4j.admin.password}" />
    <arg value="-application" />
    <arg value="${app.name}" />
    <arg value="-removeDataSource" />
    <arg value="-location" />
    <arg value="jdbc/TicketLoggingSystem" />
    </java>
    <echo message="Removed DataSource Successfully" />
    </target>
    - <!-- Undeploy
    -->
    - <target name="undeploy" depends="remove-data-source" description="Undeploying the application" if="oc4j.started">
    <echo message="Undeploying the Application ${app.name}" />
    - <java jar="${j2ee.home}/admin.jar" fork="true">
    <arg value="${oc4j.ormi}" />
    <arg value="${oc4j.admin.username}" />
    <arg value="${oc4j.admin.password}" />
    <arg value="-undeploy" />
    <arg value="${app.name}" />
    </java>
    <echo message="Undeploying the Application ${app.name} is Successful" />
    </target>
    - <!-- Deploy
    -->
    - <target name="deploy" depends="undeploy,buildEar" if="oc4j.started">
    <echo message="Deploying the Application ${app.name}" />
    - <java jar="${j2ee.home}/admin.jar" fork="true">
    <arg value="${oc4j.ormi}" />
    <arg value="${oc4j.admin.username}" />
    <arg value="${oc4j.admin.password}" />
    <arg value="-deploy" />
    <arg value="-file" />
    <arg value="${ear.file}" />
    <arg value="-deploymentName" />
    <arg value="${app.name}" />
    </java>
    <echo message="Deploying the Application ${app.name} is Successful" />
    </target>
    - <!-- Create data source
    -->
    - <target name="create-data-source" depends="check-oc4j-available" if="oc4j.started">
    <echo message="Creating DataSource for Application ${app.name}" />
    - <java jar="${j2ee.home}/admin.jar" fork="true">
    <arg value="${oc4j.ormi}" />
    <arg value="${oc4j.admin.username}" />
    <arg value="${oc4j.admin.password}" />
    <arg value="-application" />
    <arg value="${app.name}" />
    <arg value="-installDataSource" />
    <arg value="-jar" />
    <arg value="${oracle.home}/jdbc/lib/ojdbc14dms.jar" />
    <arg value="-url" />
    <arg value="${jdbc.url}" />
    <arg value="-connectionDriver" />
    <arg value="${connection.driver}" />
    <arg value="-location" />
    <arg value="jdbc/TicketLoggingSystem" />
    <arg value="-username" />
    <arg value="${jdbc.username}" />
    <arg value="-password" />
    <arg value="${jdbc.password}" />
    <arg value="-className" />
    <arg value="${connection.datasource}" />
    </java>
    <echo message="Created DataSource Successfully for Application ${app.name}" />
    </target>
    - <!-- Binding web-app
    -->
    - <target name="bind-web-app" depends="deploy,create-data-source" if="oc4j.started">
    <echo message="executing bind web app" />
    - <java jar="${j2ee.home}/admin.jar" fork="true">
    <arg value="${oc4j.ormi}" />
    <arg value="${oc4j.admin.username}" />
    <arg value="${oc4j.admin.password}" />
    <arg value="-bindWebApp" />
    <arg value="${app.name}" />
    - <!-- app deployname
    -->
    <arg value="${app.name}" />
    - <!-- web module name
    -->
    <arg value="default-web-site" />
    - <!-- web site name
    -->
    <arg value="/${app.name}" />
    - <!-- context root
    -->
    </java>
    <echo message="Access the application using: http://${oc4j.host}:8888/${app.name}" />
    </target>
    </project>
    Following are the contents of Oc4J home->services->jdbc resources:
    Datasource:
    Name jdbc/TicketLoggingSystem
    Application TicketLoggingSystem
    JNDI Location jdbc/TicketLoggingSystem
    Connection Pool
    Managed by OC4j
    Test
    when i click the datasource name,I see that its type is Native datasource with no related connection pool.
    Whereas for the default datasource oracleDS,
    Type     Managed Data Source
    Connection Pool     Example Connection Pool
    However on deployment a connection pool is also created along with the datasource
    Name jdbc/TicketLoggingSystem_connectionPool
    Application TicketLoggingSystem
    ConnectionFactory class : oracle.jdbc.pool.OracleDataSource
    Do we need to bind this connection pool to our datasource?If yes how is it done.And if that is not required,why is this connection pool created?Are the datasource and connection pool already bound to each other?
    Also when I test either the datasource or connection pool,it says
    Confirmation     
    Connection to "jdbc/TicketLoggingSystem_connectionPool" established successfully
    or
    Connection to "jdbc/TicketLoggingSystem" established successfully.
    and displays both the connection pool and datasource details together for both the tests.
    In my java code,while trying to establish connection to the database what should I mention in lookup i.e,
    InitialContext context = new InitialContext();
    DataSource dataSource = (DataSource) context.lookup("     jdbc/TicketLoggingSystem or      jdbc/TicketLoggingSystem_connectionPool");
    con = dataSource.getConnection();
    Sorry if I am sounding novice.Thanks a lot in advance,
    Sukanya

  • JNDI lookup fails - No such domain/application

    Hi,
    I tried to perform a JNDI lookup from a stand alone Java client towards Oracle 9iAS version 9.0.3 and failed with the following error:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: No such domain/application: mindejb; nested exception is:
         javax.naming.AuthenticationException: No such domain/application: mindejb
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:345
         void Samplecom.mind.ejb.stubs.AccountComplexStubClient.main(java.lang.String[])
              AccountComplexStubClient.java:21
    Below, are the JNDI settings I am using. The application by the name mindejb was deployed and is accessible using server side JSP or servlets. When I use a stand alone OC4J, the same settings (different port) work fine!
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=ormi://localhost:3101/mindejb
    java.naming.security.principal=admin
    java.naming.security.credentials=admin
    Thanks,
    Avi

    When you are running within an Oracle Application Server managed OC4J environment, then you should use the OPMN protocol loader we have that will insulate you from the specified ORMI port being used by OC4J.
    The OPMN port is fixed so you can always rely on it, whereas the specific ORMI port used by an OC4J instance changes depending on the startup sequence, the number of procs configured, etc.
    Here's a piece from the EJB documentation
    http://download-west.oracle.com/docs/cd/B14099_19/web.1012/b15505/access.htm#i1019709
    Location
    All ports, including the RMI port, are dynamically set by OPMN when each OC4J instance starts. When you specify the following URL in the client JNDI properties, the client-side OC4J retrieves the dynamic ports for the instance, and chooses one from the list for communication.
    java.naming.provider.url= opmn:ormi://<opmn_host>:<opmn_port>:<oc4j_instance>/<application-name>
    The OPMN host name and port number is retrieved from the opmn.xml file. In most cases, OPMN is located on the same machine as the OC4J instance. However, you must specify the host name in case it is located on another machine. The OPMN port number is optional; if excluded, the default is port 6003. The OPMN port is specified in opmn.xml.
    cheers
    -steve-

Maybe you are looking for

  • Create Form Print Button

    Acrobat 10.1.2 Mac Snow Leopard I am not particularly experienced with Acrobat fillable forms but I've created 6 or 7 that work pretty well. My question is how do I create a Print (or Email) button on the form so that when a user filling in the form

  • Wireless USB Network Card for Mac?

    Can the iMac G4 (Flat Panel) recognize/use USB 2.0 (is it reverse compatible?) I For some reason I cannot get my wireless to connect reliably (will try the suggestion I received). My Ethernet connection is also not working. I would like to try a USB

  • Airport Extereme 6.1: I can't open those ports I wanted to!

    Hi everybody! I would like to open some ports in my Airport Extreme 7.6.1.  (software 6.1). Those ports are for example EyeTV 2170 and VLC 5900. I have Airport utility and I have tried to change port settings at network section. I have changed at net

  • Create Standard Itab from Variable

    HI Gurus, i have a function module that gives me the table name from where the selection should be done as this table name changes dynamically. now i want to define a itab from this variable that holds the table name but im getting syntax error. data

  • ICache.InsertAll max data size

    Hi, I was trying to insert around 180 000 elements via C# ICache.InsertAll API and have got Tangosol.Net.Messaging.ConnectionException exception: at Tangosol.Util.Daemon.QueueProcessor.Service.Peer.Initiator.TcpInitiator.TcpConnection.Send(DataWriter