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
Similar Messages
-
JNDI Connections Hang Under Load. Is this a bug ??
Hi
We are using Oracle application server and the Oracle Directory Server. I have a simple servlet making JNDI calls to fetch an attribute, under load JNDI calls are hanging creating a large back log of threads that won't go away till the application server crashes. We are using the Sun Hotspot VM 1.3 on Solaris.
I noticed on this forum that several other people have had this problem. Is this jndi limitation or bug ? Is there a known fix for the problem ? It looks like under load even though directory server is up and running alright, serveral JNDI threads hang waiting on a monitor.
thanks in advance
Raghu ..Hi Raghu,
I'm interested in this issue. I wanted to know a few things
1. Are you using a pool of servlet instances or a single instance for all requests.
2.In your servlet are you directly calling the jndi lookup, if so can u pl.provide a snap shot code of that.
3.What is the load, at which your application getting failed.
4.Have you implemented any thread safe mechanisms like implementing SingleThreadModel, or using synchronized service method(which actually should not be done)....
let me know the above details,,
Thanks -
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, AlexanderHi,
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 -
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,
ArneHi 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 Lookup hangs with AppServer 8
Hi,
I created a simple SessionBean on Sun One AppServer 8.
I wrote a standalone application that you can find below. What is does is in a loop, create an initial context and lookup the EJB.
The problem is that after a few iterations, it hangs.
I realized that the number of iterations is equal to half the size of the thread pool.
What am I doing wrong here? I used the same example on AppServer 7 and it works fine.
Thanks for your help
Jean-Noel Colin
package be.oxys.test;
import javax.naming.*;
import javax.ejb.*;
import java.util.Properties;
import javax.rmi.*;
* @author jnc
public class TestDummySessionBean {
/** Creates a new instance of TestDummySessionBean */
public TestDummySessionBean() {
public void getHelloFromBean(){
EJBHome home = null;
InitialContext context = null;
Object objref = null;
try {
for(int i = 1; i<110;i++) {
context = new InitialContext();
System.out.println("Done with InitialContext " + context.toString());
System.out.println("In the the loop. Loop no = " + i);
objref = context.lookup("corbaname:iiop:arwen:13700#SessionEJBSession");
System.out.println("Done with Lookup " + context.toString());
context.close();
} // end of for loop
context.close();
} catch (Exception e) {
System.out.println("Exception is " + e.getMessage());
e.printStackTrace();
} // end of try-catch
* @param args the command line arguments
public static void main(String[] args) {
TestDummySessionBean myObject = new TestDummySessionBean();
myObject.getHelloFromBean();
}context.lookup("corbaname:iiop:arwen:13700#SessionEJBSession");Is it necessary to lookup everytime? You can cache the object and just retrieve it.
***Annie*** -
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. -
Hello, below is the piece of code which i am trying.
String server = System.getenv("NNM_HOSTNAME"); //host where jboss is running
String nnmiprotocol = System.getenv("NNM_PROTOCOL"); //http default
String nnmi_port = System.getenv("NNM_PORT"); //80 default
final Hashtable<Object, Object> env = new Hashtable<Object, Object>();
env.put(Context.PROVIDER_URL, nnmiprotocol+"://"+server+":"+nnmi_port+"/invoker/restricted/JNDIFactory");
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
env.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.SECURITY_PROTOCOL, "nnm");
env.put(Context.SECURITY_PRINCIPAL, m_jUsername);
env.put(Context.SECURITY_CREDENTIALS, m_jPasswd);
env.put("jnp.disableDiscovery", "true");
ic = new InitialContext(env); //hangs here
When i try this on Linux RHEL 6.4 machine it works fine. But when i try the same on Windows Server 2008 it hangs. When i searched online about this, i found that all the classes mentioned in "env" should be part of class path. I have all of them in java class path. I am using JDK 1.7. What could be the issue ?Hello, below is the piece of code which i am trying.
String server = System.getenv("NNM_HOSTNAME"); //host where jboss is running
String nnmiprotocol = System.getenv("NNM_PROTOCOL"); //http default
String nnmi_port = System.getenv("NNM_PORT"); //80 default
final Hashtable<Object, Object> env = new Hashtable<Object, Object>();
env.put(Context.PROVIDER_URL, nnmiprotocol+"://"+server+":"+nnmi_port+"/invoker/restricted/JNDIFactory");
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
env.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.SECURITY_PROTOCOL, "nnm");
env.put(Context.SECURITY_PRINCIPAL, m_jUsername);
env.put(Context.SECURITY_CREDENTIALS, m_jPasswd);
env.put("jnp.disableDiscovery", "true");
ic = new InitialContext(env); //hangs here
When i try this on Linux RHEL 6.4 machine it works fine. But when i try the same on Windows Server 2008 it hangs. When i searched online about this, i found that all the classes mentioned in "env" should be part of class path. I have all of them in java class path. I am using JDK 1.7. What could be the issue ? -
Hi:
i have an EJB client that tries to acces an EJB from another instance, the problem is
that the clients hangs while doing the jndo lookup.
her is where i try to get the context
public static Context getInitialContext() throws NamingException
System.out.println("Inicio - getInitialContext");
Hashtable env = new Hashtable();
// Oracle Application Server 10g connection details
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "sec");
env.put(Context.SECURITY_CREDENTIALS, "sec");
env.put(Context.PROVIDER_URL, "opmn:ormi://198.186.1.75:edeclarador/eDeclarador");
env.put("dedicated.rmicontext", "true");
System.out.println("Ambiente : "+env.toString());
return new InitialContext(env);
and here i do de lookup
Context context = getInitialContext();
ComunHome comunHome = (ComunHome)PortableRemoteObject.narrow(context.lookup("Comun"), ComunHome.class);
and it hangs :(
Any help would be nice.hi:
With the help found on this forum and that link:
http://matrix.csustan.edu/docs/oracle/oas/web.1012/b14012/ormi.htm
i solved my problem. when i turn on the rim debug and rmi vervose y found that
it hangs because it lookup to port 6000 and the rmi server port was listening on another.
On OAS i used opmnctl to Show the Selected RMI Port:
Processes in Instance: core817.dsunrdb22.us.oracle.com
----------------------------------------------+ ... +------
ias-component | process-type | pid | ... | ports
----------------------------------------------+ ... +------
WebCache | WebCacheAdmin | 28821 | ... | administration:4000
WebCache | WebCache | 28820 | ... | statistics:4002,invalidation:4001,http:7777
OC4J | home | 2012 | ... | iiop:3401,jms:3701,rmi:3201,ajp:3000
HTTP_Server | HTTP_Server | 28818 | ... | http2:7200,http1:7778,http:7200
dcm-daemon | dcm-daemon | 28811 | ... | N/A
LogLoader | logloaderd | N/A | ... | N/A
and i put the port in the PROVIDER URL and it works!
Saludos! -
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? :)
ZZac1234
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 possibleMaybe this resoruce will be helpful.
-
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]/258Contact 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.
-
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
VasimWe 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
Maybe you are looking for
-
Payroll results could not be imported/Error in Finance Posting of Payroll
Hi friends, Please help me. I have created three wage types 2001-Basic Pay 2002-HRA 2003-Conveyance When I generated remuneration statement all these three wage types where displayed along with EE EPF contribution and VPF contribution which I have as
-
I have an airport extreme. i am trying to connect a laptop with windows 7 to a wireless printer, with no luck. any ideas?
-
Vista Business 64-bit on ALL Macs with Bootcamp 2.1
*With the latest Boot Camp Update 2.1 for Windows Vista 64, can ALL Macs (shipping as of May 2008) run Windows Vista Business 64-bit* (Business version is preferred for professional CAD applications)? http://www.apple.com/support/downloads/bootcampup
-
Hello, Dos somebody know how to find possibility of manual data change in the planning layout of SEM-BPS? Thanks for answers.
-
This regarding cheque printing with advice
hi experts This regarding cheque printing with advice i am using standard driver progarm : RFFOUS_C standard layout :F110_MX_CHEQUE(which is modified as per clients layout) In advice the line items (i.e) inv no ref no inv