JNDI InitialContext

Hi all,
I am trying to obtain a jndi Context with the following method:
public static Context getInitialContext() throws javax.naming.NamingException {
          Properties props = new Properties();
          props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
          props.put(Context.PROVIDER_URL, "localhost:50004");
          Context jndiContext = new InitialContext(props);
          return jndiContext;
When I execute the code from an external client I get the following exception:
javax.naming.NoInitialContextException: Cannot instantiate class: com.sap.engine.services.jndi.InitialContextFactoryImpl [Root exception is java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl]
     at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
     at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
Any ideas? Thanks,
Arne

Hi Arne,
Seems your client doesn't have the required jars on its classpath. You need the following: sapj2eeclient.jar, exception.jar, logging.jar from /usr/sap/<SID>/<instance>/j2ee/j2eeclient.
HTH!
-Vladimir

Similar Messages

  • JNDI InitialContext Error

    Hello Experts,
    I have a little problem with my Java programm:
    Test remote = null;
    *               try {*
    //                  Create a new intial context, which loads from jndi.properties file.
    *               Context ctx = new InitialContext();*
    *               System.out.println("Context:" + ctx);*
    //                  Look up the home interface using the JNDI name.
    //                  This JNDI lookup returns a reference to an EJBHome instance.
    *               TestHome home = (TestHome) ctx.lookup("sap.com/TestWorldEar/TestBean");*
    *               System.out.println("TestHome:" + home);*
    //                  Create a session object.
    *               remote = home.create();*
    *               System.out.println("Remote:" + remote);*
    //                  Invoke the remote EJB methods, test and debug.
    *               System.out.println("Result:" + remote.getWert());*
    *               }  catch  (Exception e) {*
    *               System.out.println("Exception: " + e.getLocalizedMessage());*
    I always get the following error and I don't know how to solve the problem.
    Exception: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    I hope anybody of you can help me solving this problem.
    Additional information:
    The Java program is running on a XI (Netweaver 7.0).
    I want to get information from a deployed EJB. The Bean still works.
    Thank you for your answers in advance!!!
    Greetings, Alexander

    Hi,
    this Exception is thrown after this result: Context:javax.naming.InitialContext@cdfc9c and before the lookup.
    The complete Stack Trace is:
    Exception thrown [Mon Aug 11 10:48:10,187]:Exception thrown by application running in JCo Server
    com.sap.engine.services.rfcengine.RFCException: Bean ZEJB_TEST_ZUGRIFF not found
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:123)
         at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequest(RFCJCOServer.java:156)
         at com.sap.mw.jco.JCO$Server.dispatchRequest(JCO.java:7701)
         at com.sap.mw.jco.MiddlewareJRfc$Server.dispatchRequest(MiddlewareJRfc.java:2376)
         at com.sap.mw.jco.MiddlewareJRfc$Server.listen(MiddlewareJRfc.java:1700)
         at com.sap.mw.jco.JCO$Server.listen(JCO.java:8061)
         at com.sap.mw.jco.JCO$Server.work(JCO.java:8181)
         at com.sap.mw.jco.JCO$Server.loop(JCO.java:8128)
         at com.sap.mw.jco.JCO$Server.run(JCO.java:8044)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of ZEJB_TEST_ZUGRIFF.
         at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:649)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:344)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:639)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:115)
         ... 12 more

  • JNDI initialContext hanging

    Under a stress test load over around 100 users we seem to be able to hang
    the WLS 5.1 SP6 server after only a few minutes. A thread dump shows all
    execute threads waiting on the initialContext method, where we are
    attempting to contact the JNDI service on another WLS 5.1 SP6 server.
    Reducing the code down to a simple JSP doing nothing more than constructing
    the initialContext and then closing it shows the same problem!
    JDK : Sun 1_3_0
    Anybody seem this or have any idea? Also have tried using a cached context
    but then the problem seems to move to the EJB lookup or business method
    invoke. Most strange but rather a show stopper for the scale we are looking
    for from the application.

    Will try to get a copy but I'm off site right now and don't have a copy to
    hand. Of the execute threads all had stalled on Object.wait() with the chain
    starting from either an initialContext() construction or lookup() method.
    Reading around the JNDI Context I get the feeling (a) the service is
    syncronised (b) should be called sparingly. In the case we are working with
    the Provider_URL is another host.
    Rob Woollen <[email protected]> wrote in message
    news:[email protected]..
    Can you post the thread dump?
    -- Rob
    Tony Symons wrote:
    Under a stress test load over around 100 users we seem to be able to
    hang
    the WLS 5.1 SP6 server after only a few minutes. A thread dump shows all
    execute threads waiting on the initialContext method, where we are
    attempting to contact the JNDI service on another WLS 5.1 SP6 server.
    Reducing the code down to a simple JSP doing nothing more thanconstructing
    the initialContext and then closing it shows the same problem!
    JDK : Sun 1_3_0
    Anybody seem this or have any idea? Also have tried using a cachedcontext
    but then the problem seems to move to the EJB lookup or business method
    invoke. Most strange but rather a show stopper for the scale we arelooking
    for from the application.--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • Leak in default jndi InitialContext

    WebLogic Build: 4.5.1 Service Pack 7 02/16/2000 15:17:50 #63218
    OS: both solaris and windows.
    There appears to be a leak when creating the default jndi initial context
    from multiple
    threads. As a quick demonstration of this problem, the following code from a
    JSP served by the Weblogic server:
    <HTML>
    <HEAD>
    <TITLE>Debug</TITLE>
    <%@ page import="javax.naming.InitialContext" %>
    </HEAD>
    <BODY>
    <H1>Debug</H1>
    <%
    for (int i=0; i<100; i++) {
    Thread t = new Thread() {
    public void run() {
    try {   new InitialContext(); } catch (Exception ex)
    {ex.printStackTrace(); }
    private byte buf[] = new byte[100000];
    t.start();
    try {  t.join(); } catch (Exception ex) {ex.printStackTrace();}
    t = null;
    System.gc();
    out.println("Avail mem is "+Runtime.getRuntime().freeMemory());
    out.println("<br>");
    %>
    </BODY>
    </HTML>
    Returns a steadily diminishing amount of memory
    Avail mem is 43085112
    Avail mem is 43059888
    Avail mem is 42959488
    Avail mem is 42858992
    Avail mem is 42758496
    Avail mem is 42658000
    Avail mem is 42557504
    Avail mem is 42457008
    Avail mem is 42354288
    Avail mem is 42256016
    The memory never gets gc'ed, and eventually Bad Things(TM) happen.
    Has anyone encountered this behaviour? Workarounds? Patches?
    Thanks,
    -kb-
    PS: Apologies to the very helpful support folks at Weblogic -- I just sent
    them a separate email, but this is
    turning into a critical last-minute problem, so instead of waiting, I'm also
    polling everyone on the
    news-groups.

    The problem remains even with the .close()
    I've been informed by Weblogic support that creating user-threads within the
    Weblogic server is not supported.
    My Optimizeit traces appear to indicate that the leak arises from Weblogic
    using the Thread.currentThread() object to index a static Thread-local cache
    that contains
    various interesting bits of information pertinent to the current thread.
    (Thus Thread objects
    are never garbage-collectable once you use 'most any Weblogic implemented
    services within
    the thread.)
    The workaround support suggested was essentially to run the task
    using one of the threads they keep in their execute-thread pool.
    The mechanics of their recommendation is to use the Weblogic Time service to
    .run() a
    Runnable within a Triggerable task (and schedule it ASAP).
    Time service tasks are run using a free thread within their execute-thread
    pool, so
    I speculate the "leak" is then invisible, because all the action happens
    within a
    fixed set of threads. (Weblogic apparently never idles out any of execute
    threads,
    so they cannot be GC'ed anyway, and re-using them re-uses the Thread-local
    cache.)
    Regards,
    -kb-
    Alex <[email protected]> wrote in message
    news:[email protected]...
    You might try closing your context in a finally block - context.close().
    That usually seems to be a good thing. But this is a guess.
    KB Sriram <[email protected]> wrote in message
    news:[email protected]...
    WebLogic Build: 4.5.1 Service Pack 7 02/16/2000 15:17:50 #63218
    OS: both solaris and windows.
    There appears to be a leak when creating the default jndi initial
    context
    from multiple
    threads. As a quick demonstration of this problem, the following codefrom
    a
    JSP served by the Weblogic server:
    <HTML>
    <HEAD>
    <TITLE>Debug</TITLE>
    <%@ page import="javax.naming.InitialContext" %>
    </HEAD>
    <BODY>
    <H1>Debug</H1>
    <%
    for (int i=0; i<100; i++) {
    Thread t = new Thread() {
    public void run() {
    try {   new InitialContext(); } catch (Exception ex)
    {ex.printStackTrace(); }
    private byte buf[] = new byte[100000];
    t.start();
    try {  t.join(); } catch (Exception ex) {ex.printStackTrace();}
    t = null;
    System.gc();
    out.println("Avail mem is "+Runtime.getRuntime().freeMemory());
    out.println("<br>");
    %>
    </BODY>
    </HTML>
    Returns a steadily diminishing amount of memory
    Avail mem is 43085112
    Avail mem is 43059888
    Avail mem is 42959488
    Avail mem is 42858992
    Avail mem is 42758496
    Avail mem is 42658000
    Avail mem is 42557504
    Avail mem is 42457008
    Avail mem is 42354288
    Avail mem is 42256016
    The memory never gets gc'ed, and eventually Bad Things(TM) happen.
    Has anyone encountered this behaviour? Workarounds? Patches?
    Thanks,
    -kb-
    PS: Apologies to the very helpful support folks at Weblogic -- I just
    sent
    them a separate email, but this is
    turning into a critical last-minute problem, so instead of waiting, I'malso
    polling everyone on the
    news-groups.

  • JNDI InitialContext problem:

    Hi,
    I have problem with to get look up the JDBC Factory.
    I have given code below which have been working fine in Sneak Preview SPS11. But It giving some error in SPS14.
    code:
    Hashtable env = new Hashtable();
    env.put("domain", "true");
    Context initctx = new com.sapportals.portal.prt.jndisupport.InitialContext(env);
    Object obj = initctx.lookup("deployedAdapters/JDBCFactory/shareable/JDBCFactory");
    Error:
    #com.sap.security.core.policy.PolicyInfoManagerImpl.copyApplicationConfiguration
    #Administrator#974####22d400d023ba11dbbd2a00127991cc99
    #SAPEngine_Application_Thread[impl:3]_32##0#0#Error#1#/System/Security/WS/SecurityProtocol
    #Java###An error occured while copying configurations for application .
    Reason: sap.com/LDAPTestEAR#com.sap.engine.frame.core.configuration.NameNotFoundException
    #Error##Plain###Processing HTTP request to servlet [LDAPTest] finished with error. <b>The error is: java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap</b>
         at com.sapportals.portal.prt.jndisupport.util.MemoryHierarchicalContext.prepare(MemoryHierarchicalContext.java:43)
         at com.sapportals.portal.prt.jndisupport.util.AbstractHierarchicalContext.<init>(AbstractHierarchicalContext.java:53)
         at com.sapportals.portal.prt.jndisupport.util.AbstractHierarchicalContext.<init>(AbstractHierarchicalContext.java:33)
         at com.sapportals.portal.prt.jndisupport.util.MemoryHierarchicalContext.<init>(MemoryHierarchicalContext.java:28)
         at com.sapportals.portal.prt.jndisupport.JNDISupport.<init>(JNDISupport.java:32)
         at com.sapportals.portal.prt.jndisupport.JNDISupport.getInstance(JNDISupport.java:71)
         at com.sapportals.portal.prt.jndisupport.NamingManager.findContextFactory(NamingManager.java:164)
         at com.sapportals.portal.prt.jndisupport.NamingManager.getInitialContext(NamingManager.java:41)
         at com.sapportals.portal.prt.jndisupport.InitialContext.getDefaultInitCtx(InitialContext.java:39)
         at com.sapportals.portal.prt.jndisupport.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:59)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.hcl.heiam.LDAPTest.doGet(LDAPTest.java:32)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    Regards,
    Krishna.

    Hi Amrendra,
    I had set clssapath.
    This is server classpath.
    JAVA_HOME = D:\j2sdk1.4.2_09
    CLASSPATH = %CLASSPATH%;%JAVA_HOME%\lib
    I have checked as CLASSPATH = %CLASSPATH%;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\jre\lib\rt.jar;
    But, same error is coming.
    thanks for reply.
    Regards,
    Krishna.

  • JNDI InitialContext Question.

    I wish to lookup the home interface of an ejb.
    So I initialise an InitialContext as follows:
    Properties prop = new Properties();
    prop.setProperty(Context.INITIAL_CONTEXT_FACTORY,"x.y.EJBServerContextFactoryClass");
    prop.setProperty(Context.PROVIDER_URL,"jnp://10.200.1.21:8080");
    InitialContext context = new InitialContext(prop);
    BeanHome bean=(BeanHome)PortableRemoteObject.narrow(context.lookup(“BeanClass”),BeanHome.Beanclass);
    bean.create();
    When I finally narrow to the bean here, when do I or don't I need to use the full
    context.lookup("java:comp/env/ejb/BeanClass")
    Does the inclusion of Context.PROVIDER_URL eliminate the need for the pull name String here, or not? and Why?
    None of the literature that I have consulted makes this matter clear.
    Help, pretty please? :)
    Z

    Zac1234
    I've removed your duplicate post. In future, please take adequate care to post a question once only.
    You can edit your posting until there is a response, and you can mark it as a question within the first 15 minutes after posting.
    db

  • WARNING: Could not bind factory to JNDI

    Hi i am using tomcat server5.5
    Eclipse 3.2 and adding tomcat plug-in's to my Eclipse
    i created JNDI on tomcat server i got this type of error
    plez any one can help me
    i got this type WARNING
    WARNING: Could not bind factory to JNDI
    javax.naming.NamingException: Context is read only
    how can i over come this worning
    the server show message like
    INFO: Factory name: java:hibernate/SessionFactory
    May 2, 2007 9:12:24 AM org.hibernate.util.NamingHelper getInitialContext
    INFO: JNDI InitialContext properties:{}
    May 2, 2007 9:12:24 AM org.hibernate.util.NamingHelper bind
    INFO: Creating subcontext: java:hibernate
    May 2, 2007 9:12:24 AM org.hibernate.impl.SessionFactoryObjectFactory addInstanc
    e
    WARNING: Could not bind factory to JNDI
    javax.naming.NamingException: Context is read only
    at org.apache.naming.NamingContext.checkWritable(NamingContext.java:901)
    at org.apache.naming.NamingContext.createSubcontext(NamingContext.java:5
    15)
    at org.apache.naming.NamingContext.createSubcontext(NamingContext.java:5
    36)
    at org.apache.naming.SelectorContext.createSubcontext(SelectorContext.ja
    va:421)
    at javax.naming.InitialContext.createSubcontext(InitialContext.java:423)
    at org.hibernate.util.NamingHelper.bind(NamingHelper.java:69)
    at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFac
    toryObjectFactory.java:90)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
    303)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
    a:1213)
    at com.gssamerica.expensereporting.business.dao.HibernateUtil.<clinit>(H
    ibernateUtil.java:38)
    at com.gssamerica.expensereporting.business.dao.RoleHome.roleList(RoleHo
    me.java:159)
    at com.gssamerica.expensereporting.business.listener.LookupCacheListener
    .cacheRoles(LookupCacheListener.java:168)
    at com.gssamerica.expensereporting.business.listener.LookupCacheListener
    .contextInitialized(LookupCacheListener.java:48)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
    t.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
    343)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478
    at org.apache.catalina.core.StandardService.start(StandardService.java:4
    80)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:231
    3)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
    May 2, 2007 9:12:24 AM org.hibernate.cache.UpdateTimestampsCache <init>
    INFO: starting update timestamps cache at region: org.hibernate.cache.UpdateTime
    stampsCache
    May 2, 2007 9:12:24 AM org.hibernate.cache.EhCacheProvider buildCache
    WARNING: Could not find configuration [org.hibernate.cache.UpdateTimestampsCache
    ]; using defaults.
    May 2, 2007 9:12:24 AM org.hibernate.cache.StandardQueryCache <init>
    INFO: starting query cache at region: org.hibernate.cache.StandardQueryCache
    May 2, 2007 9:12:24 AM org.hibernate.cache.EhCacheProvider buildCache
    WARNING: Could not find configuration [org.hibernate.cache.StandardQueryCache];
    using defaults.
    Roles Cached......
    ##################>.SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=
    []];ActionQueue[insertions=[] updates=[] deletions=[] collectionCreations=[] col
    lectionRemovals=[] collectionUpdates=[]])
    Currencies Cached.......
    Countries Cached.......
    JNDI DATASOURCE USED ........................................
    Instance Created .................
    org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '
    ' for connect URL 'null'
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
    rce.java:780)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
    .java:540)
    at com.gssamerica.expensereporting.ui.common.SQLManager.getConnection(SQ
    LManager.java:93)
    at com.gssamerica.expensereporting.business.dao.CacheHome.getExpenseIds(
    CacheHome.java:63)
    at com.gssamerica.expensereporting.business.listener.LookupCacheListener
    .cacheExpenseId(LookupCacheListener.java:191)
    at com.gssamerica.expensereporting.business.listener.LookupCacheListener
    .contextInitialized(LookupCacheListener.java:51)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
    t.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
    343)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478
    at org.apache.catalina.core.StandardService.start(StandardService.java:4
    80)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:231
    3)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
    Caused by: java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getDriver(DriverManager.java:243)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
    rce.java:773)
    ... 20 more
    Connection Error - Exchange Rates cannot be Stored in Database
    Expense Ids Cached......
    Statuses Cached......
    May 2, 2007 9:12:27 AM org.apache.catalina.startup.ContextConfig applicationConf
    ig
    INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].
    StandardHost[localhost].StandardContext[SCWCDProj]
    log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.
    ConvertUtils).
    log4j:WARN Please initialize the log4j system properly.
    log4j:ERROR Could not read configuration file from URL [file:E:/WebExpenses/Test
    ValidationsTomcat/WEB-INF/classes/log4j.properties].
    java.io.FileNotFoundException: E:\WebExpenses\TestValidationsTomcat\WEB-INF\clas
    ses\log4j.properties (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
    .java:70)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
    nection.java:161)
    at java.net.URL.openStream(URL.java:1007)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato
    r.java:433)
    at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.
    java:336)
    at org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.
    java:70)
    at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebC
    onfigurer.java:151)
    at org.springframework.web.util.Log4jConfigListener.contextInitialized(L
    og4jConfigListener.java:51)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
    t.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
    343)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478
    at org.apache.catalina.core.StandardService.start(StandardService.java:4
    80)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:231
    3)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
    log4j:ERROR Ignoring configuration file [file:E:/WebExpenses/TestValidationsTomc
    at/WEB-INF/classes/log4j.properties].
    May 2, 2007 9:12:30 AM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    May 2, 2007 9:12:31 AM org.apache.catalina.core.StandardContext start
    SEVERE: Context startup failed due to previous errors
    May 2, 2007 9:12:32 AM org.apache.catalina.loader.WebappClassLoader validateJarF
    ile
    INFO: validateJarFile(E:\WebExpenses\JSFDataBaseConnection\WEB-INF\lib\servlet-a
    pi.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
    javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.
    ConvertUtils).
    log4j:WARN Please initialize the log4j system properly.
    May 2, 2007 9:12:35 AM org.apache.catalina.startup.ContextConfig applicationConf
    ig
    INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].
    StandardHost[localhost].StandardContext[WebServicesApp]
    May 2, 2007 9:12:37 AM org.apache.catalina.loader.WebappClassLoader validateJarF
    ile
    INFO: validateJarFile(E:\WebExpenses\JSFApplication\WEB-INF\lib\servlet-api.jar)
    - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/s
    ervlet/Servlet.class
    May 2, 2007 9:12:39 AM org.apache.catalina.core.StandardHost getDeployer
    INFO: Create Host deployer for direct deployment ( non-jmx )
    May 2, 2007 9:12:39 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\admin.xml
    May 2, 2007 9:12:40 AM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
    e
    May 2, 2007 9:12:40 AM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul
    l=true
    May 2, 2007 9:12:40 AM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', retur
    nNull=true
    May 2, 2007 9:12:42 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\balancer.xml
    May 2, 2007 9:12:43 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\jsp-examples.xml
    May 2, 2007 9:12:43 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\manager.xml
    May 2, 2007 9:12:44 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\ROOT.xml
    May 2, 2007 9:12:44 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\servlets-examples.xml
    May 2, 2007 9:12:44 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\tomcat-docs.xml
    May 2, 2007 9:12:44 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\TomcatJNDIProj.xml
    log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.
    ConvertUtils).
    log4j:WARN Please initialize the log4j system properly.
    May 2, 2007 9:12:45 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Processing Context configuration file URL file:C:\Tomcat 5.0\conf\Catalina
    \localhost\webdav.xml
    May 2, 2007 9:12:46 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /struts2-blank-2.0.1 from URL f
    ile:C:/Tomcat 5.0/webapps/struts2-blank-2.0.1
    May 2, 2007 9:12:47 AM org.springframework.web.context.ContextLoader initWebAppl
    icationContext
    INFO: Root WebApplicationContext: initialization started
    May 2, 2007 9:12:47 AM org.springframework.core.CollectionFactory <clinit>
    INFO: JDK 1.4+ collections available
    May 2, 2007 9:12:47 AM org.springframework.core.CollectionFactory <clinit>
    INFO: Commons Collections 3.x available
    May 2, 2007 9:12:47 AM org.springframework.beans.factory.xml.XmlBeanDefinitionRe
    ader loadBeanDefinitions
    INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applic
    ationContext.xml]
    May 2, 2007 9:12:47 AM org.springframework.context.support.AbstractRefreshableAp
    plicationContext refreshBeanFactory
    INFO: Bean factory for application context [Root WebApplicationContext]: org.spr
    ingframework.beans.factory.support.DefaultListableBeanFactory defining beans [];
    root of BeanFactory hierarchy
    May 2, 2007 9:12:48 AM org.springframework.context.support.AbstractApplicationCo
    ntext refresh
    INFO: No beans defined in application context [Root WebApplicationContext]
    May 2, 2007 9:12:48 AM org.springframework.context.support.AbstractApplicationCo
    ntext initMessageSource
    INFO: Unable to locate MessageSource with name 'messageSource': using default [o
    [email protected]]
    May 2, 2007 9:12:48 AM org.springframework.context.support.AbstractApplicationCo
    ntext initApplicationEventMulticaster
    INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMu
    lticaster': using default [org.springframework.context.event.SimpleApplicationEv
    entMulticaster@2f7cfe]
    May 2, 2007 9:12:48 AM org.springframework.ui.context.support.UiApplicationConte
    xtUtils initThemeSource
    INFO: Unable to locate ThemeSource with name 'themeSource': using default [org.s
    [email protected]3]
    May 2, 2007 9:12:48 AM org.springframework.beans.factory.support.DefaultListable
    BeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory
    .support.DefaultListableBeanFactory defining beans []; root of BeanFactory hiera
    rchy]
    May 2, 2007 9:12:48 AM org.springframework.web.context.ContextLoader initWebAppl
    icationContext
    INFO: Using context class [org.springframework.web.context.support.XmlWebApplica
    tionContext] for root WebApplicationContext
    May 2, 2007 9:12:48 AM org.springframework.web.context.ContextLoader initWebAppl
    icationContext
    INFO: Root WebApplicationContext: initialization completed in 1638 ms
    May 2, 2007 9:12:49 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /HibElearning from URL file:C:\
    Tomcat 5.0\webapps\HibElearning
    May 2, 2007 9:12:50 AM org.apache.catalina.loader.WebappClassLoader validateJarF
    ile
    INFO: validateJarFile(C:\Tomcat 5.0\webapps\HibElearning\WEB-INF\lib\servlet-api
    .jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: ja
    vax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.
    ConvertUtils).
    log4j:WARN Please initialize the log4j system properly.
    May 2, 2007 9:12:51 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /reddy from URL file:C:\Tomcat
    5.0\webapps\reddy
    May 2, 2007 9:12:52 AM org.springframework.web.context.ContextLoader initWebAppl
    icationContext
    INFO: Root WebApplicationContext: initialization started
    May 2, 2007 9:12:52 AM org.springframework.core.CollectionFactory <clinit>
    INFO: JDK 1.4+ collections available
    May 2, 2007 9:12:52 AM org.springframework.core.CollectionFactory <clinit>
    INFO: Commons Collections 3.x available
    May 2, 2007 9:12:52 AM org.springframework.beans.factory.xml.XmlBeanDefinitionRe
    ader loadBeanDefinitions
    INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applic
    ationContext.xml]
    May 2, 2007 9:12:52 AM org.springframework.context.support.AbstractRefreshableAp
    plicationContext refreshBeanFactory
    INFO: Bean factory for application context [Root WebApplicationContext]: org.spr
    ingframework.beans.factory.support.DefaultListableBeanFactory defining beans [];
    root of BeanFactory hierarchy
    May 2, 2007 9:12:52 AM org.springframework.context.support.AbstractApplicationCo
    ntext refresh
    INFO: No beans defined in application context [Root WebApplicationContext]
    May 2, 2007 9:12:53 AM org.springframework.context.support.AbstractApplicationCo
    ntext initMessageSource
    INFO: Unable to locate MessageSource with name 'messageSource': using default [o
    [email protected]]
    May 2, 2007 9:12:53 AM org.springframework.context.support.AbstractApplicationCo
    ntext initApplicationEventMulticaster
    INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMu
    lticaster': using default [org.springframework.context.event.SimpleApplicationEv
    entMulticaster@fae78f]
    May 2, 2007 9:12:53 AM org.springframework.ui.context.support.UiApplicationConte
    xtUtils initThemeSource
    INFO: Unable to locate ThemeSource with name 'themeSource': using default [org.s
    [email protected]3]
    May 2, 2007 9:12:53 AM org.springframework.beans.factory.support.DefaultListable
    BeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory
    .support.DefaultListableBeanFactory defining beans []; root of BeanFactory hiera
    rchy]
    May 2, 2007 9:12:53 AM org.springframework.web.context.ContextLoader initWebAppl
    icationContext
    INFO: Using context class [org.springframework.web.context.support.XmlWebApplica
    tionContext] for root WebApplicationContext
    May 2, 2007 9:12:53 AM org.springframework.web.context.ContextLoader initWebAppl
    icationContext
    INFO: Root WebApplicationContext: initialization completed in 1279 ms
    May 2, 2007 9:12:53 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    May 2, 2007 9:12:54 AM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    plez any one can help me as early as possible

    Maybe this resoruce will be helpful.

  • JNDI in ActiveX : javax.rmi.PortableRemoteObject.narrow() can't work ?

    Hi All,
    I got a big head ache of this problem for several days, much appreciated if
    I can get help from you.
    The problem is, I wrote an EJB and already deployed it into Weblogic5.1. I
    also wrote a java EJB client to access this EJB. Everything seemed ok at
    this moment.
    The problem occured after i convert this EJB client to ActiveX and test it
    with Microsoft ActiveX Control Test Container. I log each step in the
    ActiveX, and find the problem is caused by
    javax.rmi.PortableRemoteObject.narrow(). Below is my source code and log
    information. My environment is Server side(weblogic5.1),Client side(java
    run-time3.1 with plug-in).
    Source code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFacto
    ry");
    env.put(Context.PROVIDER_URL,"t3://"+ip+":"+port);
    try{
    Log("Init jndi ");
    InitialContext ctx = new InitialContext(env);
    Log("Search Home ");
    Object obj = ctx.lookup("ServiceManagerHome");
    Log("home is "+obj);
    Log("narrow from "+obj.getClass().getName());
    Log("narrow to "+ServiceManagerHome.class.getName());
    obj = PortableRemoteObject.narrow(obj,ServiceManagerHome.class);
    Log("narrow home is "+obj);
    serviceHome = (ServiceManagerHome)obj;
    Log("cast home"+serviceHome);
    serviceManager = serviceHome.create();
    Log("Create EJB bean "+serviceManager);
    } catch (Exception e){
    Log("Err-"+e);
    Log("Err-"+e.getLocalizedMessage());
    Log("Err-"+e.getMessage());
    Log information for ActiveX:
    Init jndi
    Search Home
    home is ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    narrow from rm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    Err-java.lang.ClassCastException
    Err-null
    Err-null
    Log information for java EJB Client:
    Init jndi
    Search Home
    home is
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    narrow from crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    narrow home
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    cast
    homecrm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-461190079431
    9518045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    Create serviceManager
    crm.service.ejbimpl.ServiceManagerBeanEOImpl_ServiceStub@-461190079431951804
    5S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome_EO [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/258

    Contact support.
    Yuan Ming Lei wrote:
    Hi All,
    I got a big head ache of this problem for several days, much appreciated if
    I can get help from you.
    The problem is, I wrote an EJB and already deployed it into Weblogic5.1. I
    also wrote a java EJB client to access this EJB. Everything seemed ok at
    this moment.
    The problem occured after i convert this EJB client to ActiveX and test it
    with Microsoft ActiveX Control Test Container. I log each step in the
    ActiveX, and find the problem is caused by
    javax.rmi.PortableRemoteObject.narrow(). Below is my source code and log
    information. My environment is Server side(weblogic5.1),Client side(java
    run-time3.1 with plug-in).
    Source code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFacto
    ry");
    env.put(Context.PROVIDER_URL,"t3://"+ip+":"+port);
    try{
    Log("Init jndi ");
    InitialContext ctx = new InitialContext(env);
    Log("Search Home ");
    Object obj = ctx.lookup("ServiceManagerHome");
    Log("home is "+obj);
    Log("narrow from "+obj.getClass().getName());
    Log("narrow to "+ServiceManagerHome.class.getName());
    obj = PortableRemoteObject.narrow(obj,ServiceManagerHome.class);
    Log("narrow home is "+obj);
    serviceHome = (ServiceManagerHome)obj;
    Log("cast home"+serviceHome);
    serviceManager = serviceHome.create();
    Log("Create EJB bean "+serviceManager);
    } catch (Exception e){
    Log("Err-"+e);
    Log("Err-"+e.getLocalizedMessage());
    Log("Err-"+e.getMessage());
    Log information for ActiveX:
    Init jndi
    Search Home
    home is ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    narrow from rm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    Err-java.lang.ClassCastException
    Err-null
    Err-null
    Log information for java EJB Client:
    Init jndi
    Search Home
    home is
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    narrow from crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    narrow home
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    cast
    homecrm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-461190079431
    9518045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    Create serviceManager
    crm.service.ejbimpl.ServiceManagerBeanEOImpl_ServiceStub@-461190079431951804
    5S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome_EO [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/258

  • JNDI Lookup of ConnectionFactory fails from inside Glassfish application

    This may very well end up being a glassfish specific question.
    I've got a stand-alone WAR using JSF, where I have a backing bean use some helper objects that will send a JMS message. When this WAR is running from inside of Glassfish, it fails to do the lookup of the ConnectionFactory.
    The application pulls the Queue JNDI and the Provider URL from a database, and uses a env Hashtable to do the JNDI InitialContext (which succeeds.) Using this Context, the ConnectionFactory lookup fails.
    The remote server in this instance is WebLogic 9.2 (the JNDI is publically available with no user authentication, verified with a JMS developer tool we use internally.)
    Here's the stacktrace...
    2007-10-15 19:48:04,514 ERROR [net.acadiasoft.shared.jms.util.JMSSenderHelper:130] NamingException: messageFactory not found
    javax.naming.NameNotFoundException: messageFactory 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.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.getConnectionFactory(JMSSenderHelper.java:128)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.init(JMSSenderHelper.java:58)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.<init>(JMSSenderHelper.java:36)
    at net.acadiasoft.web.shared.jms.util.AdminJmsHelper.<init>(AdminJmsHelper.java:19)
    at net.acadiasoft.web.server.pages.SchedulerBackingBean.deleteJobs(SchedulerBackingBean.java:75)

    I've found the problem, and it's something I simply overlooked. I don't know why I didnt realize, but i was setting the java.naming.factory.initial env variable to what Glassfish uses, not WebLogic.

  • JNDI and Tomcat

    Alright. I'm new using JNDI, but i get all the Context, Binding, lookup operations and rellated issues.
    But, I need to connect to a server who has Tomcat using JNDI. (A high-school homework)
    In a manner of fact, I need to create 2 subcontext an in the last one I need to bind a name with a reference to cmd.exe (it seems that I need to execute it), all of it using Tomcat's JNDI connection capabilities.
    but when I'm trying to Construct the Initial Context reference, I'm not doing it in the right way... this is my Hashtable:
    Hashtable env = new Hastable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, //I don't know what the hell goes hereApparentntly from web examples I have seen, It's the Implementation of the JNDI SPI from the Service Provider I want to connect... I really don't know which one to put when using Tomcat, or find other one.
    I read in the HOW-TO section in the apache site, but find nothing...
    or didn't get the idea, I saw they only get the container like this:
    Context ct = new InitialContext();
    with no arguments... but I also tryed to do it that way, but the same NamingException is thrown, with the message that I need to psecify the context factory. Well. I hope it's clear my trouble, and any of you would help me.
    Not reporting anything else. Thanks.

    Hello,
    have you check the following link
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html
    excerpts
    Tomcat 5 provides a JNDI InitialContext implementation instance to web applications running under it, in a manner that is compatible with those provided by a Java2 Enterprise Edition application server. Entries in this InitialContext are configured in the $CATALINA_HOME/conf/server.xml file, and may be referenced by the following elements in the web application deployment descriptor (/WEB-INF/web.xml) of your web application:
    used the resource file <resource-env-ref> , do not harcdode your jndi.properties
    basic data source factory
    <org.apache.commons.dbcp.BasicDataSourceFactory>
    and bean factory
    org.apache.naming.factory.BeanFactory
    thaks

  • Application specific key-value pairs in jndi.properties

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

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

  • What is the "JNDI Model"?

    I noticed in the API's for WL 6 for T3Connections that the methods are
    deprecated and we should use the JNDI Model.
    I do not see any BEA doc's covering the JNDI Model and how to use it
    effectively and how to properly clean up resources when my GUI
    application is done using those JNDI resources (i.e. releasing them
    properly).
    Can someone point me to the right docs?
    Thanks

    The JNDI model is an implicit model for establishing a connection with the
    server by creating the JNDI InitialContext in the client program. To my
    knowledge, there is no equivalent mechanism to the T3Connection
    functionality of getting a callback when the connection is closed...
    Tom Gerber wrote:
    I noticed in the API's for WL 6 for T3Connections that the methods are
    deprecated and we should use the JNDI Model.
    I do not see any BEA doc's covering the JNDI Model and how to use it
    effectively and how to properly clean up resources when my GUI
    application is done using those JNDI resources (i.e. releasing them
    properly).
    Can someone point me to the right docs?
    Thanks

  • Registering standalone RMI server in WebLogic JNDI

    Hi,
    I need to register a standalone RMI server in WebLogic JNDI. I'm sure I've done this before, but now I'm having problems!
    I have a standalone program which creates a remote object (implements Remote and extends UnicastRemoteObject). I am compiling my stubs with the Sun rmic compiler. I then create a JNDI InitialContext using wlclient.jar and a t3 url, and attempt to bind my remote object. It fails with the following exception:
    javax.naming.NamingException: Unhandled exception in rebind() [Root exception is org.omg.CORBA.MARSHAL:   vmcid: 0x0  minor code
    : 0  completed: No]I am using WLS 8.1sp4 and Sun JDK 1.4.2_05 (as shipped with WLS).
    If I use the RMI registry (Naming.bind(), etc.) it works fine.
    Thanks
    Dan.

    Danny Yates <> writes:
    You should use PortableRemoteObject and generate iiop ties for your
    impl. wlclient.jar runs on top of iiop.
    andy
    Hi,
    I need to register a standalone RMI server in WebLogic JNDI. I'm sure I've done this before, but now I'm having problems!
    I have a standalone program which creates a remote object (implements Remote and extends UnicastRemoteObject). I am compiling my stubs with the Sun rmic compiler. I then create a JNDI InitialContext using wlclient.jar and a t3 url, and attempt to bind my remote object. It fails with the following exception:
    javax.naming.NamingException: Unhandled exception in rebind() [Root exception is org.omg.CORBA.MARSHAL:   vmcid: 0x0  minor code
    : 0  completed: No]I am using WLS 8.1sp4 and Sun JDK 1.4.2_05 (as shipped with WLS).
    If I use the RMI registry (Naming.bind(), etc.) it works fine.
    Thanks
    Dan.

  • JMS adapter : Where is JNDI user administered ?

    Hi all, we are testing a JMS adapter in a PI7.1 (no eHp).
    The JMS adapter needs a JNDI user and
    password for JNDI lookups by remote clients.
    I'm puzzled about the administration of this JNDI user.
    My question :
    can this user-ID be just any userID in the system ?
    or is it a user ID that is indicated in the Visual Admin ? if so, where ?
    if it can be any user, what rights does it need for a JNDI lookup ?
    Or (shudder...) should I really start editing XML property files ??
    Regards,
    Ronald van Aalst
    TNT Post

    Hello,
    You can see the explanation per sap note below:
    #856346 - J2EE JMS Adapter: Frequently Asked Questions (FAQ)
    2.6) I am connecting to a JMS provider using JNDI mode. How do I add pass an extra name,value property pair while setting up the JNDI initial context?
    Answer: Assuming that your property value is a string, please add the following name, value pair in "JMS Additional properties" table of your channel configuration:
    JNDI.InitialContext.property.X=java.lang.String propertyName,
    java.lang.String propertyValue
    where X is a number, the LHS part needs to be put in the name column and the RHS part in the value column of the table respectively.
    BR,
    Franklin

  • Is JNDI thread-safe?

    Hello
    I have a class that contains a class member representing a JNDI InitialContext.
    1)Is JNDI thread-safe?
    2) Is this documented somewhere?
    Thanks

    Hi
    You can have a look at:
    http://java.sun.com/products/jndi/tutorial/beyond/misc/sync.html
    -Sankar.

Maybe you are looking for

  • "position:relative" in jsp

    I have a html file in which I have a scrolling table with a fixed header. I achieve this by CSS and adding the attribute "position:relative" for the table header. I open it in IE6 and I have my functionality with the table body scrolling and the head

  • Java code running as background process in Linux causes high CPU util.

    I'm running a piece of java code as a background process in Redhat 7.1 . When I specify to run it as a background process (using the '&') at the command line, I get CPU utilization at around 5% and it dips. When I edit the script that runs the java c

  • Hide show sections in pdf

    I have a form which is quite long and not all fields are needed for all the users who review the form. I am pretty new to Acrobat and have no programming knowledge - however, I was wondering if there is a tutorial that I can use to learn how to hide

  • Passport will mount on my desktop, but cannot access drive( read/write/copy/move) Yosemite MBP 2007

    I have an older MacBook Pro (2007-2008) running the most current version of Yosemite. I just purchased my drive recently, but didn't try to use it till the other day. The drive mounts on my desktop, but I cannot copy files to it at all. When I try to

  • Dependent choice list with Idoc Script

    Hi, I'm developing a customized component and I have made my own template. This is made in *.hcst* extension. I use 3 variables dependent (they are choice lists), If I put these variables in a checkin profile everything is O.K., but the problem I hav