You have to configure the datasource to be visible externally.  By default
it is only visible internally, ie from a JSP page, servlet, or EJB in JRun.
I can't remember the name of the setting or the properties file it should go
in but if you go to allaire's knowledge base you should be able to find it.
Somebody else on the list may have it memorized.

-----Original Message-----
From: Simon Evans [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 3:36 PM
To: JRun-Talk
Subject: error getting datasource from client


i have a data source set up in jrun to sql server.

the test works fine and i can use it fine from a jsp page. however when an
external client program tries to look up the datasource. there is a
CommunicationException.

here is the exception, and then the code i used.
any help would be great.
simon


----------------------------------
exception
------------------------------------

javax.naming.CommunicationException: Failed to communicate with
NTSRVDEV02:8100.
Root exception is java.io.FileNotFoundException:
http://NTSRVDEV02:8100/reference at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at allaire.ejipt.ContextFactory.getInitialContext ContextFactory.java:108)
at javax.naming.spi.NamingManager.getInitialContext Unknown Source) at
javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at
javax.naming.InitialContext.init Unknown Source) at
javax.naming.InitialContext.<init>(Unknown Source) at
TestDB.main(TestDB.java:39)


---------------------------------------
code
----------------------------------------

Properties props = new Properties();
props.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"allaire.ejipt.ContextFactory");
props.put(InitialContext.SECURITY_PRINCIPAL, "admin");
props.put(InitialContext.SECURITY_CREDENTIALS, "admin");
props.put(InitialContext.PROVIDER_URL, "ejipt://myserver:8100");

ctx = new InitialContext(props);
DataSource ds = (DataSource)ctx.lookup("jdbc/simplydone");
c = ds.getConnection("developer", "developer");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to