[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
Ido created Bug JETTY-1544
Issue Type: Bug Bug
Affects Versions: 8.1.6
Assignee: Unassigned
Created: 11/Sep/12 10:56 PM
Description:

The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException when the server is started.

Here is the stack trace:

java.lang.reflect.InvocationTargetException
	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 org.eclipse.jetty.start.Main.invokeMain(Main.java:468)
	at org.eclipse.jetty.start.Main.start(Main.java:616)
	at org.eclipse.jetty.start.Main.main(Main.java:92)
Caused by: java.lang.ClassCastException: class org.mortbay.setuid.SetUIDServer
	at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:347)
	at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:302)
	at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1253)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1188)
	... 7 more

Changing the id to org.eclipse.jetty.server.Server (as it had been until version 8.1.5) seems to resolve the issue.

Project: Jetty
Priority: Major Major
Reporter: Ido
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
Jan Bartel resolved Bug JETTY-1544 as Not A Bug

Ido,

The id of "Server" is correct. I think in some earlier release a file got committed with the wrong id. It should always be "Server" . Also check that jetty-setuid.xml is first on the list of xml files to apply, and you should also have setuid listed in the OPTIONs.

Jan

Change By: Jan Bartel (20/Sep/12 10:54 PM)
Resolution: Not A Bug
Status: Open Resolved
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Ido commented on Bug JETTY-1544

The id of "Server" is correct. I think in some earlier release a file got committed with the wrong id. It should always be "Server" . Also check that jetty-setuid.xml is first on the list of xml files to apply, and you should also have setuid listed in the OPTIONs.

jetty-setuid.xml IS first on the list of xml files to apply, and setuid IS listed in the OPTIONs. Yet, when the id is set to "Server", the above exception is thrown on server startup, and when the id is set to "org.eclipse.jetty.server.Server" everything works famously. The issue stands. Have you attempted to run 8.1.7 with setuid enabled?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Jan Bartel commented on Bug JETTY-1544

Ido,

Yes indeed I have tried it, which is why I said it is working as expected.

Here's the reference to the fix that I referred to in my previous comment: http://jira.codehaus.org/browse/JETTY-1482

The change back to id=Server was present since release 8.1.6. I suspect you have some other etc files that have the wrong id in them. Certainly using the etc and lib files from 8.1.7 jetty-setuid with jetty-distribution 8.1.7 is working, so perhaps you have some mismatched versions? If you can verify that you have the correct versions of all files, with correct ids in them, then please provide details of how you're running jetty, the contents of your $JETTY_HOME/lib and $JETTY_HOME/etc directories and the start.ini file you're using.

thanks
Jan

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Ido commented on Bug JETTY-1544

If you can verify that you have the correct versions of all files, with correct ids in them, then please provide details of how you're running jetty, the contents of your $JETTY_HOME/lib and $JETTY_HOME/etc directories and the start.ini file you're using.

I can verify that I'm using the debian version of the 8.1.7 distibution, downloaded from http://dist.codehaus.org/jetty/deb/8.1.7.v20120910/jetty-deb-8.1.7.v20120910.deb and installed with dpkg on Ubuntu 12.04 64bit running the latest openjdk7.

Since installation I haven't modified the content of $JETTY_HOME/lib at all, and made only the following edits of config files:

  • start.ini: Added etc/jetty-setuid.xml as the first item in the list of config files, right above etc/jetty-jmx.xml.
  • start.ini: comment out etc/jetty-contexts.xml
  • start.ini: uncomment etc/jetty-ssl.xml
  • start.ini: append ",setuid" to the value of the OPTIONS variable.
  • etc/jetty.xml: change port and some other settings within the connector definition
  • etc/jetty-ssl.xml: change port and some other settings within the connector definition

I then copy my war (root.war) to webapps (after deleting the entire contents of the webapps folder) and use /opt/jetty/bin/jetty.sh to start and stop the server.

BTW, I never used version 8.1.6 - I skipped straight from 8.1.5 to 8.1.7. Nothing has been mixed, however. I always do a clean install, apply the minimal needed edits (described above), then copy in my war.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Ido commented on Bug JETTY-1544

From the stack trace above you can see that Jetty is trying to cast something (presumably org.eclipse.jetty.server.Server, which is the "class" attribute of the "Configure" node in jetty.xml) into org.mortbay.setuid.SetUIDServer (which is the "class" attribute of the "Configure" node in jetty-setuid.xml). Or the other way around.

The question is why does the casting fail - isn't org.mortbay.setuid.SetUIDServer a subclass of org.eclipse.jetty.server.Server? Or is it still a subclass of the mortbay-namespaced org.mortbay.jetty.Server?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Ido commented on Bug JETTY-1544

One more thing: I have -Xbootclasspath/p:/opt/jetty/npn-boot-1.1.0.v20120525.jar defined in my JAVA_OPTIONS enver. This is a relic of some experiments I've done with enabling SPDY (I've since put that aside). Do you think this might have anything to do with the issue?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
 
Ido edited a comment on Bug JETTY-1544

One more thing: I have -Xbootclasspath/p:/opt/jetty/npn-boot-1.1.0.v20120525.jar defined in my JAVA_OPTIONS enver (and I placed this jar in /opt/jetty/, as well). This is a relic of some experiments I've done with enabling SPDY (I've since put that aside). Do you think this might have anything to do with the issue?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Change By: Jan Bartel (23/Sep/12 8:04 PM)
Assignee: Jan Bartel
Status: Resolved Reopened
Resolution: Not A Bug
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Jan Bartel commented on Bug JETTY-1544

Ido,

The problem appears to be that when using "/etc/init.d/jetty start", the command line produced is:

"/usr/lib/jvm/jdk1.7/bin/java -Djetty.home=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar --pre=etc/jetty-logging.xml --daemon"

This puts etc/jetty-logging.xml first onto the command line, which creates an instance of Server that is org.eclipse.jetty.server.Server. Thus, when etc/jetty-setuid.xml is executed, it cannot cast that to be org.mortbay.jetty.setuid.SetUIDServer.

I think the solution for you is to insert "-pre=etc/jetty-setuid.xml" into /etc/init.d/jetty script before the "-pre=etc/jetty-logging.xml" (and make sure you take etc/jetty-setuid.xml out of your start.ini).

Alternatively, you could remove the "--pre=etc/jetty-logging.xml" from the init.d script, and instead add etc/jetty-logging.xml after etc/jetty-setuid.xml.

I will document this on the wiki.

Note: in previous releases where the id was incorrectly "org.eclipse.jetty.server.Server", the jetty-setuid.xml file would have been incorrectly creating a second Server instance and applying the setuid configuration to it. Thus I believe the jetty server instance created by the etc/jetty-logging.xml file with id Server would have in fact continued to run as root.

Jan

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
 
Jan Bartel edited a comment on Bug JETTY-1544

Ido,

The problem appears to be that when using "/etc/init.d/jetty start", the command line produced is:

"/usr/lib/jvm/jdk1.7/bin/java -Djetty.home=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar --pre=etc/jetty-logging.xml --daemon"

This puts etc/jetty-logging.xml first onto the command line, which creates an instance of Server that is org.eclipse.jetty.server.Server. Thus, when etc/jetty-setuid.xml is executed, it cannot cast that to be org.mortbay.jetty.setuid.SetUIDServer.

I think the solution for you is to insert "-pre=etc/jetty-setuid.xml" into /etc/init.d/jetty script before the "-pre=etc/jetty-logging.xml" (and make sure you take etc/jetty-setuid.xml out of your start.ini).

Alternatively, you could remove the "--pre=etc/jetty-logging.xml" from the init.d script, and instead add etc/jetty-logging.xml after etc/jetty-setuid.xml.

I will document this on the wiki.

Note: in previous releases where the id was incorrectly "org.eclipse.jetty.server.Server", the jetty-setuid.xml file would have been incorrectly creating a second Server instance and applying the setuid configuration to it. Thus I believe the jetty server instance created by the etc/jetty-logging.xml file with id Server would have in fact continued to run as root.

Jan

PS I also created this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390160 as I received warnings about the poor quality of the jetty debian bundles when I tried to install them. We should improve them.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
 
Jan Bartel edited a comment on Bug JETTY-1544

Ido,

The problem appears to be that when using "/etc/init.d/jetty start", the command line produced is:

"/usr/lib/jvm/jdk1.7/bin/java -Djetty.home=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar --pre=etc/jetty-logging.xml --daemon"

This puts etc/jetty-logging.xml first onto the command line, which creates an instance of Server that is org.eclipse.jetty.server.Server. Thus, when etc/jetty-setuid.xml is executed, it cannot cast that to be org.mortbay.jetty.setuid.SetUIDServer.

I think the solution for you is to insert "-pre=etc/jetty-setuid.xml" into /opt/jetty/jetty.conf file before the "-pre=etc/jetty-logging.xml" (and make sure you take etc/jetty-setuid.xml out of your start.ini).

Alternatively, you could remove the "--pre=etc/jetty-logging.xml" from the init.d script, and instead add etc/jetty-logging.xml after etc/jetty-setuid.xml.

I will document this on the wiki.

Note: in previous releases where the id was incorrectly "org.eclipse.jetty.server.Server", the jetty-setuid.xml file would have been incorrectly creating a second Server instance and applying the setuid configuration to it. Thus I believe the jetty server instance created by the etc/jetty-logging.xml file with id Server would have in fact continued to run as root.

Jan

PS I also created this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390160 as I received warnings about the poor quality of the jetty debian bundles when I tried to install them. We should improve them.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
 
Jan Bartel edited a comment on Bug JETTY-1544

Ido,

The problem appears to be that when using "/etc/init.d/jetty start", the command line produced is:

"/usr/lib/jvm/jdk1.7/bin/java -Djetty.home=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar --pre=etc/jetty-logging.xml --daemon"

This puts etc/jetty-logging.xml first onto the command line, which creates an instance of Server that is org.eclipse.jetty.server.Server. Thus, when etc/jetty-setuid.xml is executed, it cannot cast that to be org.mortbay.jetty.setuid.SetUIDServer.

I think the solution for you is to insert "-pre=etc/jetty-setuid.xml" into /opt/jetty/etc/jetty.conf file before the "-pre=etc/jetty-logging.xml" (and make sure you take etc/jetty-setuid.xml out of your start.ini). I've tested this and it works.

Alternatively, you could remove the "--pre=etc/jetty-logging.xml" from /opt/jetty/etc/jetty.conf script, and instead add etc/jetty-logging.xml after etc/jetty-setuid.xml in start.ini. However, I recommend the previous approach.

I will document this on the wiki.

Note: in previous releases where the id was incorrectly "org.eclipse.jetty.server.Server", the jetty-setuid.xml file would have been incorrectly creating a second Server instance and applying the setuid configuration to it. Thus I believe the jetty server instance created by the etc/jetty-logging.xml file with id Server would have in fact continued to run as root.

Jan

PS I also created this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390160 as I received warnings about the poor quality of the jetty debian bundles when I tried to install them. We should improve them.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1544) The packaged jetty-setuid.xml file uses the id "Server" for its Configure element, causing a ClassCastException

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Jan Bartel resolved Bug JETTY-1544 as Fixed

Wiki page on the linux distros updated with note on using with setuid.

Change By: Jan Bartel (23/Sep/12 9:05 PM)
Resolution: Fixed
Status: Reopened Resolved
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email