On 3/23/07, Randy H <[EMAIL PROTECTED]> wrote:

Hi:
  I'm trying to create a SeviceMixClient using the unaltered code snippet
provided in the Client API section of the ServiceMix "Documentation" info
(Features - Client API section) currently on the Apache ServiceMix web site:

ClientFactory factory = new
InitialContext().lookup(ClientFactory.DEFAULT_JNDI_NAME);
ServiceMixClient client = factory.createClient();
...
client.close();

When I try to execute this code I get the following exception on the
InitialContext().lookup call:
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:247)
        at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.lmco.ctest.main(ctest.java:28)

Has anybody else been able to do this successfully?  I have the ServiceMix
server running when I ran the test.

It looks to me like you haven't configured JNDI for the client. There
are many examples in the ServiceMix source of how to configure the
cilent JNDI by placing a jndi.properties and jndi.xml file in the
src/test/resources directory. Take a look at the servicemix-http
source here:

http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/test/resources/

Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Reply via email to