You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by imadhusudhanan <im...@zohocorp.com> on 2009/01/23 10:18:05 UTC

NoClassDefFoundError ....

This is the exception I get even though I have jackrabbit-core-1.4.6.jar in my CLASSPATH. I have this working fine untill I compiled my custom LoginModule, WebDAVLoginModule.java held at a different package say c.a.z.WebDAVLoginModule.java. This is the trace,

java.lang.NoClassDefFoundError: Could not initialize class org.apache.jackrabbit.core.jndi.BindableRepositoryFactory
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)

The repository invocation code ,

            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.jackrabbit.core.jndi.BindableRepositoryFactory");
            env.put(Context.PROVIDER_URL, "localhost");
            InitialContext ctx = new InitialContext(env);
            RegistryHelper.registerRepository(ctx, "repo", configFile, repHomeDir, true);
                        Repository r = (Repository) ctx.lookup("repo");

And the server.xml entry is as follows for binding the repository under Apps Server JNDI Tree ... 
 
      <Context path="" docBase="pc" debug="4">
                   <Resource name="repo"
                        auth="Container"
                        type="javax.jcr.Repository"
                        factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
                        configFilePath="../webapps/pc/webdav/repository.xml"
                        repHomeDir="../webapps/pc/webdav"/>
        </Context>
    </Host>

And this is my repository.xml 

    <?xml version="1.0" encoding="ISO-8859-1"?>
<Repository>
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
                <param name="path" value="${rep.home}/repository"/>
        </FileSystem>
        <Security appName="Jackrabbit">
                <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/>
                <LoginModule class="com.adventnet.zohopc.webdav.WebDAVLoginModule">
                        <param name="anonymousId" value="anonymous"/>
                        <param name="adminId" value="madhu"/>
                </LoginModule>
        </Security>
        <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
        <Workspace name="${wsp.name}">
                <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
                        <param name="path" value="${wsp.home}"/>
                </FileSystem>
                <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
                <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
                        <param name="path" value="${wsp.home}/index" />
                </SearchIndex>
        </Workspace>
        <Versioning rootPath="${rep.home}/versions">
                <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
                        <param name="path" value="${rep.home}/versions"/>
                </FileSystem>
                <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
        </Versioning>
</Repository>
~

jaas.config is as follows

/** Login config for JackRabbit **/
Jackrabbit {
        com.adventnet.zohopc.webdav.WebDAVLoginModule required
        anonymousId="anonymous";
};


I understand that both the entries in jaas.config and in repository.xml for SimpleLoginModule extensions are mandatory. Pls guide me in case I made a mistake.



    


Regards,
MadhuSudhanan I.
www.zoho.com
'If you wanna walk quick Walk Alone, if you wanna walk far Walk Together ..."

Re: NoClassDefFoundError ....

Posted by imadhusudhanan <im...@zohocorp.com>.
Yes I got it fixed. Its the jaas.config thats making the problem. I removed the file and the java_opt entry from my server start up then it worked, no exception ... !! phew !!!

Regards,
MadhuSudhanan I.
www.zoho.com
'If you wanna walk quick Walk Alone, if you wanna walk far Walk Together ..."



---- On Fri, 23 Jan 2009 Jukka Zitting <ju...@gmail.com> wrote ---- 

 > Hi, 
 >  
 > On Fri, Jan 23, 2009 at 10:18 AM, imadhusudhanan 
 > <im...@zohocorp.com> wrote: 
 > > This is the exception I get even though I have jackrabbit-core-1.4.6.jar in 
 > > my CLASSPATH. I have this working fine untill I compiled my custom 
 > > LoginModule, WebDAVLoginModule.java held at a different package say 
 > > c.a.z.WebDAVLoginModule.java. This is the trace, 
 > > 
 > > java.lang.NoClassDefFoundError: Could not initialize class 
 > > org.apache.jackrabbit.core.jndi.BindableRepositoryFactory 
 >  
 > This looks like a missing dependency. Typical causes are missing JCR 
 > API or SLF4J implementation jars. 
 >  
 > BR, 
 >  
 > Jukka Zitting  

Re: NoClassDefFoundError ....

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Fri, Jan 23, 2009 at 10:18 AM, imadhusudhanan
<im...@zohocorp.com> wrote:
> This is the exception I get even though I have jackrabbit-core-1.4.6.jar in
> my CLASSPATH. I have this working fine untill I compiled my custom
> LoginModule, WebDAVLoginModule.java held at a different package say
> c.a.z.WebDAVLoginModule.java. This is the trace,
>
> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.jackrabbit.core.jndi.BindableRepositoryFactory

This looks like a missing dependency. Typical causes are missing JCR
API or SLF4J implementation jars.

BR,

Jukka Zitting