Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> HELP! Stumped...

HELP! Stumped...

From: <nhomsany_at_my-deja.com>
Date: Thu, 15 Jul 1999 20:08:25 GMT
Message-ID: <7mlf3e$q5g$1@nnrp1.deja.com>


Hello,

I think I got one that could stump a bunch of ya... we'll see.

I wrote an EJB in JDev. 2.0 and deployed it. Worked well, no problems. Wrote a Client Snippet, worked well (never tested outside JDev.). Wrote a Client Applet, works very well INSIDE JDEV. 2.0, once I try to run it outside JDev, I get nothing but Exceptions.

SO, I tried deploying it to a jar, made sure to add all the propper .jar and .zip files and everything. I deploy it and run it inside IE 5.0 (using OBJECT instead of APPLET tags with the right java plug in etc.), that hangs. SO i use appletviewer to pick up the error messages and I get the stuff below (exception and stack trace at end of message).

java.naming.factory.initial (which is in the exception message) was new to me so I spent the last two days reading about JNDI etc, and found out that it is just an environment property for JNDI and that ORACLE does not use it once in any of its examples or anything.

I have been unable to local AURORA's version of its ContextFactory (I tried just about every class with the word Factory in it -- took forever), and none of those worked. To be exact I found one class that looked like it could have worked:
oracle.aurora.jndi.sess_iiop.sess_iiopURLContextFactory.class... I tried that, but that returned a ClassCastException.

So here's my synopsis: Inside JDEV for some reason the command:

Context ic= new InitialContext(environment);

works, as long as I specify a minimal number of environment properties: javax.naming.Context.URL_PKG_PREFIXES (which I set to, as Oracle says to do, oracle.aurora.jndi),Context.SECURITY_PRINCIPAL, Context.SECURITY_CREDENTIAL, and the NO_SSL one too. That works fine in JDEV, throws the exception (see below) outside of JDEV. If then try to specifiy a context factory (Context.INITIAL_CONTEXT_FACTORY constant) of the class type above I throw the exception shown above inside and outside of JDEV (i.e. in appletviewer). Here's where it gets weird:

If I use the above configuration that works in JDEV (no initial context factory environment setting) and try to print out via the list() method the context's bindings, I get the same exception that is seen below. SO the only time it works, is when I don't specify the initial context factory and I ONLY run it inside JDEV WITHOUT performing any actions on the instantiated context variable other than a lookup. REALLY WEIRD!

So please help ASAP, thanks.

Nadim Homsany
Systems Analyst

Message: Need to specify class name in environment or system property: java.naming.factory.initial

javax.naming.NoInitialContextException: Need to specify class name in environment or system property: java.naming.factory.initial

        at
javax.naming.spi.NamingManager.getDefaultInitialContextFactory(Naming Manager.java:688)

        at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:7

44)

        at javax.naming.InitialContext.getDefaultInitCtx
(InitialContext.java:181

)

        at javax.naming.InitialContext.getURLOrDefaultInitCtx
(InitialContext.jav

a:219)

        at javax.naming.InitialContext.lookup(InitialContext.java:288)
        at testejb.FirstEJBClientApplet.startEJB

(FirstEJBClientApplet.java:151)
at testejb.FirstEJBClientApplet.jbInit
(FirstEJBClientApplet.java:72)
at testejb.FirstEJBClientApplet.init
(FirstEJBClientApplet.java:61)
at sun.applet.AppletPanel.run(AppletPanel.java:357) at java.lang.Thread.run(Thread.java:479)

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jul 15 1999 - 15:08:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US