You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Fahmi Hachicha <fa...@gmail.com> on 2011/04/07 10:23:17 UTC

[codec] DigestUtils.md5Hex Exception inside Servlet

Hello,

The DigestUtils.md5Hex method generate an exception when used inside a
Servlet :

java.lang.NoClassDefFoundError: org/apache/commons/codec/digest/DigestUtils

The class DigestUtils works correctly when used in a test class with main
method in the same project.

The same error appears when it is used in a bean associated to a JSP page
using MyFaces.

Thanks
Fahmi

Re: [codec] DigestUtils.md5Hex Exception inside Servlet

Posted by Fahmi Hachicha <fa...@gmail.com>.
Hello,

This was resolved by adding the jar file to the lib directory of the
deployment war file.
Thanks
Fahmi

2011/4/7 Henri Yandell <fl...@gmail.com>

> That's a pretty boring class Java-wise and it seems unlikely that your
> container is putting codec in the classpath on its own, so I suspect
> the problem is in how you're making the jar available within the
> servlet container.
>
> Hen
>
> On Thu, Apr 7, 2011 at 1:23 AM, Fahmi Hachicha <fa...@gmail.com>
> wrote:
> > Hello,
> >
> > The DigestUtils.md5Hex method generate an exception when used inside a
> > Servlet :
> >
> > java.lang.NoClassDefFoundError:
> org/apache/commons/codec/digest/DigestUtils
> >
> > The class DigestUtils works correctly when used in a test class with main
> > method in the same project.
> >
> > The same error appears when it is used in a bean associated to a JSP page
> > using MyFaces.
> >
> > Thanks
> > Fahmi
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [codec] DigestUtils.md5Hex Exception inside Servlet

Posted by Henri Yandell <fl...@gmail.com>.
That's a pretty boring class Java-wise and it seems unlikely that your
container is putting codec in the classpath on its own, so I suspect
the problem is in how you're making the jar available within the
servlet container.

Hen

On Thu, Apr 7, 2011 at 1:23 AM, Fahmi Hachicha <fa...@gmail.com> wrote:
> Hello,
>
> The DigestUtils.md5Hex method generate an exception when used inside a
> Servlet :
>
> java.lang.NoClassDefFoundError: org/apache/commons/codec/digest/DigestUtils
>
> The class DigestUtils works correctly when used in a test class with main
> method in the same project.
>
> The same error appears when it is used in a bean associated to a JSP page
> using MyFaces.
>
> Thanks
> Fahmi
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org