Bugs item #1114247, was opened at 2005-02-01 12:18
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=682377&aid=1114247&group_id=118870

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: JettyLauncher doesn't work with Jetty 5.1.x

Initial Comment:
I've been trying to run the JettyLauncher with Eclipse
3.1M4 and Jetty v5.1.2 and I found it doesn't work!
Here's the reason ... the Jetty Version class has been
modified since v.5.0.x so that all fields are now
private and static methods have been added to access them.

It seems you only need to change the
getJettyVersionString method in the Utils class to make
the JettyLauncher work with Jetty 5.1.x ...

Here are my suggestions ... add a try-catch block for
backwards compatibility and adding the invoke call for
the new version:

        public static String getJettyVersionString(File
jarLocFile)
                throws MalformedURLException, ClassNotFoundException,
                InstantiationException, IllegalAccessException,
NoSuchMethodException,
                InvocationTargetException
        {
                ClassLoader currentClassLoader = null;
                currentClassLoader =
Thread.currentThread().getContextClassLoader();
                if(currentClassLoader == null)
                {
                        currentClassLoader =
JettyMainTab.class.getClassLoader();
                }
                URLClassLoader jarClassLoader =
URLClassLoader.newInstance(
                                new URL[]{jarLocFile.toURL()}, 
currentClassLoader);
                Class versionClass =
jarClassLoader.loadClass("org.mortbay.http.Version");
                Object version = versionClass.newInstance();
                try 
                {
                        Field versionImplField =
versionClass.getField("__VersionImpl");
                        return (String)versionImplField.get(version);
                        
                }
                catch(NoSuchFieldException e)
                {
                        Method versionImplMethod =
versionClass.getMethod("getImplVersion", null);
                        return (String)versionImplMethod.invoke(version, null);
                }
        }

cheers,
Marino
[EMAIL PROTECTED]

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-10-25 22:19

Message:
Logged In: NO 

'

----------------------------------------------------------------------

Comment By: Eelco Hillenius (eelco12)
Date: 2005-04-10 16:02

Message:
Logged In: YES 
user_id=820266

fixed

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-02-17 04:53

Message:
Logged In: NO 

I couldn't wait for a new build so I implemented the fix,
and rebuilt the launcher, if anyone's interested in the
updated jar you can get it from here:
http://blogs.papercutsoftware.com/matt.doran/archives/2005/02/17/gotta-love-open-source-i-fixed-it-myself/

Hopfully we'll see an official build soon ....

Matt Doran

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=682377&aid=1114247&group_id=118870


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Jettylauncher-plugin mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jettylauncher-plugin

Reply via email to