Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 65254 invoked from network); 15 Jun 2003 14:48:24 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 15 Jun 2003 14:48:24 -0000 Received: (qmail 6981 invoked by uid 97); 15 Jun 2003 14:50:43 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 6974 invoked from network); 15 Jun 2003 14:50:42 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 15 Jun 2003 14:50:42 -0000 Received: (qmail 63865 invoked by uid 500); 15 Jun 2003 14:48:12 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 63847 invoked from network); 15 Jun 2003 14:48:10 -0000 Received: from amos.sdjls.uniba.sk (HELO sturak.sk) (158.195.96.2) by daedalus.apache.org with SMTP; 15 Jun 2003 14:48:10 -0000 Received: (qmail 6684 invoked from network); 15 Jun 2003 14:45:11 -0000 Received: from cronwell.ad.sdjls.uniba.sk (HELO cronwell) (158.195.97.230) by amos.sdjls.uniba.sk with SMTP; 15 Jun 2003 14:45:11 -0000 Message-ID: <001b01c3334d$25242510$e661c39e@cronwell> From: "Anna" To: Subject: RE: NoClassDefFoundError (error500) ... with external package Date: Sun, 15 Jun 2003 16:48:12 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0018_01C3335D.E8A6DA90" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0018_01C3335D.E8A6DA90 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable No ... i don't have any others jars ... and i didn't set classpath or = other variables=20 Thence i'm confused ... I'm attaching sample for better recognition=20 Anna=20 ########################### test.jsp ############################## <%@ page language=3D"java" %> <%@ page import=3D"java.util.*, java.io.*, java.net.*, java.text.*, = java.lang.*, java.util.jar.*, headline.*" %> Untitled <% String szPath =3D "\\MyJsp\\WEB-INF\\plugins"; FileClassLoader c =3D new FileClassLoader(szPath); c.load("Hmmm", true); %> =20 ############################ MyInter.java ######################### package headline; public interface MyInter { public void Test(); } ########################### FileClassLoader ####################### package headline; import java.io.*; public class FileClassLoader extends ClassLoader { private String basePath; public FileClassLoader(String basePath) { this.basePath =3D basePath; } public Class load(String typeName, boolean resolveIt) throws = ClassNotFoundException { Class result =3D findLoadedClass(typeName); if (result !=3D null) { return result; } byte typeData[] =3D getTypeFromBasePath(typeName); if (typeData =3D=3D null) { throw new ClassNotFoundException(); } result =3D defineClass(typeName, typeData, 0, typeData.length); if (result =3D=3D null) { throw new ClassFormatError(); } if (resolveIt) { resolveClass(result); } return result; } private byte[] getTypeFromBasePath(String typeName) { FileInputStream fis; String fileName =3D basePath + File.separatorChar + typeName.replace('.', File.separatorChar) + ".class"; try { fis =3D new FileInputStream(fileName); } catch (FileNotFoundException e) { return null; } BufferedInputStream bis =3D new BufferedInputStream(fis); ByteArrayOutputStream out =3D new ByteArrayOutputStream(); try { int c =3D bis.read(); while (c !=3D -1) { out.write(c); c =3D bis.read(); } } catch (IOException e) { return null; } return out.toByteArray(); } } ############################ Hmmm.java ############################ import headline.*; public class Hmmm implements MyInter{ public void Test(){ } } ######################## file listing ########################## -- MyJsp | -- test.jsp=20 | -- WEB-INF | -- classes | | | -- headline | | | -- FileClassLoader.class | | | -- MyInter.class | =20 -- plugins=20 |=20 -- Hmmm.class ------=_NextPart_000_0018_01C3335D.E8A6DA90--