BTW, this is not a classpath issue. I successfully instantiated
weblogic.jndi.T3InitialContextFactory using CFOBJECT and called toString()
on it.
Jason
-----Original Message-----
From: Southern, Jason
Sent: Monday, September 10, 2001 5:47 PM
To: '[EMAIL PROTECTED]'
Subject: Problem with JNDI and EJBs in CF4.5
I am getting some strange behavior when attempting to instantiate a class
using CFOBJECT that does a JNDI lookup to obtain the remote interface for a
Session EJB. The JNDI lookup is done by obtaining an InitialContext from
the EJB container (WebLogic 6.1 in my case) and then performing a lookup.
The problem is that the constructor that performs this lookup encounters an
exception when attempting to obtain the InitialContext from WebLogic. To
make things more interesting, the problem only occurs when the class is
loaded by a template running in ColdFusion Application Server on the same
box as the EJB container. If I move the code to a different ColdFusion
server, the code works fine.
Any one run into this? Will upgrading to 4.5.1 SP2 help?
CF Version: 4.5.1 SP2 (Enterprise Version)
OS: Windows 2000 Advanced Server SP1
Here's the exception:
javax.naming.NoInitialContextException: Cannot instantiate class:
weblogic.jndi.T3InitialContextFactory. Root exception is
java.lang.ClassNotFoundException: weblogic/jndi/T3InitialContextFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at
com.govolution.transactionengine.client.TransactionSessionControllerRMIImpl.
<init>(TransactionSessionControllerRMIImpl.java:42)
Here's some sample Java code from the constructor:
public TransactionSessionControllerRMIImpl(String username, String password,
String providerURL) {
Properties props = System.getProperties();
props.put(Context.SECURITY_PRINCIPAL, username);
props.put(Context.SECURITY_CREDENTIALS, password);
props.put(Context.PROVIDER_URL, providerURL);
props.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.T3InitialContextFactory");
InitialContext initial = new InitialContext(props); << Exception occurs
here.
...
}
Here's the snippet of CF code I am using to instantiate the class
<CFOBJECT ACTION="CREATE" TYPE="Java" NAME="objSessionController"
CLASS="TransactionSessionControllerRMIImpl">
<CFSCRIPT>
intReturnVal = objSessionController.init("XXXX", "XXXX", "XXXX");
</CFSCRIPT>
TIA,
Jason
========================================
Jason Southern
Sr. Software Architect
Govolution ~ http://www.govolution.com
202.466.0505 x237
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com