3 Replies Latest reply on Sep 25, 2012 12:51 PM by Praveen K

    Modeshape 2.8.3/Tomcat 7 JNDI issue

    Praveen K Newbie

      Hi - I am trying to create a jndi resource for a filesystem repository in Tomcat 7. My server.xml has -

      <Resource auth="Container" configFile="/<somefolder>/configuration.xml" factory="org.modeshape.jcr.JndiRepositoryFactory" name="jcr/abc" repositoryName="ABC Repository Source" type="javax.jcr.Repository"/>

       

      The configuration.xml looks like -

      <?xml version="1.0" encoding="UTF-8"?>

      <configuration xmlns:mode="http://www.modeshape.org/1.0"

                xmlns:jcr="http://www.jcp.org/jcr/1.0">

                <mode:repositories>

                          <mode:repository jcr:name="abc" mode:source="abc">

                                    <mode:options jcr:primaryType="mode:options">

                                              <jaasLoginConfigName jcr:primaryType="mode:option"

                                                        mode:value="modeshape-jcr" />

                                    </mode:options>

                          </mode:repository>

                </mode:repositories>

                <mode:sources jcr:primaryType="nt:unstructured">

                          <mode:source jcr:name="abc"

                                    mode:classname="org.modeshape.connector.filesystem.FileSystemSource"

                                    mode:retryLimit="3" mode:workspaceRootPath="../abc"

                                    mode:defaultWorkspaceName="abc" mode:updatesAllowed="true">

                          </mode:source>

                </mode:sources>

                <mode:mimeTypeDetectors>

                          <mode:mimeTypeDetector jcr:name="Detector"

                                    mode:description="Standard extension-based MIME type detector" />

                </mode:mimeTypeDetectors>

      </configuration>

       

       

      I don't have any app deployed in this tomcat instace yet. I'm getting the following exception on startup -

       

      WARNING: Unexpected exception resolving reference

      java.lang.NullPointerException

                at org.modeshape.common.i18n.ClasspathLocalizationRepository.getLocalizationBundle(ClasspathLocalizationRepository.java:75)

                at org.modeshape.common.i18n.I18n.localize(I18n.java:243)

                at org.modeshape.common.i18n.I18n.rawText(I18n.java:400)

                at org.modeshape.common.i18n.I18n.text(I18n.java:432)

                at org.modeshape.common.util.log.JdkLoggerImpl.info(JdkLoggerImpl.java:125)

                at org.modeshape.jcr.JndiRepositoryFactory.initializeEngine(JndiRepositoryFactory.java:82)

                at org.modeshape.jcr.JndiRepositoryFactory.getObjectInstance(JndiRepositoryFactory.java:155)

                at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143)

                at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)

                at org.apache.naming.NamingContext.lookup(NamingContext.java:843)

                at org.apache.naming.NamingContext.lookup(NamingContext.java:154)

                at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:119)

                at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:73)

                at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:36)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:140)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:147)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:112)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:84)

                at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

                at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)

                at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)

                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:725)

                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:684)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)

      Sep 24, 2012 5:35:49 PM org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans

      SEVERE: Exception processing Global JNDI Resources

      javax.naming.NamingException

                at org.apache.naming.NamingContext.lookup(NamingContext.java:860)

                at org.apache.naming.NamingContext.lookup(NamingContext.java:154)

                at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:119)

                at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:73)

                at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:36)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:140)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:147)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:112)

                at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:84)

                at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

                at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)

                at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)

                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:725)

                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:684)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)

      Sep 24, 2012 5:35:49 PM org.apache.catalina.core.StandardService startInternal

       

      Is Modeshape expecting a default localization file somewhere in the classpath?

       

      Thanks.

      Praveen