users@glassfish.java.net

Re: NoInitialContextException

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 27 May 2009 01:19:14 +0530

That class is there in modules/glassfish-naming.jar. So, something else
is going wrong here. It appears that GlassFish naming manager is not
currently designed to work in an OSGi environment. Did you do a new
InitialContext() in your code? If yes, as a work around, just try doing
a *new InitialContext(env)* where env contains the property name/value pair.

Sahoo

Annies wrote:
> I have bundle that does some JNDI lookup. This used to work fine in V3
> until recently.
> Before using build 47, I used to set this property in Felix
> system.properties
> java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory
>
> The class SerialInitContextFactory is not included in latest builds.
> How should I fix this?
>
>
> [#|2009-05-26T12:17:57.375-0700|WARNING|glassfish|com.sun.jbi.sun-database-binding.org.glassfish.openesb.databasebc.OutboundMessageProcessor|_ThreadID=28;_ThreadName=Thread-1;|Failed
> to write message:.
> javax.naming.NoInitialContextException: 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
> at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
> at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
> at
> javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at
> org.glassfish.openesb.databasebc.OutboundMessageProcessor.getDataSourceFromContext(OutboundMessageProcessor.java:1289)
> at
> org.glassfish.openesb.databasebc.OutboundMessageProcessor.getDatabaseConnection(OutboundMessageProcessor.java:1316)
> at
> org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOnly(OutboundMessageProcessor.java:1079)
> at
> org.glassfish.openesb.databasebc.OutboundMessageProcessor.execute(OutboundMessageProcessor.java:273)
> at
> org.glassfish.openesb.databasebc.OutboundMessageProcessor.run(OutboundMessageProcessor.java:164)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:637)
> |#]
>