Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] cargo deployment application won't work on jetty 7.1.4

Hello Jan,

Thanks for the help. The roles are now getting set.

I also followed your advise to copy the relevant jars from the JETTY_HOME/lib to cargo-jetty-deployer.war!/WEB-INF/lib but another exception was thrown.

The details are described as a cargo ticket at: http://jira.codehaus.org/browse/CARGO-795

It would be nice if you could take a look and give insights on this.

Thanks!
Don

Jan Bartel wrote:
Hi Don,

For your first problem, jetty-7 security got a little more strict
about enforcing the spec, and now if you reference roles in your
web.xml, you must also have a security-role declaration:

  <security-role>
    <role-name>admin</role-name>
  </security-role>

Alternatively, I think you can configure the
ConstraintSecurityHandler.setStrict(false) and it will relax that.
See: http://download.eclipse.org/jetty/stable-7/xref/org/eclipse/jetty/security/ConstraintSecurityHandler.html

For your second problem, to reference jetty impl classes from
within a webapp, you need to provide those classes in your
WEB-INF/lib. So copy the relevant jars from $JETTY_HOME/lib
and you should be ok.

cheers
Jan

On 06/07/10 01:18, Don Santillan wrote:
Hello,

I'm having problems running cargo-jetty-deployer.war (attched) in jetty
7.1.4.v20100610 server on ubuntu. Note that my jetty server comes from a
fresh installation and run through 'java -jar start.jar start' or
'bin/jetty.sh start'. Here's the error:

2010-07-05 22:18:15.133:INFO::Deployable added:
/usr/local/jetty/jetty-distribution-7.1.4.v20100610/webapps/cargo-jetty-deployer.war
2010-07-05 22:18:15.140:INFO::Copying WEB-INF/classes from
jar:file:/usr/local/jetty/jetty-distribution-7.1.4.v20100610/webapps/cargo-jetty-deployer.war!/WEB-INF/classes/
to
/tmp/Jetty_0_0_0_0_8080_cargo.jetty.deployer.war__cargo.jetty.deployer__.z8ce8l/webinf/WEB-INF/classes
2010-07-05 22:18:15.256:WARN::FAILED
ConstraintSecurityHandler@e99ce5@/cargo-jetty-deployer:
java.lang.IllegalArgumentException: Attempt to use undeclared role:
manager, known roles: []
2010-07-05 22:18:15.257:WARN::FAILED
SessionHandler@13b9fae@/cargo-jetty-deployer:
java.lang.IllegalArgumentException: Attempt to use undeclared role:
manager, known roles: []
2010-07-05 22:18:15.257:WARN::Failed startup of context
WebAppContext@1706da8@1706da8/cargo-jetty-deployer,[file:/tmp/Jetty_0_0_0_0_8080_cargo.jetty.deployer.war__cargo.jetty.deployer__.z8ce8l/webinf/, jar:file:/usr/local/jetty/jetty-distribution-7.1.4.v20100610/webapps/cargo-jetty-deployer.war!/],/usr/local/jetty/jetty-distribution-7.1.4.v20100610/webapps/cargo-jetty-deployer.war
java.lang.IllegalArgumentException: Attempt to use undeclared role:
manager, known roles: []
at
org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:228)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at
org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:97)
at
org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:114)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at
org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:97)
at
org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:634)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:200)
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:995)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:588) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:381)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:36) at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:180)
at
org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:497)
at
org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:135)
at
org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:61)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:436)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:349)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:306)
at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:258)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

Looking at the stacktrace, the error was caused by an attempt to use a
role named 'manager' from an empty role list. Looking at
JETTY_HOME/etc/realm.properties, users and roles are declared but was
not included in the role list shown in the error stacktrace. Here are
the users/roles in my JETTY_HOME/etc/realm.properties:

jetty: MD5:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,user
admin: CRYPT:xxxxxxxxxxxxx,server-administrator,content-administrator,admin
other: OBF:xxxxxxxxxxxxxxxxxxxx,user
plain: plain,user
user: password,user

So I tried to change 'manager' to 'admin' from the web.xml of the
cargo-jetty-deployer.war and load it in the jetty server but the same
error was thrown, only, instead of attempting to use a role named
'manager', it is now 'admin'. Actually, I was already expecting this
since no role was listed from the role list, but I just want to make sure.

So, I removed the whole <security-constraint> and <login-config>
elements, where the role name is configured, from the web.xml and tried
loading the app again. The application loaded properly without any
exception thrown.

Now, to see if the application is actually working, I run a maven
command (mvn cargo:deploy) which triggers the maven plugin,
cargo-maven2-plugin, that communicates with the cargo-jetty-deployer
application that is deployed to the server. Unfortunately, another
exception was thrown:

2010-07-05 22:57:09.936:WARN::Error for /cargo-jetty-deployer/deploy
java.lang.NoClassDefFoundError:
org/eclipse/jetty/server/handler/ContextHandler
at
org.codehaus.cargo.deployer.jetty.DeployerServlet.getContextHandler(DeployerServlet.java:596)
at
org.codehaus.cargo.deployer.jetty.DeployerServlet.deployArchive(DeployerServlet.java:203)
at
org.codehaus.cargo.deployer.jetty.DeployerServlet.doPut(DeployerServlet.java:175)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:730)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:423)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:456)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:866)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:337)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:595)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1055)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:619)
Caused by:
java.lang.ClassNotFoundException:
org.eclipse.jetty.server.handler.ContextHandler
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
org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:360)
at
org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:322)
at
org.codehaus.cargo.deployer.jetty.DeployerServlet.getContextHandler(DeployerServlet.java:596)
at
org.codehaus.cargo.deployer.jetty.DeployerServlet.deployArchive(DeployerServlet.java:203)
at
org.codehaus.cargo.deployer.jetty.DeployerServlet.doPut(DeployerServlet.java:175)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:730)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:423)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:456)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:866)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:337)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:595)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1055)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:619)

The error indicates that the class
org.eclipse.jetty.server.handler.ContextHandler is cannot be found. The
application cargo-jetty-deployer.war doesn't have any libraries included
in it so I checked the libraries used by jetty at JETTY_HOME/lib/. I
found the class inside jetty-server-7.1.4.v20100610.jar so I guess the
libraries used by jetty server is not shared or referenced with the
application cargo-jetty-deployer or to any applications deployed in it.

If my assumption is correct, how am I able to share the libraries used
by the jetty server to any of the application loaded into it?

Any other ideas why I'm getting this exception?

Any help is greatly appreciated.

-don



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top