Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 328 invoked from network); 20 Dec 2000 12:04:37 -0000 Received: from unknown (HELO vdcrexc1.orange.ch) (212.215.1.70) by locus.apache.org with SMTP; 20 Dec 2000 12:04:37 -0000 Received: by vdcrexc1.orange.ch with Internet Mail Service (5.5.2650.21) id ; Wed, 20 Dec 2000 13:04:08 +0100 Message-ID: <2B26E094BB13D3118FB3006008214FA5F070EC@vdlaexc0.orange.ch> From: Kitching Simon To: "'tomcat-user@jakarta.apache.org'" Subject: RE: unable to use my own created class Date: Wed, 20 Dec 2000 13:04:07 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi, a) It is not necessary to declare a class in the "import". The import statement, just like in java, only means that you can leave the package part off of later uses of the bean. b) I recommend putting all beans in some package or other. There are some problems if they are at the "global" level, without any package. c) you need to place your class under your webapp root, in the WEB-INF/classes directory. Don't forget that you need to create subdirectorie(s) corresponding to the package name(s) that you chose for your java class. You don't need to do anything with CLASSPATH. Regards, Simon > -----Original Message----- > From: Naresh Chhabria [SMTP:nars@indiainfoline.com] > Sent: Wednesday, December 20, 2000 12:55 PM > To: tomcat-user@jakarta.apache.org > Subject: unable to use my own created class > > > Hello all, > I have created my own class "JdbcBean.java" and trying to use it in my > Jdbc.jsp file as follows:- > <%@ page import="java.io.*, java.sql.*, JdbcBean" %> > > at this point there is no error, but when i instantiate this class as > follows:- > <%! JdbcBean jdbctest = new JdbcBean(); %> > I am getting an error saying : > > Error: 500 > Location: /jsp/Jdbc.jsp > Internal Servlet Error: > javax.servlet.ServletException: JdbcBean > > Root cause: > java.lang.NoClassDefFoundError: JdbcBean > > I copied JdbcBean.class at the scratchdir directory and also tried to > manipulate the CLASSPATH env variable, but all in vain. I am unable to set > the classpath for this class, can anyone suggest me where to place this > class file. > > Thanks in advance > Naresh Chhabria > > >