2 Replies Latest reply on Jan 23, 2012 1:26 PM by Tomaz Cerar

    ClassNotFoundException javax.crypto.spec.PBEKeySpec on Jboss 7.1-Final-Snapshot

    Sathwik B P Newbie

      Hi,

       

      My web application is using jasypt, and I have deployed the jasypt as a module.

       

      <module xmlns="urn:jboss:module:1.1" name="org.jasypt">

          <resources>

              <resource-root path="jasypt-1.8.jar"/>       

              <!-- Insert resources here -->

          </resources>

       

          <dependencies>

             <module name="com.ibm.icu"/>      

          </dependencies>

      </module>

       

      When I login to my application i get this error,

       

      Error during login: java.lang.SecurityException: org.jasypt.exceptions.EncryptionInitializationException: java.lang.NoClassDefFoundError: javax/crypto/spec/PBEKeySpec

          at org.example..web.controller.LoginController.authenticate(LoginController.java:280) [security-web-nutsNbolts-1.0.24.jar:]

          at org.example..web.controller.LoginController.authenticate(LoginController.java:310) [security-web-nutsNbolts-1.0.24.jar:]

          at org.example..web.controller.LoginController.logIn(LoginController.java:330) [security-web-nutsNbolts-1.0.24.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_30]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_30]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_30]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_30]

          at org.example..web.controller.UIController.processFormSubmission(UIController.java:99) [security-web-nutsNbolts-1.0.24.jar:]

          at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265) [spring-webmvc-2.5.5.jar:2.5.5]

          at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) [spring-webmvc-2.5.5.jar:2.5.5]

          at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) [spring-webmvc-2.5.5.jar:2.5.5]

          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) [spring-webmvc-2.5.5.jar:2.5.5]

          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) [spring-webmvc-2.5.5.jar:2.5.5]

          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) [spring-webmvc-2.5.5.jar:2.5.5]

          at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) [spring-webmvc-2.5.5.jar:2.5.5]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.8.Final.jar:]

          at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164) [urlrewrite-3.1.0.jar:3.1.0]

          at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) [urlrewrite-3.1.0.jar:3.1.0]

          at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) [urlrewrite-3.1.0.jar:3.1.0]

          at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417) [urlrewrite-3.1.0.jar:3.1.0]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.8.Final.jar:]

          at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) [spring-2.5.5.jar:2.5.5]

          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-2.5.5.jar:2.5.5]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.8.Final.jar:]

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.8.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.8.Final.jar:]

          at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.8.Final.jar:]

          at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.8.Final.jar:]

          at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2033) [jbossweb-7.0.8.Final.jar:]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_30]

      Caused by: org.jasypt.exceptions.EncryptionInitializationException: java.lang.NoClassDefFoundError: javax/crypto/spec/PBEKeySpec

          at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:708) [jasypt-1.8.jar:]

          at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:570) [jasypt-1.8.jar:]

          at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.encrypt(StandardPBEStringEncryptor.java:623) [jasypt-1.8.jar:]

          at org.jasypt.util.text.BasicTextEncryptor.encrypt(BasicTextEncryptor.java:101) [jasypt-1.8.jar:]

          at org.example..security.ws.TokenClient.authenticateUser(TokenClient.java:67) [security-ws-client-1.0.24.jar:]

          at org.example..web.controller.LoginController.authenticate(LoginController.java:274) [security-web-nutsNbolts-1.0.24.jar:]

          ... 40 more

      Caused by: java.lang.NoClassDefFoundError: javax/crypto/spec/PBEKeySpec

          at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:658) [jasypt-1.8.jar:]

          ... 45 more

      Caused by: java.lang.ClassNotFoundException: javax.crypto.spec.PBEKeySpec from [Module "org.jasypt:main" from local module loader @23394894 (roots: /home/sathwik/apps/jboss/modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          ... 46 more

       

      Can anyone let me know what am I doing wrong here,

       

      regards,

      sathwik