Tuesday, November 13, 2007

WARNING: Cound not start ClientFactory - FIXED!

This warning also says that the javax.naming.NoInitialContextException was caused by a missing java.naming.factory.initial parameter. I am seeing this error while running an embedded ServiceMix engine. It is easy to fix however. You need to add two files to the classpath. jndi.properties
java.naming.factory.initial = org.apache.xbean.spring.jndi.SpringInitialContextFactory
jndi.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  <bean id="jndi" class="org.apache.xbean.spring.jndi.DefaultContext">
    <property name="entries">
      <map/>
    </property>
  </bean>
</beans>
Post a Comment