java.lang.NoClassDefFoundError: Could not initialize class org.jvnet.libpam.impl.PAMLibrary$pam_conv

jenkins-ci.org | 4 months ago
  1. 0

    [JENKINS-10119] Cant build jenkins from source on debian squeeze - Jenkins JIRA

    jenkins-ci.org | 4 months ago
    java.lang.NoClassDefFoundError: Could not initialize class org.jvnet.libpam.impl.PAMLibrary$pam_conv
  2. 0

    [GLASSFISH-20882] Unable to Authenticate using PAM Realm - Java.net JIRA

    java.net | 11 months ago
    java.lang.NoClassDefFoundError: Could not initialize class org.jvnet.libpam.impl.PAMLibrary$pam_conv
  3. 0

    Unable to authenticate using PAM Realm as described at https://blogs.oracle.com/nithya/entry/pamrealm_in_glassfish_3_1 The first time I tried, I got the following stack trace (partial): com.sun.enterprise.security.auth.login.common.LoginException: Login failed: java.lang.UnsatisfiedLinkError: Unable to load library 'pam': libpam.so: cannot open shared object file: No such file or directory at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237) at com.sun.jna.Library$Handler.<init>(Library.java:140) at com.sun.jna.Native.loadLibrary(Native.java:372) at com.sun.jna.Native.loadLibrary(Native.java:357) at org.jvnet.libpam.impl.PAMLibrary.<clinit>(PAMLibrary.java:132) at sun.misc.Unsafe.ensureClassInitialized(Native Method) at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43) at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140) at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1057) at java.lang.reflect.Field.getFieldAccessor(Field.java:1038) at java.lang.reflect.Field.get(Field.java:379) After some googling, stumbled upon https://issues.jenkins-ci.org/browse/JENKINS-9486 which describes a similar issue for Jenkins. Following some comments on that page, I created a symlink as described there: "ln -s /lib/x86_64-linux-gnu/libpam.so.0 /lib/x86_64-linux-gnu/libpam.so" I now get a different exception: [2013-11-04T19:23:12.182-0500] [glassfish 4.0] [WARNING] [web.login.failed] [javax.enterprise.system.container.web.com.sun.web.security] [tid: _ThreadID=29 _ThreadName=http-listener-2(5)] [timeMillis: 1383610992182] [levelValue: 900] [[ WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: java.lang.NoClassDefFoundError: Could not initialize class org.jvnet.libpam.impl.PAMLibrary at sun.misc.Unsafe.ensureClassInitialized(Native Method) at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43) at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140) at java.lang.reflect.Field.acquireFieldAccessor(Field.java:949) at java.lang.reflect.Field.getFieldAccessor(Field.java:930) at java.lang.reflect.Field.get(Field.java:372) at com.sun.jna.Native.loadLibraryInstance(Native.java:396) at com.sun.jna.Native.getStructureAlignment(Native.java:505) at com.sun.jna.Structure.setAlignType(Structure.java:189) at com.sun.jna.Structure.<init>(Structure.java:147) at com.sun.jna.Structure.<init>(Structure.java:143) at com.sun.jna.Structure.<init>(Structure.java:139) at com.sun.jna.Structure.<init>(Structure.java:130) at org.jvnet.libpam.impl.PAMLibrary$pam_conv.<init>(PAMLibrary.java:107) at org.jvnet.libpam.PAM.<init>(PAM.java:73) at com.sun.enterprise.security.ee.auth.login.PamLoginModule.authenticate(PamLoginModule.java:114) at com.sun.enterprise.security.ee.auth.login.PamLoginModule.authenticateUser(PamLoginModule.java:65) at com.sun.enterprise.security.BasePasswordLoginModule.login(BasePasswordLoginModule.java:146) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695) at javax.security.auth.login.LoginContext.login(LoginContext.java:594) at com.sun.enterprise.security.auth.login.LoginContextDriver.doPasswordLogin(LoginContextDriver.java:383) at com.sun.enterprise.security.auth.login.LoginContextDriver.login(LoginContextDriver.java:241) at com.sun.enterprise.security.auth.login.LoginContextDriver.login(LoginContextDriver.java:154) at com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:695) at com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:636) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:279) at org.apache.catalina.authenticator.AuthenticatorBase.processSecurityCheck(AuthenticatorBase.java:991) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:580) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:702) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:722) ]]

    Java.net JIRA | 3 years ago | heffel
    java.lang.NoClassDefFoundError: Could not initialize class org.jvnet.libpam.impl.PAMLibrary$pam_conv
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    maven repo and 5.0-X version

    Google Groups | 2 years ago | Zsolt Kúti
    java.lang.NoClassDefFoundError: Could not initialize class
  6. 0

    NoClassDefFoundError while creating mock object in java

    Stack Overflow | 7 months ago | Manas Kantha
    java.lang.NoClassDefFoundError: Could not initialize class

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      Could not initialize class org.jvnet.libpam.impl.PAMLibrary$pam_conv

      at org.jvnet.libpam.PAM.<init>()
    2. Java binding for libpam.so
      PAM.<init>
      1. org.jvnet.libpam.PAM.<init>(PAM.java:73)
      1 frame
    3. Hudson
      AbstractPasswordBasedSecurityRealm$Authenticator.retrieveUser
      1. hudson.security.PAMSecurityRealm.authenticate(PAMSecurityRealm.java:82)
      2. hudson.security.AbstractPasswordBasedSecurityRealm$Authenticator.retrieveUser(AbstractPasswordBasedSecurityRealm.java:137)
      2 frames