3

I need to fix a bug in a specific version of jetty (jetty-util-8.1.17.v20150415). Specific, because that's the only version I'm sure works with Cling. The bug is:

Caused by java.lang.NullPointerException 
   org.eclipse.jetty.util.StringUtil.asciiToLowerCase(StringUtil.java:106)
   org.eclipse.jetty.http.MimeTypes.<clinit>(MimeTypes.java:138)    
   org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:711)
   org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
   org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
   org.eclipse.jetty.server.Server.doStart(Server.java:282)
   org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
   org.fourthline.cling.transport.impl.jetty.JettyServletContainer.startIfNotRunning(JettyServletContainer.java:141)

So what git command do I have to issue to get this very version?

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
ssuukk
  • 8,200
  • 7
  • 35
  • 47
  • Might want to [file a bug with jetty](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty&format=guided) too about whatever this bug is. – Joakim Erdfelt Aug 03 '15 at 12:38
  • Incidentally, this is not a bug with jetty-util, [your environment has a bad `mime.properties` that is producing empty extension keys](https://github.com/eclipse/jetty.project/blob/jetty-8.1.17.v20150415/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java#L138) for the runtime mime-types. Attempting to address the problem in jetty-util will result in bigger problems for you. – Joakim Erdfelt Aug 03 '15 at 12:45
  • Are you sure? There's mime.properties coming WITH jetty distribution and some people reported that the bug was gone when they just deleted THATfile! I didn't want to be as harsh on jetty, so I just added if ==null there... Note that mime.properties coming with jetty have empty last line... – ssuukk Aug 03 '15 at 18:10
  • Deleting mime.properties will ensure that static file serving, and filters/handlers that rely on mime-types (like GzipFilter or GzipHandler) will not function as you expect. The problem you are having has to do with all mime.properties in your entire project and its classpath (it is loaded using normal ResourceBundle behavior). You might have more than 1 in your environment (or a Classloader hierarchy that prevents it from being loaded). – Joakim Erdfelt Aug 03 '15 at 20:41
  • I'm building for Android and I am pretty sure there's only jetty's own mime.properties in my build path. Not sure if it exists anywhere on Android filesystem. But anyway - we'll see, as I've sent this correction to testers. – ssuukk Aug 04 '15 at 07:17
  • 1
    Ah, android. You should be using the [i-jetty project and Jetty 7](https://github.com/jetty-project/i-jetty) then. (the Android API layers are not yet caught up with anything newer) – Joakim Erdfelt Aug 04 '15 at 14:06
  • Hi @ssuukk. How you fix it? We have same bug on android and very few devices. But have no idea how crash can appear in 106 line We found same issue on jetty github https://github.com/eclipse/jetty.project/issues/720#issuecomment-244762508 but patch from there not really affect this crash – Anton Pogonets Oct 04 '16 at 21:15
  • If I remember correctly there's a plain text file with mime types. This file is either empty or some lines are null. If you correct this either by removing the file (risking loosing some mime functionality?) or offending lines, everything will be ok. Oh, ineed. See my somment above! – ssuukk Oct 05 '16 at 06:59

1 Answers1

2

what git command do I have to issue to get this very version?

As mentioned in "Download a specific tag with Git":

git clone -b jetty-8.1.17.v20150415 https://github.com/eclipse/jetty.project
git checkout -b fix

The first command will clone the repo directly at the tag/jetty-8.1.17.v20150415 commit, but will leave you in a detached HEAD.

The second command will create a new branch starting from that commit, allowing you to fix the bug in isolation (in a dedicated branch).

You might also want to fork that repo first, in order to be able to push that branch to a repo you own.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That's some pretty good answer, thanks. I guess I will need to lookup some of git terminology. – ssuukk Aug 02 '15 at 14:04
  • @ssuukk let me know if you have any question regarding some of that git terminology. – VonC Aug 02 '15 at 14:05
  • Heh, thanks. But I think I won't learn anything new about cvs until I am really hopelessly stuck with mixed heads/trunks/revisions/whatevers. Currenty all I do is commit, pull and push. – ssuukk Aug 04 '15 at 07:19