tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Bainbridge <ja...@jblinux.org>
Subject Re: NoClassDefFoundError (error500) ... with external package
Date Sun, 15 Jun 2003 15:41:12 GMT
I'm guessing you have headlines.jar installed from:

http://sourceforge.net/projects/headlines/

Given the error:

root cause 
javax.servlet.ServletException: net/sourceforge/headlines/Headline

Are you sure you don't have that anywhere Tomcat would be accessing it?

Regards,
-- 
Jason Bainbridge
http://jblinux.org


On Sun, 15 Jun 2003 22:48, Anna wrote:
> No ... i don't have any others jars ... and i didn't set classpath or other
> variables
>
> Thence i'm confused ...
>
> I'm attaching sample for better recognition
>
>
> Anna
>
> ########################### test.jsp ##############################
>
> <%@ page language="java" %>
> <%@ page import="java.util.*, java.io.*, java.net.*, java.text.*,
> java.lang.*, java.util.jar.*, headline.*" %>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html>
> <head>
>  <title>Untitled</title>
> </head>
>
> <body>
> <%
>             String szPath = "<removedpath>\\MyJsp\\WEB-INF\\plugins";
>
>   FileClassLoader c = new FileClassLoader(szPath);
>   c.load("Hmmm", true);
> %>
>
>
> </body>
> </html>
>
> ############################ 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 = basePath;
>  }
>
>  public Class load(String typeName, boolean resolveIt) throws
> ClassNotFoundException {
>
>   Class result = findLoadedClass(typeName);
>
>   if (result != null) {
>    return result;
>   }
>
>   byte typeData[] = getTypeFromBasePath(typeName);
>   if (typeData == null) {
>    throw new ClassNotFoundException();
>   }
>
>   result = defineClass(typeName, typeData, 0,
>           typeData.length);
>
>   if (result == null) {
>    throw new ClassFormatError();
>   }
>
>   if (resolveIt) {
>    resolveClass(result);
>   }
>
>   return result;
>  }
>
>  private byte[] getTypeFromBasePath(String typeName) {
>
>   FileInputStream fis;
>   String fileName = basePath + File.separatorChar
>           + typeName.replace('.', File.separatorChar)
>           + ".class";
>
>   try {
>    fis = new FileInputStream(fileName);
>   } catch (FileNotFoundException e) {
>    return null;
>   }
>
>   BufferedInputStream bis =
>           new BufferedInputStream(fis);
>   ByteArrayOutputStream out =
>           new ByteArrayOutputStream();
>
>   try {
>    int c = bis.read();
>    while (c != -1) {
>     out.write(c);
>     c = 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
>
>    -- WEB-INF
>
>        --  classes
>
>       |   -- headline
>       |
>       |      -- FileClassLoader.class
>       |
>       |      -- MyInter.class
>
>        -- plugins
>
>           -- Hmmm.class


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message