• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Glassfish InitialContext From App

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm moving from JBoss to GlassFish, and all I want to do is to have my local app get an InitialContext from my Glassfish running on my local machine. Defeat plagues me!

So, will anyone help me get the simple example below to work?
I think it would be a big help to all who follow.
My code now produces this error message:
ERROR: NoInitialContextException
Cannot instantiate class: com.sun.appserv.naming.S1ASCtxFactory

If my attemp seems dumb .. well obviously it is, because it doesn't work.
But it would still be helpful to many if it was made smart.
Thanks.

PS: getProp(String[] array) at the bottom just lets me use the cute way to show key:value prop pairs I'm using.


 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cannot instantiate class: com.sun.appserv.naming.S1ASCtxFactory



Do you have the jar file containing the com.sun.appserv.naming.S1ASCtxFactory class in the client's classpath? You will find that jar file somewhere in the Glassfish installation.
 
George Berish
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
No I Didn't have: com.sun.appserv.naming.S1ASCtxFactory
Now I do. For reference it lives in:{GlassfishServer Home}\lib\appserv-rt.jar

Now my program's printline outputs:
ERROR: RuntimeException
Cannot Proceed. No Endpoints specified.

And the System.err print stream outputs:
Sep 2, 2009 9:34:19 AM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
WARNING: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpoints.
Sep 2, 2009 9:34:19 AM com.sun.appserv.naming.RoundRobinPolicy getEndpointForProviderURL
WARNING: NAM1002 : Exception : (0) thrown for bad provider URL String: http://localhost:8080
Sep 2, 2009 9:34:19 AM com.sun.appserv.naming.S1ASCtxFactory getInitialContext
SEVERE: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpoints.


I looked up the first warning and found a suggestion that I needed to chage my URL property to:
FM: java.naming.provider.url=http://localhost:8080
TO: java.naming.provider.url=iiop://localhost:3700 [Also tried 8080 and 4848 with same result-failure]

That changed the System.err print stream output to:
Sep 2, 2009 9:46:22 AM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
WARNING: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpoints.
Sep 2, 2009 9:46:22 AM com.sun.appserv.naming.RoundRobinPolicy getEndpointForProviderURL
WARNING: NAM1001: No Endpoints selected in com.sun.appserv.iiop.endpoints property. Using JNDI Provider URL iiop://localhost:3700 instead
Exception in thread "main" java.lang.NoClassDefFoundError: javax/security/jacc/PolicyContextException
at com.sun.enterprise.security.SSLUtils.<clinit>(SSLUtils.java:102)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.<init>(IIOPSSLSocketFactory.java:182)


Now all I have it the "No Endpoints" warning. Anyone know what that is.

And the instruction to Using JNDI Provider URL iiop://localhost:3700 instead is confusing, because that is what I tried.

Help.
GLB
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic