logo       

[ jetty-Bugs-1033803 ] ThreadPool calls Class.getPackage throwing an NPE: msg#00074

java.jetty.general

Subject: [ jetty-Bugs-1033803 ] ThreadPool calls Class.getPackage throwing an NPE

Bugs item #1033803, was opened at 2004-09-24 04:35
Message generated for change (Comment added) made by gregwilkins
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1033803&group_id=7322

Category: None
Group: None
Status: Open
>Resolution: Fixed
Priority: 5
Submitted By: Ben Walding (ben_walding)
Assigned to: Nobody/Anonymous (nobody)
Summary: ThreadPool calls Class.getPackage throwing an NPE

Initial Comment:
It looks like the changes made to the ThreadPool about
a month ago have some issues with any classloader that
doesn't define a Package object for the class (eg.
getPackage() returns null).

Reading the API definition for getPackage() tends to
indicate that it is valid for the Class to return null
for getPackage() however this break the new ThreadPool.

See following for change in question:
http://cvs.sourceforge.net/viewcvs.py/jetty/Jetty/src/org/mortbay/util/ThreadPool.java?r1=1.36&r2=1.37

API definition:
/**
* Gets the package for this class. The class
loader of this class is used
* to find the package. If the class was loaded by
the bootstrap class
* loader the set of packages loaded from CLASSPATH
is searched to find the
* package of the class. Null is returned if no
package object was created
* by the class loader of this class.
*
* <p> Packages have attributes for versions and
specifications only if the
* information was defined in the manifests that
accompany the classes, and
* if the class loader created the package instance
with the attributes
* from the manifest.
*
* @return the package of the class, or null if no
package
* information is available from the archive
or codebase.
*/
public Package getPackage()

Our usecase?

We use classworlds (classworlds.codehaus.org) to launch
our jetty server and application from a single jar. At
present classworlds doesn't return a Package object
(CLASSWORLDS-1 issue in jira.codehaus.org) - although
it will one day.

This isn't urgent as I'll just revert back to 5.0.RC2
for the time being. It'll be a while before classworlds
and maven are all patched up to define a Package, and
in my opinion, Jetty should work without getPackage()
defined irregardless.



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

>Comment By: Greg Wilkins (gregwilkins)
Date: 2004-09-24 23:38

Message:
Logged In: YES
user_id=44062

Sorry I "ignored" your prior posting on this. It was on the
todo list.

Fixed in CVS.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1033803&group_id=7322


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise