Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] NoClassDefFoundError : Embedded Jetty
  • From: Sujay Pujari <sujay_pujari@xxxxxxxxxxxxxx>
  • Date: Wed, 11 Mar 2020 19:17:35 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=persistent.com; dmarc=pass action=none header.from=persistent.com; dkim=pass header.d=persistent.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xp6wgr50e6J67LJIHDnNNOZ5S9bEaiLn8fS3W+pFHNY=; b=UJRVNVZGufjfozgKf0AnEP590RxgwUUqI5XvT6A+mp9+EFpLwPgJorEXS0m1vdQ5mVH2m2fCkjgMSLi8tnwevRQ7sPSV7jacf5ObK55PmeUaP+lEOmFyLLtsbzkuRefNjn12xpLz1MmjDnrTucYVKhF6ZVC8tgtZui7xIrB3Lo+F+GFdD/36w03sScI0Zt1NUykIn3/RuVOvzvbK2nK0RtXqFQdGEs4AVpW/DZ8/EXlUMiCUe1Jad4TksiUcuEimgJk+yVYCjNuWtIpT2ndegEqt7l/NAb3myYNwuy/gTKlywtMQJ3hw8kzhE5JlIkiP1cYSTU0FE9+U9NCG6uKH8g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i1xuc6+1/71RPfo6ToS9xcKysBmVfZUDaVk6DhDMYwVhpOXHeeI5S/QScwPA+piWMjQE1hmmf7aiGoQtZDIjA9FUPF7WFaHqanCyUNPtXCqBaW0plBjxz7QeOjKi91K/g9lOzpLBm9vrf9TVVGwJepbH8mO+a3o0TVkN3Xpi52jlhXewmDpD44HeBf8MwVLLSXxNDyI/LQ7O8wtLRmrAFMuPZy6TH1VaXR5uTGPJPqKa9QCrwmETBiaRoPGWpzglOq60RyuAKI1Xb8WZRZBH5h9ldMFJJSsOHNak10ihVr1fQ7F7fgUyePanToWG3QdiZeptZ1DStFqDrhyNELDtJg==
  • Delivered-to: jetty-users@xxxxxxxxxxx
  • Ironport-sdr: oqTzEG3JSC3tZwRqUGL4p9kz4DIAA1syl8o6RZZr08rIpx6wsLzWOpOhF8ofYKWic+hBeUIHW7 w8ZvMtsRxM8vEQu8iQn65XD1N7UCOxjPMfaEHBvtWzMRpxTaR9XH8HFZY+qlskAa5ndao0BeCu gC6wVz2Uc0uvFmrE+SE/rTJR+IEj/L890GsgMlMNUjG9Mu8B3J1PB1fvMukMaO2BcQ5a2v2jnE k3JxV8ghyQlYhYAHjhk55/T70/9p2kNIDmP7GStWUzSOEoEi3bv2c1EAbdaY50d235zUBv3Y1U HuE=
  • List-archive: <https://www.eclipse.org/mailman/private/jetty-users>
  • List-help: <mailto:jetty-users-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdX32XC+c0q6s3w9RQ+xaZW2CtddKg==
  • Thread-topic: NoClassDefFoundError : Embedded Jetty

Hello Jetty users,

 

We are migrating Jetty from v6 to ver 9.4.27 & using embedded Jetty.

Where in authentication is performed using form based , Jaas authentication.

In Jaas.conf file we have configured to use following  custom module

class com.acme.es.nuvo.ediscovery.jaas.DiscoveryLoginModule which  extends from AbstractLoginModule.

Now inside Login method of this class, We have following line of code

Credential cr =  Credential.getCredential(pwdStr);

 

Where we are getting NoClassDefFoundError for org.eclipse.jetty.util.security.Credential.

Note : This issue is observed on Jetty 9.x & 8.x  ( but was working fine with 6.x )

 

Inspite of the  fact that jetty-util jar corresponding to this is present in the buildpath.

Also,

Verbose:class shows that this class is getting loaded.

class load: org.eclipse.jetty.util.security.Credential from: file:/../lib/Jetty9.4.15/jetty-util-9.4.15.v20190215.jar

 

Can anybody suggest what I might be missing ? Any appropriate way to troubleshoot this?

Any help would be really appreciated.

 

Here is detailed stack:

 

javax.security.auth.login.LoginException: java.lang.NoClassDefFoundError: org.eclipse.jetty.util.security.Credential

                at com.acme.es.nuvo.ediscovery.jaas.DiscoveryLoginModule.login(DiscoveryLoginModule.java:148)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)

                at java.lang.reflect.Method.invoke(Method.java:508)

                at javax.security.auth.login.LoginContext.invoke(LoginContext.java:788)

                at javax.security.auth.login.LoginContext.access$000(LoginContext.java:196)

                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(AccessController.java:650)

                at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:696)

                at javax.security.auth.login.LoginContext.login(LoginContext.java:597)

                at org.eclipse.jetty.jaas.JAASLoginService.login(JAASLoginService.java:251)

                at org.eclipse.jetty.security.authentication.LoginAuthenticator.login(LoginAuthenticator.java:67)

                at org.eclipse.jetty.security.authentication.FormAuthenticator.login(FormAuthenticator.java:182)

                at org.eclipse.jetty.security.authentication.DeferredAuthentication.login(DeferredAuthentication.java:118)

                at org.eclipse.jetty.server.Request.login(Request.java:2411)

                at com.acme.es.nuvo.ediscovery.ui.actions.LoginAction.login(LoginAction.java:70)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)

                at java.lang.reflect.Method.invoke(Method.java:508)

                at com.acme.es.nuvo.ediscovery.ui.DiscoveryAction.dispatchMethod(DiscoveryAction.java:149)

                at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)

                at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

                at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)

                at com.acme.es.nuvo.ediscovery.ui.DiscoveryRequestProcessor.process(DiscoveryRequestProcessor.java:84)

                at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

                at com.acme.es.nuvo.ediscovery.ui.SecureServlet.process(SecureServlet.java:67)

                at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1395)

                at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)

                at com.acme.es.nuvo.common.CompressionFilter.doFilter(CompressionFilter.java:80)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)

                at com.acme.es.nuvo.common.CacheFilter.doFilter(CacheFilter.java:92)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)

                at com.acme.es.nuvo.common.Utf8Filter.doFilter(Utf8Filter.java:34)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)

                at com.acme.es.nuvo.common.LocaleFilter.doFilter(LocaleFilter.java:57)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)

                at com.acme.es.nuvo.common.SecurityTokenFilter.doFilter(SecurityTokenFilter.java:78)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)

                at com.acme.es.nuvo.common.SSLFilter.doFilter(SSLFilter.java:58)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)

                at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)

                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

                at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566)

                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

                at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)

                at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)

                at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)

                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)

                at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)

                at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)

                at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)

                at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)

                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)

                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

                at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)

                at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)

                at org.eclipse.jetty.server.handler.DebugHandler.handle(DebugHandler.java:81)

                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

                at org.eclipse.jetty.server.Server.handle(Server.java:500)

                at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)

                at org.eclipse.jetty.server.HttpChannel$$Lambda$59.0000000000D9AA80.dispatch(Unknown Source)

                at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)

                at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)

                at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)

                at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)

                at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)

                at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:543)

                at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:398)

                at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:161)

                at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)

                at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)

                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)

                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)

                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)

                at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)

                at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)

                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)

                at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)

                at java.lang.Thread.run(Thread.java:785)

Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.security.Credential

                at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:809)

                ... 86 more

 

 

Other details :

 

A.

We are instantiating jetty instance through Java code and where we refer jetty.xml for server configuration.

 

B.

In jetty.xml we uses following

 

<Configure id="Server" class="org.eclipse.jetty.server.Server">

 

      <Call name="addBean">

          <Arg>

            <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">

              <Set name="contexts">

                <Ref refid="Contexts" />

              </Set>             

              <Call id="webappprovider" name="addAppProvider">

                <Arg>

                  <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">

                    <Set name="monitoredDirName"><Property name="Project.home" default="." />/config/jetty_contexts</Set>                   

                    <Set name="scanInterval">0</Set>

                    <Set name="extractWars">true</Set>     

                   <!--  <Set name="Recursive">true</Set>     -->         

                  </New>

                </Arg>

              </Call>  

            </New>

          </Arg>

       </Call>

 

 

     

</Configure>

 

 

 

C.  one of the file present at <project.home>/config/jetty_contexts is ediscovery.xml

 

<Configure class="org.eclipse.jetty.webapp.WebAppContext">

 

 

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

  <!-- Required minimal context configuration :                        -->

  <!--  + contextPath                                                  -->

  <!--  + war OR resourceBase                                          -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

 

 

  <Set name="contextPath">/ediscovery</Set>

   <!-- <Set name="parentLoaderPriority">true</Set>-->

   <Set name="war"><SystemProperty name="Project.home" default="."/>/lib/Application_ui.war</Set>

 

  …..

 

 

  <Set name="securityHandler">

    <New class="org.eclipse.jetty.security.ConstraintSecurityHandler">

     <Set name="loginService">

       <New class="org.eclipse.jetty.jaas.JAASLoginService">

         <Set name="name">ediscovery</Set>

         <Set name="loginModuleName">DiscoveryLoginModule</Set>

         <Set name="CallbackHandlerClass">

                  org.eclipse.jetty.jaas.callback.DefaultCallbackHandler

            </Set>

            <Set name="roleClassNames">

                <Array type="java.lang.String">

                  <Item>org.eclipse.jetty.jaas.JAASRole</Item>

                </Array>

              </Set>

       </New>

     </Set>

     <Set name="checkWelcomeFiles">true</Set>

    </New>

  </Set>

 

 

 

</Configure>

 

 

Now I have few observations.

 

When in File C i.e. ediscovery.xml I make following line uncommented

<Set name="parentLoaderPriority">true</Set>

Then,

In my eclipse I don’t see any No Class Def Found Error.

 

But,

  1. In my build environment ( installed version, I see same error , classpath has required jars present )
  2. Jetty 6 we were nor setting parentLoaderPriority  to True.

 

 

 

 

Any help to troubleshoot this problem will be appreciated.

 

Thanks & Regards,

Sujay

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Back to the top