[Building Sakai] ClassNotfound in a tool

Daniel Merino daniel.merino at unavarra.es
Fri Apr 15 05:36:27 PDT 2011


Thanks to Juan José Meroño, from the University of Murcia (Spain) I have 
discovered that the problem is caused for a missing jar in 
<Tomcat>/components/blog-pack/WEB-INF/lib/

When deploying the blog post 2.5 tool, Maven doesn't copy 
sakai-kernel-util.jar to that folder, and this is why we have got this 
error.

Now I'm searching how to make Maven automatically copy the jar in the 
deploy. The dependency is in the pom.xml, but it depends of a profile. I 
don't know too much about Maven, but I'll keep doing tests to fix the 
issue. Any idea?

The profile is this one:

<profile>
    <!-- Binds to Sakai Kernel K1 - for Sakai 2.6.0+ -->
    <id>K1</id>
    <activation>
        <file>
        <exists>../master/../kernel-deploy/pom.xml</exists>
        </file>
    </activation>
    <dependencies>
        <dependency>
            <groupId>org.sakaiproject.kernel</groupId>
            <artifactId>sakai-kernel-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.sakaiproject.kernel</groupId>
            <artifactId>sakai-component-manager</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.sakaiproject.kernel</groupId>
            <artifactId>sakai-kernel-util</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.8</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</profile>

Best regards.

David Haines escribió:
> Did you install into a fresh copy of Tomcat?  I've had many problems 
> that just disappeared when I stopped reusing Tomcat installations. 
>  (I've also had many problems that had nothing to do with Tomcat.  YMMV)
>
> - Dave
>
>
> David Haines
> CTools Developer
> Digital Media Commons
> University of Michigan 
> dlhaines at umich.edu <mailto:dlhaines at umich.edu>
>
>
>
>
> On Apr 15, 2011, at 7:25 AM, Daniel Merino wrote:
>
>> Hi everybody.
>>
>> I'm trying to solve, since several days ago, a weird issue with a tool
>> which launches a ClassNotFound exception, relating to a class which is
>> included in the tool's WAR file.
>>
>> The class not found is org.sakaiproject.util.BaseResourceProperties,
>> inside sakai-kernel-util, but in the class where the exception is
>> launched (org.sakaiproject.blog.impl.SakaiProxyImpl)
>> BaseResourceProperties is included in the imports and the project
>> compiles OK with Maven.
>>
>> Also, I have looked for the lost class in the tool's deployed WAR file
>> and it's included inside its kernel's WAR file.
>>
>> I'm using a fresh Sakai 2.7.1 with kernel 1.1.9. The exception is
>> throwed when uploading an image.
>>
>> Please, could you give me some advice about what more could I try? I'm
>> stuck with this.
>>
>> This is what my catalina.out shows:
>>
>> (...)
>> Caused by: java.lang.reflect.InvocationTargetException
>>        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.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:183)
>>        ... 41 more
>> Caused by: java.lang.NoClassDefFoundError:
>> org/sakaiproject/util/BaseResourceProperties
>>        at
>> org.sakaiproject.blog.impl.SakaiProxyImpl.saveFile(SakaiProxyImpl.java:447)
>>        at
>> org.sakaiproject.blog.impl.PersistenceManagerImpl.storeFile(PersistenceManagerImpl.java:404)
>>        at
>> org.sakaiproject.blog.impl.PersistenceManagerImpl.addPostElement(PersistenceManagerImpl.java:1179)
>>        at
>> org.sakaiproject.blog.impl.PersistenceManagerImpl.addPostElement(PersistenceManagerImpl.java:1153)
>>        at
>> org.sakaiproject.blog.impl.BlogManagerImpl.addElement(BlogManagerImpl.java:220)
>>        at
>> org.sakaiproject.blog.tool.pages.EditFile$1.onSubmit(EditFile.java:60)
>>        at
>> org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1271)
>>        at
>> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:769)
>>        ... 46 more
>> Caused by: java.lang.ClassNotFoundException:
>> org.sakaiproject.util.BaseResourceProperties
>>        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>>        ... 54 more
>>
>> Thanks in advance.
>> -- 
>> Daniel Merino Echeverría
>> daniel.merino at unavarra.es <mailto:daniel.merino at unavarra.es>
>> Gestor de teleformación - Centro Superior de Innovación Educativa.
>> Tfno: 948-168489 - Universidad Pública de Navarra.
>> --
>> Malgasté mi tiempo, ahora el tiempo me malgasta a mí. (Shakespeare)
>>
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email to 
>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of 
>> "unsubscribe"
>>
>>
>

-- 
Daniel Merino Echeverría
daniel.merino at unavarra.es
Gestor de teleformación - Centro Superior de Innovación Educativa.
Tfno: 948-168489 - Universidad Pública de Navarra.
--
Tragedia + Tiempo = Comedia. (Woody Allen)


More information about the sakai-dev mailing list