i've been trying to get my webapp working in tomcat 5.5.9, and i'm
running into a problem using spring's JndiObjectFactoryBean to access a tomcat naming resource.

i'm getting a BeanCreationException with this message: Error creating
bean with name 'jcrRepository' defined in class path resource
[applicationContext-repository.xml]: Initialization of bean failed;
nested exception is javax.naming.NamingException: Cannot create resource
instance

unfortunately the naming exception does not have a root cause, so it's
difficult to see what could be causing the problem. turning on debugging
in tomcat revealed the following, tho:

2005-08-29 18:20:52,215 DEBUG [WebappClassLoader]
loadClass(org.springframework.jndi.JndiObjectFactoryBeanBeanInfo, false)
2005-08-29 18:20:52,217 DEBUG [WebappClassLoader]   Searching local
repositories
2005-08-29 18:20:52,217 DEBUG [WebappClassLoader]
findClass(org.springframework.jndi.JndiObjectFactoryBeanBeanInfo)
2005-08-29 18:20:52,217 DEBUG [WebappClassLoader]
findClassInternal(org.springframework.jndi.JndiObjectFactoryBeanBeanInfo)
2005-08-29 18:20:52,219 DEBUG [WebappClassLoader]     --> Passing on
ClassNotFoundException

i can't tell if this is expected or not. if you look at the full log
file, that output occurs slightly before the exception is logged. you
can see the full log at <http://builds.osafoundation.org/~bcm/cosmo.log>.

the jar that contains javax/jcr/Repository.class is in tomcat's
common/lib directory. i tried copying all the other jars from
WEB-INF/lib into common/lib as well, but that did not help at all.

any ideas what might be going on, or how i can further troubleshoot? thanks!

my tomcat context's config file contains:

  <Resource name="jcr/cosmo"
            type="javax.jcr.Repository"/>

  <ResourceParams name="jcr/cosmo">
    <parameter>
      <name>factory</name>
      <value>
        org.apache.jackrabbit.core.jndi.BindableRepositoryFactory
      </value>
    </parameter>
    <parameter>
      <name>configFilePath</name>
      <value>etc/repository.xml</value>
    </parameter>
    <parameter>
      <name>repHomeDir</name>
      <value>data/repository</value>
    </parameter>
  </ResourceParams>

and my webapp's web.xml contains:

  <resource-env-ref>
    <resource-env-ref-name>jcr/cosmo</resource-env-ref-name>
    <resource-env-ref-type>
      javax.jcr.Repository
    </resource-env-ref-type>
  </resource-env-ref>

my spring bean is defined as such:

  <bean id="jcrRepository"
        class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName">
      <value>jcr/cosmo</value>
    </property>
    <property name="resourceRef">
      <value>true</value>
    </property>
  </bean>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to