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.

Similar Messages

  • Unable to find the default jndi

    Hi,
    Recently I have installed Coldfusion 8 and deployed the
    CFIDEover the weblogic 9.2 server. I operate on UNIX solaris. BUt
    everytime I bounce the server I see thi s message in the logs
    JRun JDBC was unable to locate a default JNDI
    provider..Failed to bind coldfusion/datasource/catalog: null
    Catalog is name of one of my datasources. I am new to
    coldfusion but I have followed the installation doc well.But I am
    sure missing something. I have creaed all th datasources in CF8
    administrator also. Please advise. Thanks
    The Log file aslo has this message
    <ClassLoader><W>Error initializing pre-processor
    class
    weblogic.diagnostics.instrumentation.DiagnosticClassPreProcessor
    java.lang.ClassCastException:
    weblogic.diagnostics.instrumentation.DiagnosticClassPreProcessor
    at
    weblogic.utils.classloaders.GenericClassLoader.initializePreProcessor(GenericClassLoader. java:619)
    at
    weblogic.utils.classloaders.GenericClassLoader.init(GenericClassLoader.java:126)
    at
    weblogic.utils.classloaders.GenericClassLoader.<init>(GenericClassLoader.java:120)
    at
    weblogic.utils.classloaders.GenericClassLoader.<init>(GenericClassLoader.java:110)
    at
    weblogic.utils.classloaders.GenericClassLoader.getAugmentableSystemClassLoader(GenericCla ssLoader.java:726)
    at
    weblogic.rmi.internal.ClientRuntimeDescriptor.<clinit>(ClientRuntimeDescriptor.java:51)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.ja va:180)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
    at
    javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at
    javax.naming.InitialContext.<init>(InitialContext.java:175)
    at
    coldfusion.server.j2ee.sql.pool.JDBCPool.deployDataSource(JDBCPool.java:155)
    at
    coldfusion.server.j2ee.sql.pool.JDBCPool.init(JDBCPool.java:130)
    at
    coldfusion.server.j2ee.sql.pool.JDBCPool.<init>(JDBCPool.java:81)
    at
    coldfusion.server.j2ee.sql.pool.JDBCManager.createPool(JDBCManager.java:50)
    at
    coldfusion.sql.CFPooledDataSource.setDatasource(CFPooledDataSource.java:289)
    at
    coldfusion.sql.CFPooledDataSource.newDataSource(CFPooledDataSource.java:221)
    at
    coldfusion.sql.DataSourceFactory.createDataSource(DataSourceFactory.java:102)
    at
    coldfusion.sql.DataSourceFactory.setDataSource(DataSourceFactory.java:134)
    at coldfusion.sql.Executive.load(Executive.java:161)
    at coldfusion.server.ServiceBase.start(ServiceBase.java:59)
    at coldfusion.sql.Executive.start(Executive.java:75)
    at coldfusion.server.CFService.setupSql(CFService.java:131)
    at coldfusion.server.CFService.start(CFService.java:479)
    at
    coldfusion.server.j2ee.CFStartUpServlet.startCFService(CFStartUpServlet.java:109)
    at
    coldfusion.server.j2ee.CFStartUpServlet.init(CFStartUpServlet.java:85)
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at
    coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:94)
    at
    coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
    at
    weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.jav a:278)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at
    weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
    at
    weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java: 58)
    at
    weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
    at
    weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:507)
    at
    weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1 723)
    at
    weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext .java:1700)
    at
    weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java :1620)
    at
    weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2761)
    at
    weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:889)
    at
    weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
    at
    weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at
    weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at
    weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at
    weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at
    weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java :117)
    at
    weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at
    weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at
    weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at
    weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
    at
    weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
    at
    weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at
    weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
    at
    weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java :154)
    at
    weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.ja va:80)
    at
    weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:181)
    at
    weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDe ployment.java:358)
    at
    weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java :52)
    at
    weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:186 )
    at
    weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at
    weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeploy ments.java:233)
    at
    weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments. java:169)
    at
    weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.ja va:123)
    at
    weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerServic e.java:173)
    at
    weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService .java:89)
    at
    weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at
    weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Hi Chimbu,
    First of all create the new Essbase Server for the corresponding admin server.
    And named the Essbase server as LocalHost.
    Note one admin server can have multiple Essbase server
    Thanks And Regards
    Saru

  • WL 4.5.1 JNDI defaults,JNDI lookup with multiple environments etc..

    The WL4.5 docs, state that if "java.naming.provider.url" is not
    explicitly provided
    (either during the JVM start or in the InitialContext), the WL will
    default to
    "t3://localhost:7001".
    Q1) If server is listening on a different port, shouldn't we explicitly
    specify the
    "-Djava.naming.provider.url=t3://theServerIP:theServerPort" during the
    WL JVM
    start-up. If we don't, how would the naming lookup work, when there is
    no naming
    service on the "localhost:7001"
    In the real life, usually there are several (usually identical) copies
    of the WL server
    instances running in (DEV/TEST/QUAL environments. Assume that all
    servers are
    on the same network and have the same EJBs deployed (using the same home
    names).
    Q2) Does each WL instance have its own naming service running? (assume
    yes)
    Q3) If no WL instances listen on 7001, what happens with Q1?
    Q4) If client specifically sets the TEST server IP:port for the
    "java.naming.provider.url", would TEST naming service first lookup its
    own tree and
    then, if object does not exist ask other naming services (assume yes ...
    how is this
    set-up, how do the WL naming services discover each other)
    Q5) How many naming services would run if all WL instances are running
    on the
    same machine using different listen ports? (assume N)
    Darko Bohinc
    Consultant - Synergy International Limited
    Level 7, Synergy House, 131 Queen Street, PO Box 7445 Wellesley Street,
    Auckland, NZ
    Phone: +64 9 3772400
    Fax: +64 9 3772444
    URL: http://www.synergy.co.nz

    No,version 4.5 is built to the 1.1 API.
    Version 1.5 is updated to JNDI 1.2.
    Thanks,
    Michael
    Michael Girdley
    BEA Systems Inc
    <[email protected]> wrote in message news:[email protected]..
    Hi All
    I have been using WL 4.5.1 for a while with JNDI 1.1.2 which are
    included in weblogicaux.jar.
    Can I use JNDI 1.2.1 with WL 4.5.1 by overriding the default 1.1.2 ?
    If so, how do I do it?
    Thanks
    Madhu

  • 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

  • Default JNDI server question.

    Does Java standard/ee from Sun come with
    a default JDNI server program,
    upon which to perform
    naming.rebind
    ?

    Naming.rebind() is not a JNDI operation. It is an RMI Registry operation. Java comes with an rmiregistry.exe program, and you can start it in-process too: see java.rmi.registry.LocateRegistry.createRegistry().

  • 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

  • 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

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

  • Crazy JNDI Problem... (Third Party DB Driver Effects Lookup???) (OAS 10g)

    Ok folks, I need some help here...
    The scenario is this...
    I have a simple web app (one jsp) which is used as a "status checker" to ensure that all the session beans we expected to be deployed are actually deployed and that they can be looked up with JNDI and run some small status routine... That war file for that app is included in the ear file with all of the session ejb jar deployments...
    Now, the collection of session beans references three different datasources at one time or another... 2 of which are oracle databases and 1 is a DB2 database...
    Lets name them as follows...
    OracleDataSource1
    OracleDataSource2
    DB2DataSource
    Now, if I configure the three datasources in the oracle standalone OC4J 10g datasource file and deploy the ear file to standalone OC4J 10g, all of the lookups work, and it successfully uses the datasources... no problems at all...
    Ok, so now I try to deploy the ear on OAS 10g using the enterprise manager console, and deployment works fine...
    If I run the app before configuring the datasources, of course the lookups work, but the status routines of certains beans fail because they are not able to look up the datasources... no big deal, just start adding the datasources...
    I configure OracleDataSource1 and rerun... now things still work, the lookups for all the beans works fine, and some pass now, but others still want the other datasources...
    Now configure OracleDataSource2 and rerun... as before, things all work great but there are still complaints looking for the DB2DataSource from a couple of the routines...
    Herein lies the problem...
    I configure DB2DataSource and rerun, and boom, my program crashes claiming that the lookup of the bean failed...
    Now mind you, these beans have all been looked up numerous times during previous runs, and absolutely nothing has been changed with the application... in fact, even the beans that wanted the DB2DataSource were looked up successfully and then just complained of no datasource during their status routine execution...
    It's just that once I configure the DB2DataSource, all of a sudden my lookups don't work... I have tried commenting out a couple of the beans, and regardless of which lookups are commented out, it still fails saying it can't find any of the beans, even if the beans i'm trying to look up don't use the DB2DataSource, it doesn't seem to matter...
    The InitialContext used for the lookup uses the default "new InitialContext()" constructor and the lookups work fine when the DB2DataSource is not configured, but once it is, the lookups fail saying the objects are not found...
    I have consulted with a few other developers here, and noone can seem to understand why this behavior is happening... I have added debugging statements to print the contents of the context's environment, and it is always empty regardless of whether the lookups pass or fail...
    The ONLY difference I can see with this DB2DataSource is that it uses an external 3rd party driver... The oracle connections use a driver which was packaged with the OAS installation... I feel pretty strongly that it has to do with the driver because if I have the DB2DataSource configured (causing the failure) and then I edit that datasource to say that it should us the oracle driver, miraculously it causes the lookups to work again, except now I get the error saying the oracle driver doesn't like my DB2 jdbc url...
    I'm sorry for the long post, but I'm hoping that at least one person has encountered this before... I cannot think of any reason why the configuration of that datasource with the third party driver would cause these problems, especially when the exact same configuration and setup DOES work with standalone OC4J 10g, even with the DB2DataSource configured... ????? And the fact that the lookups work fine until that datasource is configured really blows my mind... i wouldn't think the datasource configuration should have anything to do with whether the lookups of the session beans succeed or not... hahaha...
    Any help would be great... I'm pullin my hair out here... :)
    Thanks,
    -Garrett

    No, I have not asked on the oracle forums yet... :)
    It seems that the cause is the driver itself... if I set a different driver for the datasource configuation, the lookups work but it just complains about the driver not being correct for the individual beans...
    I have found some documentation claiming that there is an OAS version of the DB2 driver, as well as a Merant version, but I can't seem to find jar files for either...
    Does anyone know where I can download the "YMdb2.jar" file? Supposedly this contains the DB2 DataDirect driver that I need...
    Thanks,
    -Garrett

  • JNDI lookup for external SessionBean fails

    Hello, i have a problem i've been trying to solve all day and would appreciate it if you could help me.
    I have an Ear file with an EJB Session Bean(EAR: EigenlijstenEar/EJB: EigenlijstenEJB) which i am attempting to use in a servlet in another web/ear (Web: HagaPortalWeb/EAR: HagaPortalEar). I have read and followed the guidance of http://help.sap.com/saphelp_nw04/helpdata/en/55/29ed5eff965448941c0b42f01b9804/frameset.htm, but to no avail.
    The error i get is: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name webContainer/applications/hagaziekenhuis.nl/HagaPortalEar/HagaPortalWeb/java:comp/env/ejb/EigenlijstenSessionBean, cannot resolve object reference. [Root exception is com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at EigenlijstenEar, the whole lookup name is localejbs/hagaziekenhuis.nl/EigenlijstenEar/EigenlijstenSessionBean.]
    my lookup code in a servlet in HagaPortalWeb:
    Context ctx = new InitialContext();
    EigenlijstenSessionLocalHome eigenlijstenHome =
         (EigenlijstenSessionLocalHome) ctx.lookup(
                             "java:comp/env/ejb/EigenlijstenSessionBean");
    content of my web.xml in HagaPortalWeb:
         <ejb-local-ref>
              <ejb-ref-name>ejb/EigenlijstenSessionBean</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>nl.hagaziekenhuis.medisurf.ejbs.eigenlijsten.EigenlijstenSessionLocalHome</local-home>
              <local>nl.hagaziekenhuis.medisurf.ejbs.eigenlijsten.EigenlijstenSessionLocal</local>
              <ejb-link/>
         </ejb-local-ref>
    content of my application-j2ee-engine.xml in Ear project HagaPortalEar:
         <reference
              reference-type="hard">
              <reference-target
                   provider-name="hagaziekenhuis.nl"
                   target-type="application">EigenlijstenEAR</reference-target>
         </reference>

    HI Arie,
    If you are accessing enterprise beans with J2EE clients (servlets, JSP, other enterprise beans, J2EE application clients), do not specify and use this arbitrary JNDI name. Instead, define EJB references in the clientsu2019 deployment descriptors and access the beans using these references. For more information, check the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/a0/019b3e25f95f14e10000000a114084/content.htm
    if the above does not work try the following:--
    Try to lookup the Ejb by its JNDI name given in the EJB-J2ee-engine.xml file if it does not exist there  give any valid name and try to lookUp.
    or try to lookup the ejb by its default jndi name.
    "localejbs/bean name>"
    http://help.sap.com/saphelp_nw04/helpdata/en/38/3e5a4201301453e10000000a155106/frameset.htm
    in the Above link refer the second option "Lookup from a Non-J2EE Java Application"
    Siddharth
    Edited by: Siddharth Jain on Aug 22, 2008 7:13 AM

  • What is the best way to deal with memory leak issue in sql server 2008 R2

    What is the best way to deal with memory leak issue in sql server 2008 R2.

    What is the best way to deal with memory leak issue in sql server 2008 R2.
    I have heard of memory leak in OS that too because of some external application or rouge drivers SQL server 2008 R2 if patched to latest SP and CU ( may be if required) does not leaks memory.
    Are you in opinion that since SQL is taking lot of memory and then not releasing it is a memory leak.If so this is not a memory leak but default behavior .You need to set proper value for max server memory in sp_configure to limit buffer pool usage.However
    sql can take more memory from outside buffer pool if linked server ,CLR,extended stored procs XML are heavily utilized
    Any specific issue you are facing
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

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

Maybe you are looking for