Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-2245

J2EE policy agent for Jetty 7/8 points to non existing class when used in J2EE_POLICY mode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: Agents-3.2.0
    • Fix Version/s: None
    • Component/s: j2ee agents
    • Labels:
      None
    • Environment:
      Linux CentOS 6 64-bit, Jetty 8, Oracle JDK 1.6

      Description

      When a web application is configured to use JAAS declarative security through the agent, Jetty fails to deploy it with the following exception:

      2013-03-01 10:06:25.902:WARN:oejd.DeploymentManager:Unable to reach node goal: started
      java.lang.NoClassDefFoundError: org/mortbay/jetty/plus/jaas/JAASUserRealm
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at org.eclipse.jetty.util.Loader.loadClass(Loader.java:100)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:354)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:754)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1126)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1029)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:422)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:384)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.get(XmlConfiguration.java:662)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:390)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:343)
      	at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:296)
      	at org.eclipse.jetty.deploy.providers.ContextProvider.createContextHandler(ContextProvider.java:87)
      	at org.eclipse.jetty.deploy.App.getContextHandler(App.java:100)
      	at org.eclipse.jetty.deploy.bindings.StandardDeployer.processBinding(StandardDeployer.java:36)
      	at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
      	at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494)
      	at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141)
      	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145)
      	at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56)
      	at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
      	at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
      	at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
      	at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555)
      	at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81)
      	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96)
      	at org.eclipse.jetty.server.Server.doStart(Server.java:280)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.eclipse.jetty.start.Main.invokeMain(Main.java:473)
      	at org.eclipse.jetty.start.Main.start(Main.java:615)
      	at org.eclipse.jetty.start.Main.main(Main.java:96)
      Caused by: 
      java.lang.ClassNotFoundException: org.mortbay.jetty.plus.jaas.JAASUserRealm
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at org.eclipse.jetty.util.Loader.loadClass(Loader.java:100)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:354)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:754)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1126)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1029)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:422)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:384)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.get(XmlConfiguration.java:662)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:390)
      	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:343)
      	at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:296)
      	at org.eclipse.jetty.deploy.providers.ContextProvider.createContextHandler(ContextProvider.java:87)
      	at org.eclipse.jetty.deploy.App.getContextHandler(App.java:100)
      	at org.eclipse.jetty.deploy.bindings.StandardDeployer.processBinding(StandardDeployer.java:36)
      	at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
      	at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494)
      	at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141)
      	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145)
      	at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56)
      	at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
      	at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
      	at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
      	at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555)
      	at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81)
      	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96)
      	at org.eclipse.jetty.server.Server.doStart(Server.java:280)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
      	at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.eclipse.jetty.start.Main.invokeMain(Main.java:473)
      	at org.eclipse.jetty.start.Main.start(Main.java:615)
      	at org.eclipse.jetty.start.Main.main(Main.java:96)
      
      

      To reproduce:

      • follow the steps readme.txt in j2ee_agents/jetty_v61_agent/sampleapp to properly configure OpenAM
      • edit the sample app configuration in j2ee_agents/jetty_v61_agent/sampleapp/etc to match your setup and then build it, or use pre-built WAR in j2ee_agents/jetty_v61_agent/sampleapp/dist (you might need to unpack it, change the deployment descriptor and JAR it again)
      • copy the war to $JETTY_HOME/webapps
      • create the context file for the application in $JETTY_HOME/contexts as follows:
        <?xml version="1.0"  encoding="ISO-8859-1"?>
        <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
        
        <Configure class="org.eclipse.jetty.webapp.WebAppContext">
        
          
          <Set name="contextPath">/agentsample</Set>
          <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/agentsample.war</Set>
          <Set name="extractWAR">true</Set>
          <Set name="copyWebDir">false</Set>
        
          <Get name="securityHandler">
            <Set name="userRealm">
              <New class="com.sun.identity.agents.jetty.v61.AMJettyUserRealm">
        	    <Set name="name">Policy Agent Realm</Set>
              </New>
            </Set>
          </Get>
          
        </Configure>
        
      • start Jetty and observe the exception

        Attachments

          Activity

            People

            • Assignee:
              peter.major Peter Major
              Reporter:
              n4al Nemanja Lukic
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: