Thanks for your post Bruce.
That fixed my first problem (getting the initial JNDI context).  Now I get
an exception on the JNDI lookup of the Client factory name ( lookup(
ClientFactory.DEFAULT_JNDI_NAME ) );

  The exception is (with accompanying log4j entries):

[ INFO] 2007-03-26 12:07:30,624 SpringInitialContextFactory.java:103 (main)
- Loading JNDI context from: class path resource [jndi.xml]
[ INFO] 2007-03-26 12:07:30,813 CollectionFactory.java:76 (main) - JDK 1.4+
collections available
[ INFO] 2007-03-26 12:07:30,828 CollectionFactory.java:80 (main) - Commons
Collections 3.x available
[DEBUG] 2007-03-26 12:07:30,844 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:30,844 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:30,860 CollectionFactory.java:98 (main) - Creating
[java.util.LinkedHashSet]
[DEBUG] 2007-03-26 12:07:31,017 PluggableSchemaResolver.java:91 (main) -
Loading schema mappings from [META-INF/spring.schemas].
[DEBUG] 2007-03-26 12:07:31,096 PluggableSchemaResolver.java:97 (main) -
Loaded schema mappings:
{http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
http://servicemix.apache.org/soap/1.0=servicemix-soap.xsd,
http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd,
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd,
http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd,
http://xbean.apache.org/schemas/server=xbean-server.xsd,
http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
http://jencks.org/2.0=jencks.xsd,
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
http://activemq.org/config/1.0=activemq.xsd,
http://servicemix.apache.org/config/1.0=servicemix.xsd,
http://xbean.apache.org/schemas/classloader=xbean-classloader.xsd,
http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd}
[ INFO] 2007-03-26 12:07:31,111 XmlBeanDefinitionReader.java:347 (main) -
Loading XML bean definitions from class path resource [jndi.xml]
[DEBUG] 2007-03-26 12:07:31,190 DefaultDocumentLoader.java:74 (main) - Using
JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
[DEBUG] 2007-03-26 12:07:31,976 DefaultNamespaceHandlerResolver.java:110
(main) - Loaded mappings
[{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler,
http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler,
http://activemq.org/config/1.0=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler,
http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler,
http://servicemix.apache.org/config/1.0=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler,
http://xbean.apache.org/schemas/server=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler,
http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler,
http://servicemix.apache.org/soap/1.0=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler,
http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler,
http://jencks.org/2.0=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler,
http://xbean.apache.org/schemas/classloader=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler,
http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler}]
[DEBUG] 2007-03-26 12:07:32,181 ClassUtils.java:128 (main) - Class
[groovy.lang.GroovyObject] or one of its dependencies is not present:
java.lang.ClassNotFoundException: groovy.lang.GroovyObject
[DEBUG] 2007-03-26 12:07:32,181 ClassUtils.java:128 (main) - Class
[org.jruby.IRuby] or one of its dependencies is not present:
java.lang.ClassNotFoundException: org.jruby.IRuby
[DEBUG] 2007-03-26 12:07:32,197 ClassUtils.java:128 (main) - Class
[bsh.Interpreter] or one of its dependencies is not present:
java.lang.ClassNotFoundException: bsh.Interpreter
[DEBUG] 2007-03-26 12:07:32,197 DefaultBeanDefinitionDocumentReader.java:83
(main) - Loading bean definitions
[DEBUG] 2007-03-26 12:07:32,291 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:32,370 DefaultSingletonBeanRegistry.java:137 (main)
- Creating shared instance of singleton bean 'jndi'
[DEBUG] 2007-03-26 12:07:32,370 AbstractAutowireCapableBeanFactory.java:341
(main) - Creating instance of bean 'jndi' with merged definition [Root bean:
class [org.apache.xbean.spring.jndi.SpringInitialContextFactory];
scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true;
autowireMode=0; dependencyCheck=0; factoryBeanName=null;
factoryMethodName=makeInitialContext; initMethodName=null;
destroyMethodName=null; defined in class path resource [jndi.xml]]
[DEBUG] 2007-03-26 12:07:32,385 AbstractAutowireCapableBeanFactory.java:587
(main) - Invoking BeanPostProcessors before instantiation of bean 'jndi'
[DEBUG] 2007-03-26 12:07:32,480 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:32,527 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:32,558 CachedIntrospectionResults.java:140 (main) -
Getting BeanInfo for class [org.apache.xbean.spring.jndi.DefaultContext]
[DEBUG] 2007-03-26 12:07:32,574 CachedIntrospectionResults.java:156 (main) -
Caching PropertyDescriptors for class
[org.apache.xbean.spring.jndi.DefaultContext]
[DEBUG] 2007-03-26 12:07:32,574 CachedIntrospectionResults.java:165 (main) -
Found bean property 'class' of type [java.lang.Class]
[DEBUG] 2007-03-26 12:07:32,590 CachedIntrospectionResults.java:165 (main) -
Found bean property 'entries' of type [java.util.Map]
[DEBUG] 2007-03-26 12:07:32,590 CachedIntrospectionResults.java:165 (main) -
Found bean property 'environment' of type [java.util.Hashtable]
[DEBUG] 2007-03-26 12:07:32,590 CachedIntrospectionResults.java:165 (main) -
Found bean property 'freeze' of type [boolean]
[DEBUG] 2007-03-26 12:07:32,590 CachedIntrospectionResults.java:165 (main) -
Found bean property 'nameInNamespace' of type [java.lang.String]
[DEBUG] 2007-03-26 12:07:32,606 CachedIntrospectionResults.java:86 (main) -
Class [org.apache.xbean.spring.jndi.DefaultContext] is cache-safe
[DEBUG] 2007-03-26 12:07:32,606 ConstructorResolver.java:292 (main) - Bean
'jndi' instantiated via factory method 'public static javax.naming.Context
org.apache.xbean.spring.jndi.SpringInitialContextFactory.makeInitialContext()'
[DEBUG] 2007-03-26 12:07:32,606 AbstractAutowireCapableBeanFactory.java:388
(main) - Eagerly caching bean of type
[org.apache.xbean.spring.jndi.DefaultContext] with name 'jndi' to allow for
resolving potential circular references
[DEBUG] 2007-03-26 12:07:32,621 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:32,637 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:32,653 CollectionFactory.java:122 (main) - Creating
[java.util.LinkedHashMap]
[DEBUG] 2007-03-26 12:07:32,668 BeanWrapperImpl.java:783 (main) - About to
invoke write method [public void
org.apache.xbean.spring.jndi.DefaultContext.setEntries(java.util.Map) throws
javax.naming.NamingException] on object of class
[org.apache.xbean.spring.jndi.DefaultContext]
[DEBUG] 2007-03-26 12:07:32,668 BeanWrapperImpl.java:791 (main) - Invoked
write method [public void
org.apache.xbean.spring.jndi.DefaultContext.setEntries(java.util.Map) throws
javax.naming.NamingException] with value of type [java.util.Map]
[DEBUG] 2007-03-26 12:07:32,668 AbstractAutowireCapableBeanFactory.java:292
(main) - Invoking BeanPostProcessors before initialization of bean 'jndi'
[DEBUG] 2007-03-26 12:07:32,684 AbstractAutowireCapableBeanFactory.java:306
(main) - Invoking BeanPostProcessors after initialization of bean 'jndi'

JNDI context: [EMAIL PROTECTED]

Get factory using JNDI lookup on: java:comp/env/jbi/ClientFactory
javax.naming.NamingException: scheme java not recognized
        at
org.apache.xbean.spring.jndi.DefaultContext.lookup(DefaultContext.java:131)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.lmco.ctest.main(ctest.java:32)


Do you have another useful suggestion?

- Randy




bsnyder wrote:
> 
> 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/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ServiceMix-Client-test-code-fails-tf3455098s12049.html#a9678517
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Reply via email to