NameNotFoundException when looking up datasource jndi from standalone clien

Hi,
I'm trying to lookup datasource jndi from standalone client, but always get exceptions.
I configured an oralce datasource with jndi name "oracleDataSource". When looking it up in servlet, I can get connection.
In order to test it from standalone client, I created following code:
public class DataSourceTest
* Attempt to authenticate the user.
public static void main(String[] args)
String datasource = null;
if (args.length == 1 ) {
datasource = args[0];
System.out.println("datasource = "+datasource);
if(datasource == null)
datasource = "oracleDataSource";
try{
Connection conn = null;
Properties env = new Properties();
env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://localhost:3700");
Context initial = new InitialContext(env);
if(datasource != null){
DataSource ds = (DataSource)initial.lookup(datasource);
conn = ds.getConnection();
if(conn != null){
System.out.println("datasource is gotten.");
conn.close();
else
System.out.println("datasource is error.");
System.exit(0);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
When running, I get following exception:
[java] datasource = oracleDataSource
[java] Caught an unexpected exception!
[java] javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
[java] at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:34)
[java] at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:402)
[java] at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:368)
[java] at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:417)
[java] at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:395)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:350)
[java] at com.tbcn.ceap.test.cilent.DataSourceTest.main(DataSourceTest.java:42)
I also tried many other methods but always got exceptions. What's wrong with it? How can I lookup the datasource jndi from standalone client?
Thanks in advance!

Thank Tuan!
I tried. When running, the server will read security.properties and ejb.properties. But I didn't use ejb and I didn't know how to configure ejb.properties, so I let ejb.properties empty. The security.properties is as following:
client.sendpassword=true
server.trustedhosts=*
interop.ssl.required=false
interop.authRequired.enabled=false
interop.nameservice.ssl.required=false
The result is:
[java] javax.naming.CommunicationException: Can't find SerialContextProvider
[java] at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)
[java] at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at com.tbcn.ceap.test.cilent.DataSourceTest.main(DataSourceTest.java:42)
Also, I tried it with ACC. In sun sample ConverterClient.java under rmi-iiop/simple, I added following code under with ACC and without ACC. With ACC, I can get connection. But without ACC, I can't get it.
try{
          DataSource ds = (DataSource)initial.lookup("oracleDataSource");
          Connection conn = ds.getConnection();
          if(conn != null){
          System.out.println("datasource oracleDataSource gotten.");
          conn.close();
          else
          System.out.println("oracleDataSource is error.");
Does it means that we must lookup datasource jndi with ACC?

Similar Messages

  • NameNotFoundException when looking up DataSource in new Thread

    I am trying to run a db procedure in a new Thread within a J2EE app. The actual code to run the procedure is in a class that is called from a JSP page, a controller if you will (not a servlet). When I start the new Thread and try to get a connection from my DataSource, I get a NameNotFoundException. We are using iPlanet and Oracle. Is it a bad idea to start a new Thread from within iPlanet? Is there another way to run the db procedure and not make the user wait for it to finish?
    Any help/suggestions would be greatly appreciated.

    Okay, here is my Runnable class.
    <code>
    public class ExtractRunner implements Runnable, Serializable
    Extract m_extract;
    String m_propfile;
    String m_modName;
    LogManager m_log;
    public void run()
    DBConnectionManager conMan = null;
    try
    conMan = new DBConnectionManager(m_log.getElectronicServicesLog(),
    m_propfile, m_modName, "");
    int result = m_extract.doExtract(conMan, m_log);
    catch (Exception e)
    e.printStackTrace();
    finally
    m_extract = null;
    if (conMan != null)
    conMan.release();
    conMan = null;
    m_log = null;
    ExtractRunner(Extract extract, String propfile, String modName, LogManager log)
    m_extract = extract;
    m_propfile = propfile;
    m_modName = modName;
    m_log = log;
    </code>
    Here is the code that starts the thread. It is in another class that is called from the JSP.
    <code>
    public int doExtract(Extract extract)
    ExtractRunner er = new ExtractRunner(extract, PROP_FILE, MOD_CODE, m_log);
    Thread t = new Thread(er);
    t.setName("ExtractRunner");
    t.start();
    return 0;
    </code>
    And here is the code that calls the db procedure. It is in the Extract class.
    <code>
    public int doExtract(DBConnectionManager dbConnMgr, LogManager log)
    DBProcedureStatement dbStmnt = null;
    DBQuery dbQuery = null;
    Vector rs = null;
    int sqlResultCode = 0;
    dbStmnt = new DBProcedureStatement(this.getExtractProcedure());
    dbStmnt.addParameter(this.getParameters());
    try
    dbQuery = new DBQuery(dbConnMgr);
    long start = System.currentTimeMillis();
    log.logDebug("ExtractRunner::run()", "debug",
    "Starting extract at " + start);
    rs = dbQuery.doProcedure(dbStmnt);
    long elapsed = System.currentTimeMillis() - start;
    log.logDebug("Extract::doExtract()", "debug",
    "Done with extract." +
    " Elapsed time(ms): " + elapsed);
    if (rs != null && !rs.isEmpty())
    sqlResultCode = ((BigDecimal)rs.elementAt(0)).intValue();
    log.logDebug("Extract::doExtract()", "debug",
    "Result = " + sqlResultCode);
    //System.out.println("REsult code: " + sqlResultCode);
    else
    sqlResultCode = GEN_ERROR; //Procedure error
    sqlResultCode = 0; // The extract is no longer returning a result code
    // so if there's no Exception return SUCCESS
    catch (Exception e)
    log.logError("Extract::doExtract", "FDE_LOGGING",
    "Error doing extract. Exception: " + e);
    e.printStackTrace();
    sqlResultCode = GEN_ERROR;
    finally
    DBUtil.releaseResults(rs);
    //sql = null;
    rs = null;
    dbStmnt.finalize();
    dbStmnt = null;
    dbQuery = null;
    log.logDebug("Extract::doExtract", "FDE_LOGGING",
    "END: Results: sqlResultCode=" + sqlResultCode);
    return sqlResultCode;
    </code>

  • NameNotFoundException when looking up JNDI

    Hi,
    I'm getting the same naming exception you can see @ http://www.coderanch.com/t/51509/Struts/Calling-EJB-action-class when looking up an ejb object.
    How should I lookup the object?
    Thank you in advance,
        Michael Jones

    Hello
    Please try the following.
    Do annotate the EJB with the corresponding name in order to identify it later on:
    @Stateful(name = "MyLostEJB")
    public MyLostEJB implements LostEJBRemoteHome, LostEJBLocalHome
          public String sayHello(){ return "Hello"; }
    And then:
    LostEJBRemoteHome myEjb= null;
    myEjb= (LostEJBRemoteHome ) new InitialContext().lookup("MyLostEJB/remote");
        myEjb.sayHello();
    I hope it helps
    Alejandro

  • NameNotFoundException when looking up the Recource Adapter

              Hi,
              I am facing a problem when looking-up of the Resource Adapter from the Ejb.
              I am using a session bean to lookup the Resource adapter. I have no problem deploying
              the resource adapter and the ejb. But I am getting an exception when I run the
              client.
              The <resource-ref> tag in ejb-jar.xml is as follows.
              <enterprise-beans>
              <session>
              <ejb-name>connect</ejb-name>
              <home>connect.InsertHome</home>
              <remote>connect.Insert</remote>
              <ejb-class>connect.InsertBean</ejb-class>
              <session-type>Stateless</session-type>
              <transaction-type>Container</transaction-type>
              <resource-ref>
              <res-ref-name>eis/CciBlackBoxNoTx</res-ref-name>
              <res-type>com.sun.connector.cciblackbox.CciConnectionFactory</res-type>
              <res-auth>Container</res-auth>
              </resource-ref>
              </session>
              </enterprise-beans>
              I changed the res-ref-type from javax.sql.Datasource to the connection factory
              as I am using the CCI to connect to the database.
              My weblogic-ejb-jar file contains the following description
              <reference-descriptor>
              <resource-description>
              <res-ref-name>eis/CciBlackBoxNoTx</res-ref-name>
              <jndi-name>eis/CciBlackBoxNoTxConnectorJNDINAME</jndi-name>
              </resource-description>
              </reference-descriptor>
              <jndi-name>Insert</jndi-name>
              When I run my client I am getting the follwing Exception.
              javax.naming.NameNotFoundException: Unable to resolve 'app/ejb/connect.jar#conn
              ect/comp/env/user' Resolved: 'app/ejb/connect.jar#connect/comp/env' Unresolved:
              'user' ; remaining name 'user'
              at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basi
              cNamingNode.java:858)
              at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.ja
              va:223)
              at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:1
              87)
              at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:1
              95)
              at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:1
              95)
              at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
              at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
              at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyC
              ontextWrapper.java:36)
              at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.
              java:124)
              at javax.naming.InitialContext.lookup(InitialContext.java:345)
              at connect.InsertBean.setSessionContext(InsertBean.java:64)
              at connect.InsertBean_fqerje_Impl.setSessionContext(InsertBean_fqerje_I
              mpl.java:93)
              at weblogic.ejb20.manager.StatelessManager.createBean(StatelessManager.
              java:273)
              at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSession
              Pool.java:148)
              at weblogic.ejb20.pool.StatelessSessionPool.getBean(StatelessSessionPoo
              l.java:101)
              at weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.j
              ava:148)
              at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:1
              27)
              at weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObj
              ect.java:61)
              at connect.InsertBean_fqerje_EOImpl.insertName(InsertBean_fqerje_EOImpl
              .java:28)
              at connect.InsertBean_fqerje_EOImpl_WLSkel.invoke(Unknown Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
              at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
              Ref.java:114)
              at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
              ceManager.java:785)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
              va:308)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
              t.java:30)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              where connect.jar is the name of my ejb.
              This is the session bean code I am using to looup the resource adpater.
              user = (String) initCtx.lookup("java:comp/env/user");
              password = (String) initCtx.lookup("java:comp/env/password");
              cxf =(ConnectionFactory)initCtx.lookup("java:comp/env/eis/CciBlackBoxNoTx");
              I am using the weblogic 7.0 as the application server and Sun's CciblackboxNoTx
              as the resource adpter.The weblogic-ra.xml file for the resource adpter contains
              the following connection factory and jndi name.
              <connection-factory-name>LogicalNameOfCciBlackBoxNoTx</connection-factory-name>
              <jndi-name>eis/CciBlackBoxNoTxConnectorJNDINAME</jndi-name>
              Can any one please let me know where I am going wrong. Any solution will be of
              great help.
              Thanks,
              Ramya.
              

    Hi Ramya,
              Where you have defined user and password, is you have included those in the
              bean descriptor? Or rar descriptrs?. Server unable to findout the user and
              password.
              The following tags could not able to undestand what for?
              > </reference-descriptor>
              > <jndi-name>Insert</jndi-name>
              >
              Thanks
              Kumar
              "Ramya" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              > I am facing a problem when looking-up of the Resource Adapter from the
              Ejb.
              > I am using a session bean to lookup the Resource adapter. I have no
              problem deploying
              > the resource adapter and the ejb. But I am getting an exception when I run
              the
              > client.
              >
              > The <resource-ref> tag in ejb-jar.xml is as follows.
              >
              > <enterprise-beans>
              > <session>
              > <ejb-name>connect</ejb-name>
              > <home>connect.InsertHome</home>
              > <remote>connect.Insert</remote>
              > <ejb-class>connect.InsertBean</ejb-class>
              > <session-type>Stateless</session-type>
              > <transaction-type>Container</transaction-type>
              > <resource-ref>
              > <res-ref-name>eis/CciBlackBoxNoTx</res-ref-name>
              >
              <res-type>com.sun.connector.cciblackbox.CciConnectionFactory</res-type>
              > <res-auth>Container</res-auth>
              > </resource-ref>
              > </session>
              > </enterprise-beans>
              >
              > I changed the res-ref-type from javax.sql.Datasource to the connection
              factory
              > as I am using the CCI to connect to the database.
              >
              > My weblogic-ejb-jar file contains the following description
              >
              > <reference-descriptor>
              >
              > <resource-description>
              > <res-ref-name>eis/CciBlackBoxNoTx</res-ref-name>
              > <jndi-name>eis/CciBlackBoxNoTxConnectorJNDINAME</jndi-name>
              > </resource-description>
              >
              > </reference-descriptor>
              > <jndi-name>Insert</jndi-name>
              >
              > When I run my client I am getting the follwing Exception.
              >
              >
              > javax.naming.NameNotFoundException: Unable to resolve
              'app/ejb/connect.jar#conn
              > ect/comp/env/user' Resolved: 'app/ejb/connect.jar#connect/comp/env'
              Unresolved:
              > 'user' ; remaining name 'user'
              > at
              weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basi
              > cNamingNode.java:858)
              > at
              weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.ja
              > va:223)
              > at
              weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:1
              > 87)
              > at
              weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:1
              > 95)
              > at
              weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:1
              > 95)
              > at
              weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
              > at
              weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
              > at
              weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyC
              > ontextWrapper.java:36)
              > at
              weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.
              > java:124)
              > at javax.naming.InitialContext.lookup(InitialContext.java:345)
              > at connect.InsertBean.setSessionContext(InsertBean.java:64)
              > at
              connect.InsertBean_fqerje_Impl.setSessionContext(InsertBean_fqerje_I
              > mpl.java:93)
              > at
              weblogic.ejb20.manager.StatelessManager.createBean(StatelessManager.
              > java:273)
              > at
              weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSession
              > Pool.java:148)
              > at
              weblogic.ejb20.pool.StatelessSessionPool.getBean(StatelessSessionPoo
              > l.java:101)
              > at
              weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.j
              > ava:148)
              > at
              weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:1
              > 27)
              > at
              weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObj
              > ect.java:61)
              > at
              connect.InsertBean_fqerje_EOImpl.insertName(InsertBean_fqerje_EOImpl
              > java:28)
              > at connect.InsertBean_fqerje_EOImpl_WLSkel.invoke(Unknown Source)
              > at
              weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
              >
              > at
              weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
              > Ref.java:114)
              > at
              weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
              > at
              weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
              > ceManager.java:785)
              > at
              weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
              > va:308)
              > at
              weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
              > t.java:30)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              >
              > where connect.jar is the name of my ejb.
              >
              > This is the session bean code I am using to looup the resource adpater.
              >
              > user = (String) initCtx.lookup("java:comp/env/user");
              > password = (String) initCtx.lookup("java:comp/env/password");
              > cxf
              =(ConnectionFactory)initCtx.lookup("java:comp/env/eis/CciBlackBoxNoTx");
              >
              >
              >
              > I am using the weblogic 7.0 as the application server and Sun's
              CciblackboxNoTx
              > as the resource adpter.The weblogic-ra.xml file for the resource adpter
              contains
              > the following connection factory and jndi name.
              >
              >
              <connection-factory-name>LogicalNameOfCciBlackBoxNoTx</connection-factory-na
              me>
              > <jndi-name>eis/CciBlackBoxNoTxConnectorJNDINAME</jndi-name>
              >
              >
              > Can any one please let me know where I am going wrong. Any solution will
              be of
              > great help.
              >
              > Thanks,
              > Ramya.
              >
              

  • Accessing JNDI from Standalone JAVA application

    Hi,
    I want to access the JNDI tree from my
    standalone java application. (ie I have
    one weblogic server contains all my ejbs and client - swing - application which accesses that. )
    Here I don't want to ship weblogic.jar
    file to the client with swing application
    because it is of ~ 20 MP.
    Any other way to specify the INITIAL_CONTEXT_FATORY class.
    My code is
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, DTEConfig.PROVIDER_URL);
    But since I don't want to give the
    weblogic.jar bundle to my client, how he
    could manage this with out weblogic.jndi.WLInitialContextFactory
    with him to get the initialContext ?
    -Rajan Kumar

    You can strip out the jndi related classes from the weblogic.jar which can be distributed
    to the client installation. I don't think you will be violating any bea licensing
    policies with this.
    Rajan Kumar <[email protected]> wrote:
    Hi,
    I want to access the JNDI tree from my
    standalone java application. (ie I have
    one weblogic server contains all my ejbs and client - swing - application
    which accesses that. )
    Here I don't want to ship weblogic.jar
    file to the client with swing application
    because it is of ~ 20 MP.
    Any other way to specify the INITIAL_CONTEXT_FATORY class.
    My code is
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, DTEConfig.PROVIDER_URL);
    But since I don't want to give the
    weblogic.jar bundle to my client, how he
    could manage this with out weblogic.jndi.WLInitialContextFactory
    with him to get the initialContext ?
    -Rajan Kumar

  • Datasource Lookup from WSAD using POJO - CastException looking up DB2 Data

    I try to look up datasource from WSAD test server using stand alone POJO.
    Code is like:
    Hashtable properties = new Hashtable();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    properties.put(Context.PROVIDER_URL, serviceURL);
    properties.put(Context.PROVIDER_URL, "iiop://localhost:2813");
    Context context = new InitialContext(properties);
    ds = (DataSource) context.lookup("jdbc/myDS");
    Context and datasource are set properly.
    I get exception below when I look up datasource:
    Exception in thread "P=646891 =0:CT" java.lang.ClassCastException: javax.naming.Reference
    I think additional jar files are needed in class path.
    What additional jar files do I need in build path to look up datasource?
    I am using DB2. Datasource is properly configured in WSAD test server.

    Refer to this article.
    http://www-128.ibm.com/developerworks/websphere/library/techarticles/0310_bhogal/bhogal.html
    It provides all the information you need to perform a JNDI lookup. Quoting from the artice;
    To execute our external Java application, make sure your environment is prepared and use a Java command of the following form to invoke the client application:
    %JAVA_HOME%/bin/java -Xbootclasspath/p:%WAS_BOOTCLASSPATH%
    -classpath <list of the referenced jars, classes, and resource directories>
    -Djava.ext.dirs=%WAS_EXT_DIRS%
    -Djava.naming.provider.url=iiop://<server:orb port>
    -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
    %SERVER_ROOT% %CLIENTSAS% <fully qualified main class of the application client>;

  • Truoble looking up a JNDI Datasource

    Hi Everybody,
    I am having bit of trouble looking up a JNDI data source. Here is the exception I am getting when I try to run the following code.
    javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec, application-client chapter for requirements and format of the file)
    at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:109)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at ca.onestopbc.tests.OracleDatasourceTest.main(OracleDatasourceTest.java:35)
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    public class OracleDatasourceTest
    public OracleDatasourceTest()
    public static void main(String[] args)
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "admin");
    env.put(Context.PROVIDER_URL, "ormi://localhost:8888/");
    Context context;
    try {
    context = new InitialContext(env);
    DataSource ds = (DataSource)context.lookup("jdbc/XyzDS");
    System.out.println(ds);
    } catch (NamingException e) {
    e.printStackTrace();

    Hi Krishna,
    I assume your post relates to some J2EE application that you are trying to deploy to OC4J (since it was not clear to me from your post). Therefore I assume you have an EAR file. Since, in the code snippet you posted, you refer to the "ApplicationClientInitialContextFactory" class, that means that your EAR file must contain an "application-client.xml" file. According to the error message you have posted, OC4J cannot find the "application-client.xml" file in your EAR file.
    Also, I think you will have problems looking up an OC4J "DataSource" from a remote client (which appears to be the case -- from the code you have posted). This issue has been discussed previously in this forum. I suggest you search the forum archives for more details.
    Good Luck,
    Avi.

  • Looking up external JNDI (JBOSS Namely) from web applications.

    Hi,
    I am unable to look up names bound to JBOSS JNDI from external web apps.
    Dump of the JBOSS JNDI
    java: Namespace
    +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- DefaultDS (class: javax.sql.DataSource)
    +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
    +- ABTestDS (class: javax.sql.DataSource)
    +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
    +- comp (class: javax.naming.Context)
    +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
    +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- jaas (class: javax.naming.Context)
    | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
    | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
    | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
    +- timedCacheFactory (class: javax.naming.Context)
    Failed to lookup: timedCacheFactory, errmsg=null
    +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
    +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
    +- Mail (class: javax.mail.Session)
    +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
    +- TransactionManager (class: org.jboss.tm.TxManager)
    +- hibernate (class: org.jnp.interfaces.NamingContext)
    | +- SessionFactory (class: org.hibernate.impl.SessionFactoryImpl)
    Global JNDI Namespace
    +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
    +- UserTransactionSessionFactory (proxy: $Proxy11 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
    +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- console (class: org.jnp.interfaces.NamingContext)
    | +- PluginManager (proxy: $Proxy37 implements interface org.jboss.console.manager.PluginManagerMBean)
    +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
    +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
    +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- topic (class: org.jnp.interfaces.NamingContext)
    | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
    | +- testTopic (class: org.jboss.mq.SpyTopic)
    | +- securedTopic (class: org.jboss.mq.SpyTopic)
    +- queue (class: org.jnp.interfaces.NamingContext)
    | +- A (class: org.jboss.mq.SpyQueue)
    | +- testQueue (class: org.jboss.mq.SpyQueue)
    | +- ex (class: org.jboss.mq.SpyQueue)
    | +- DLQ (class: org.jboss.mq.SpyQueue)
    | +- D (class: org.jboss.mq.SpyQueue)
    | +- C (class: org.jboss.mq.SpyQueue)
    | +- B (class: org.jboss.mq.SpyQueue)
    +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
    +- jmx (class: org.jnp.interfaces.NamingContext)
    | +- invoker (class: org.jnp.interfaces.NamingContext)
    | | +- RMIAdaptor (proxy: $Proxy36 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
    | +- rmi (class: org.jnp.interfaces.NamingContext)
    | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
    +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
    +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
    +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
    I have an external web application that has
    jndi.properties in the classpath -- JBOSS is running on localhost
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=jnp://localhost:1099
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    web.xml for my external webapp
    <resource-ref>
    <res-ref-name>jdbc/ABTestDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <resource-ref >
    <res-ref-name>hibernate/SessionFactory</res-ref-name>
    <res-type>net.sf.hibernate.SessionFacory</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    Mycode:
    try {
    Context ctx = new InitialContext();
    sessionFactory = (SessionFactory) ctx.lookup("java:comp/env/hibernate/SessionFactory");
    } catch (ClassCastException cce) {
    throw new ServiceLocatorException(cce);
    } catch (NamingException ne) {
    throw new ServiceLocatorException(ne);
    I get a NamingException.
    Any hints would be really appreciated.
    thanks
    MH

    I have hte same question
    Hey DID you figure it out?
    let me know please
    maybe by email:
    [email protected]
    THANKS A LOT

  • When I try to open a Pages document from iCloud, created on my iPad, I get message stating I need a newer version of Pages.  When I go to app store all I get is "installed" when looking at pages app. my Macbook pro is up to date with all updates.

    When I try to open a Pages document from iCloud, created on my iPad, I get message stating I need a newer version of Pages.  When I go to app store all I get is "installed" when looking at pages app. my Macbook pro is up to date with all updates. Any ideas?

    You have 2 versions of Pages on your Mac.
    Pages 5 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5/5.01 can not open Pages 5.1 files and you will get the warning that you need a newer version.
    Pages 5.1 sometimes can not open its own files and you will get the warning that you need a newer version.
    Pages 5 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has not only managed to confuse all its users, but also itself.
    Note: Apple has removed over 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Archive/trash Pages 5, after exporting all Pages 5 files to Pages '09 or Word .docx, and rate/review it in the App Store, then get back to work.
    Peter

  • When i print a pdf from preview it prints strange characters - it looks fine on screen

    when i print a pdf from preview it prints strange characters - it looks fine on screen

    You can also try opening the PDF with preview, then doing a copy and paste to TextEdit and printing from there.
    Adobe makes it easier, but you do have software to accomplish this.
    Only download Adobe reader from this site, to avoid "fakes/spoofs/malware" that will cause damage to your machine.
    http://www.adobe.com/support/downloads/product.jsp?platform=macintosh&product=10
    Hope this helps

  • Is there a way for my daughter or her friends to block their numbers from showing up on activities page. At first i could see them, as of yesterday i can no longer see the numbers in the activities page. But i do see that she has texted them when looking

    Is there a way for my daughter or her friends to block their numbers from showing up on activities page. At first i could see them, as of yesterday i can no longer see the numbers in the activities page. But i do see that she has texted them when looking at her phone.

    First of all, there is no need to put the entire text of your post into the title of your thread.
    Next, does your daughter have an iPhone? Do her friends have iPhones? If the answer to both questions is "yes", then it is possible she is not texting them, but using iMessage to communicate with them. iMessages will not show up in the texting traffic on a line as they are not texts, but messages sent thru Apple's servers.
    For all "texts" to show up in the texting activity of an iPhone, you must disable iMessage on the device. Any messages sent as iMessages(blue bubbles around the text) on an iPhone will not show up in any texting activity.

  • I reset network settings on my iPhone. However now it looks as if my iPhone and iPad are no longer linked. They are both connected to my apple account but when I send an imessage from one it is not picked up by the other. What do I do?

    I reset network settings on my iPhone. However now it looks as if my iPhone and iPad are no longer linked. They are both connected to my apple account but when I send an imessage from one it is not picked up by the other. What do I do? If anyone can help it would be very much appreciated. Many thanks x

    Check Settings > Messages > Send & Receive on both your iPhone and your iPad to make sure that the following are all true:
    (1) you have selected the same Apple ID on both devices,
    (2) you have the same entries checked under "You can be reached by iMessage at:" on both devices,
    (3) you have the same entry checked under "Start new conversations from:" on both devices,
    and
    (4) that the entry checked in #3 is one of those checked in #2 on both devices.
    When you say it has affected your iCloud account, what effect has it had?

  • I set my iPhoto to save photos to a non-default location.  Now I can't find my iPhoto albums in iTunes, even when looking in my non-default location in the "Sync Photos from" menu.  How do I fix this?

    I set my iPhoto to save photos to a non-default location.  Now I can't find my iPhoto albums in iTunes, even when looking in my non-default location in the "Sync Photos from" menu.  How do I fix this?

    When you launch iPhoto with the option key depressed you'll get this window:
    Click to view full size
    All libraries on your hard drive (and on external drives) will be listed and the currently used library will be listed as (default).
    OT

  • HT201272 I have recently picked up an Apple TV. When I go to the movies tab, there are less movies available there than there are in my i-Tunes account. I've done some looking around at questions from others, but haven't found an answer that works for me.

    I have recently picked up an Apple TV. When I go to the movies tab, there less movies available there than what is available in my i-Tunes library. I have 38 movies showing in my library but only 23 are showing in the Movies tab on the Apple TV. After researching this a little, there are only 23 movies showing under Purchased in the Quicklinks of my i-Tunes account. The majority of my collection are digital copy downloads that came from DVD purchases. Some of the missing movies were added in the past couple of months, the rest are a year-or-so old. I have done some looking around at questions from others, but I have not found an answer that will fix my situation. How do I update my library to get ALL of my movies to reflect that they were "Purchased"(as it says they were in their Properties)?

    Biggles Lamb wrote:
    Chill out guys, getting personal will never ever change another persons view, right or wrong, they are entitled to them .
    The pros and cons of to CC or not to CC have been done to death
    Its a fact the CC model will work for some, especially newbies and small businesses.
    The risks associated with the CC model have been well documented.
    For long term users of CS perpetuals its generally a large hike up in cost compared to the upgrade system.
    Then there are the....... Adobe can rot it hell...... group who will never subscribe
    To each their own, you do the math to suit your cashflow whatever that is and then make an informed decision
    To those on the CC model, I'd like to offer some practical advice.........do not allow automatic updates.........make regular backups............develop an exit strategy of alternatives for when you can no longer afford the subscription costs............never ever assume that the Adobe update is bug free
    Enjoy your cloud
    Col
    Thank you for that post, and the advice. I just happen to be one of those who it does work for. I've been around long enough to know that CC isn't going to work for everyone(the large publishing/radio/web company I work for isn't upgrading to CC because of the costs involved). But it does for me as I potentially venture out into the full-time freelancing world and away from the more structured big office environment. I can't make decisions based on what is best for anyone else, or what will hurt or help Adobe. Just what affects me, and that's all.
    Brent

  • How do I get a picture to look like the audi example picture (2nd one) when you download motion 5 from the app store?

    Im looking to remake this picture that is an example when you download motion 5 from the app store. Apple gives you 5 example pictures to kind of show off what the program can do and I want to replicate the 2nd one. I like how the picture is divided into multiple different sized boxes and I dont know the presets needed to make another picture like that. Any tips are welcome. Thanks.
    -Alex

    Thanks for the help folks, sorry I've been away.
    I'd love help with the problem of why I only one track seems to accept clips to play. When I drag them to other tracks or create a track by dragging the clips are grayed out and won't play, but if I drag them to the one track where they're blue they play.

Maybe you are looking for

  • The use of id attribute in html tags

    Hi I use http://java.sun.com/jsf/html as follows: <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <h:form id="myid"> <h:panelGrid id="mypanelgrid" columns="1"> </h:panelGrid> </ht:form>When I don't use the id attribute with the UI componen

  • Sound issues macbook pro

    Hi I have a MacBook Pro 2011 that  has been working well. It runs OS Lion. Recently after a restart there was no sound and in the settings it said no output device found. This seems to be a common problem. I have tried a few different things unsucces

  • Overcharged for addition of Skysports1 to BT Visio...

    I have BT Broadband and BT Vision. I asked for Skysports1 to be added to my package. This was done with effect from 1st August. The monthly package direct debit increased from £45 per month to £73 per month from August. I am being charged £19+ per mo

  • Sql prompt in linux

    hi !! good wishes !! am an aspirant of orclr dba. I installed oralce on linux AS 4 but am not getting the sql promp while i was insatlling oracle i got 2 warnings as 1.please check the os configuration parameters 2.please check the kernel parameters

  • SMTP Node for GFI Faxmaker

    GFI Faxmaker setup in ECC 6.0 Hi, We are using a old Version of GFI Faxmaker. Its connected via RFC and a little Program called "SAP FAX Gateway". Now we updated the Faxmaker and GFI said that they can communicate with SAP directly via SMTP. SAP Fax