Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encryption by jasypt

import org.jasypt.util.password.*;
public class encrypt 
{
private static BasicPasswordEncryptor passenc; 
public encrypt()
{
    passenc=new BasicPasswordEncryptor();
}
public static void useradd()
{
      System.out.println("IN Useradd");
}

when i call useradd() from a jsf file i get the following error

java.lang.NoClassDefFoundError: Lorg/jasypt/util/password/BasicPasswordEncryptor;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Unknown Source)
    at java.lang.Class.getDeclaredFields(Unknown Source)
    at com.sun.faces.mgbean.BeanBuilder.scanForAnnotations(BeanBuilder.java:476)
    at com.sun.faces.mgbean.BeanBuilder.loadBeanClass(BeanBuilder.java:449)
    at com.sun.faces.mgbean.BeanBuilder.bake(BeanBuilder.java:379)
    at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:86)
    at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:349)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:258)
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:191)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:73)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:71)
    at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:69)
    at org.apache.el.parser.AstValue.getTarget(AstValue.java:68)
    at org.apache.el.parser.AstValue.invoke(AstValue.java:187)
    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:102)
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:84)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
    at javax.faces.component.UICommand.broadcast(UICommand.java:311)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jasypt.util.password.BasicPasswordEncryptor
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    ... 39 more

Please tell me why this is happening.

like image 266
DanMatlin Avatar asked Jul 05 '11 12:07

DanMatlin


1 Answers

That looks like a deployment issue - you probably just need the jasypt jar file in the lib directory for your webapp.

like image 79
Jon Skeet Avatar answered Sep 28 '22 03:09

Jon Skeet