Article View: borland.public.jbuilder.java.api
Article #3567ClassLoader problem: compiler or runtime bug? You decide.
From: Simon Arthur
Date: Fri, 05 Dec 1997 00:00
Date: Fri, 05 Dec 1997 00:00
52 lines
2283 bytes
2283 bytes
This is a multi-part message in MIME format. --------------C3CC0868059ED3FAE64819FC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm having difficulty creating my own class loader. Some classes seem to load fine, while others don't seem to work at all. Take my FTPConnection class for instance. This class is intended to help manage a connection to a FTP server and help you upload and download files. When, in my custom ClassLoader, I try to load the class data using the ClassLoader.defineClass() method like this: c = defineClass(name, data, 0, data.length); I always get a NoClassDefFoundError. Strangely enough, *most* classes seem to load OK with this technique. I've attached a ZIP with all the files necessary to duplicate the problem. My ClassLoader is SIMONARTHUR.QuickApplet.TestLoader. The file causing the problem, as I mentioned before is SIMONARTHUR.mail.FTPConnection. I've tried to reduce the problem as much as possible, but it seems that defineClass just doesn't like the FTPConnection class. I figure this could have one of two causes: 1. The compiler isn't producing valid output. 2. The runtime environment is incorrectly recognizing the compiled class file as invalid. Hopefully it's neither of these and I've just overlooked something. I would be extremely grateful if some kind soul out there could take a look at this problem. I've tried to reduce the code to just the stuff that's necessary to cause the problem, so it should just take a minute to review. Simon Arthur --------------C3CC0868059ED3FAE64819FC Content-Type: application/x-zip-compressed; name="ClassLoaderProblem.ZIP" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ClassLoaderProblem.ZIP" <encoded_portion_removed> ALADAAD/LAAAAAA= --------------C3CC0868059ED3FAE64819FC--
Technical Details
Message-ID:
<3487904A.45D0A916@mindspring.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,bbbbb833d83316a6,start X-Google-Attributes: gid1089d0,public From: Simon Arthur <chroma@mindspring.com> Subject: ClassLoader problem: compiler or runtime bug? You decide. Date: 1997/12/05 Message-ID: <3487904A.45D0A916@mindspring.com> X-Deja-AN: 295384017 Organization: None Newsgroups: borland.public.jbuilder.java.api