My JSP can't find a class file

Hi
I am trying to view a JSP but I get ClassNotFoundException. I know that it means that it can't find the class but I can't understand why.
my directory structure:
Intranet->source
->jsp
->WEB-INF->classes->source-><class file here>
first line of .java file:
package source;
JSP code:
<%@page import="java.sql.*, source.*, java.util.*;" %>
<jsp:useBean id="dbConnect" scope="session" class="source.DBConnect">
<jsp:getProperty name="dbConnect" property="jdbc:odbc:Auto_Intranet" />
</jsp:useBean>
Must I create an environment variable for 'Windows': with classpath " .....\WEB-INF\classes"
The Windows environment variable doesn't exist----using XP Pro

Looks right to me.
You don't need a classpath variable. Web containers ignore it anyway.
Which class is not found? source.DBConnect?
Is DBConnect in a package called source?
Is your database driver in the web-inf/lib directory?
Please post the full error message with stack trace - it will be easier to sort out.
Good luck,
evnafets

Similar Messages

  • JSP can't find bean class!!!!!

    First of all, I'm using jdk1.4 beta and Jakarta's tomcat version 4.0.1 release build.
    Hello. I desparately need help. I have a JavaBean class ("CarBean.class") saved in %catalina_home%\webapps\root\myapp\web-inf\classes\com\wrox\cars\CarBean.class
    I also have a jsp page saved as carpage.jsp in %catalina_home%\webapps\root\myapp\
    So when I point my browser to http://localhost:8080/myapp/carpage.jsp, I get an internal server error. It appears it can't find the JavaBean class for some reason. I'm pretty sure I have my envionment variables set up right. I can get it to work, if I save the JavaBean class in c:\jdk1.4\jre\class\com\wrox\cars
    Here's my JavaBean class source file:
    package com.wrox.cars;
    import java.io.Serializable;
    public class CarBean implements Serializable {
    public CarBean() {
    private String make = "Ford";
    public String getMake() {
    return make;
    public void setMake(String make) {
    this.make = make;
    and here's my jsp page:
    <html>
    <head>
    <title>Using a JavaBean</title>
    </head>
    <body>
    <h2>Using a JavaBean</h2>
    <% com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean(); %>
    I own a <%= myCar.getMake() %>
    <% myCar.setMake("Ferrari"); %>
    Now I own a <%= myCar.getMake() %>
    </body>
    </html>
    This is the only thing I've modified in the server.xml file:
    <Context path="/myapp" docBase="myapp" debug="0" reloadable="true"/>
    I'm not new to java, just JSP. I just don't know why I can't get the jsp to locate the JavaBean class. I remember I used to have an older version of Tomcat and I recall not having any problems. It seems the Tomcat 4.XX is somewhat significantly different than previous versions. Perhaps I configured my Tomcat or server.xml wrong? Help would be greatly appreciated. Thanks.

    Hi,
    I am having a similar problem. I was wondering if you found a solution. The error I get is listed below. I have my jsp file at ../webapps/ROOT/myapp/web and my bean file located at ../webapps/ROOT/myapp//src.
    Any help will be highly appreciated
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 8 in the jsp file: /DataBaseSelect.jsp
    Generated servlet error:
    D:\WeeklyReportProject\jwsdp-1_0_01\work\Standard Engine\localhost\Test\DataBaseSelect$jsp.java:61: Class org.apache.jsp.DataBaseSelect not found.
    DataBaseSelect select = null;
    ^
    An error occurred at line: 8 in the jsp file: /DataBaseSelect.jsp
    Generated servlet error:
    D:\WeeklyReportProject\jwsdp-1_0_01\work\Standard Engine\localhost\Test\DataBaseSelect$jsp.java:64: Class org.apache.jsp.DataBaseSelect not found.
    select= (DataBaseSelect)
    ^
    An error occurred at line: 8 in the jsp file: /DataBaseSelect.jsp
    Generated servlet error:
    D:\WeeklyReportProject\jwsdp-1_0_01\work\Standard Engine\localhost\Test\DataBaseSelect$jsp.java:69: Class org.apache.jsp.DataBaseSelect not found.
    select = (DataBaseSelect) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "DataBaseSelect");
    ^
    3 errors, 1 warning

  • Where can i find my class files??

    i'm looking into a jsp file, and it imports a class named MailSequia.MailerBean. I get errors about certain class, i would like to know where it 's sopoused to be this class, is it in classpath?? or where it should be??

    If it's in a jsp file on a server the class files are located in the
    WEB-INF/classes/yourPackage/yourClass directory.

  • JRE can�t find the .class file

    Hello
    I have installed JRE 1.3 on a win98 running Computer. When i execute "jre anforderung.class -classpath C:\test\" in MS-Dos then the following Problem occurs : Cannot find File anforderung.class. I already Typed it in DOS anford~5.cla but the same thing happened. I renamed it into test.class, but always the same Error. What can i do?
    By the way, i came to this idea after i spend many hours to make my applet run in Netscape. The applet uses mySQL-Database Connection, and i�m at end with my ideas and strength. Maybe someone can tell me where i can find professional Help with my always Suffering in making my java-applets run. My last idea is to transform my files into an application, but... takes time. So Please HELP.

    That doesn�t work, but i found out I have to do this by appletviewer.exe and start the index.html.

  • JSP can't find class file

    I created a package for my JSP and import it to be used in a JSP. It works great a couple of times, but for some reason, it displays an error message saying it can't find the class in import. Can anyone explain that? Thanks.
    null

    This may be a classpath issue. Is it possible that you have changed your classpath
    and restarted your web server? If you are
    using a web server that lets you specify the
    classpath in some properties file (i.e.,
    wrapper.classpath) is is possible that that
    has changed?

  • Java server page compiler can not find a class defined in a java bean file

    I have a jsp file using java bean. The java bean class file is uploaded into the server and also the directory to this java bean .class file is included in the Unix environment CLASSPATH. This .jsp file is registered and should be compiled and excecuted automatically.
    WHen I try to invoke this .jsp file, the jsp compiler error, saying the class defined by java bean can not be found. I already include this path in teh CLASSPATH, I thought the jsp compiler will go to the right place according to CLASSPATH to find the referenced class.
    Can anyone tell me what I have done wrong or what should I do in order to allow jsp compiler to find the class refrenced by .jsp file and defined by java bean file?
    Thank you so much

    hello friends,
    i am also facing the same problem of not finding bean class files for both jsp and servlet though it is placed in same package. the problem of not finding bean class file for jsp is experienced in Tomcat server only whereas in Blazix, there is no such error and the file is compiled and runs successfully.
    i have checked Tomcat properly. there is no error in its configuration also servlets without the use of bean files run successfully. so please can anybody guide me about what is the problem and how to solve it. plz its urgent .

  • 9ias JSP can't find Classes I created

    I created a package for my JSP and import it to be used in a JSP. It works great, but for some reason, it displays an error message saying it can't find the class in import. Can anyone explain that? Thanks.

    I created a package for my JSP and import it to be used in a JSP. It works great, but for some reason, it displays an error message saying it can't find the class in import. Can anyone explain that? Thanks.

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • Where can i find the temp file in oracle 9ias ver 9.0.3

    Hi All,
    When I am trying to deploy stateless session bean(SLSB)in oracle 9ias ver 9.0.3,i am getting the following exception
    SequenceHome_StatelessSessionHomeWrapper3.java:9: SequenceHome_StatelessSessionHomeWrapper3 should be declared abstract; it does not define create (java.lang.String) in SequenceHome_StatelessSessionHomeWrapper3
    public class SequenceHome_StatelessSessionHomeWrapper3 extends com.evermind.server.ejb.RemoteStatelessSessionEJBHome implements sequence.SequenceHome
    and one more where can i find this temp file.I want to see this SequenceHome_StatelessSessionHomeWrapper3.java file..how its possible
    Thanks and Regards,
    Bala

    Try this link - it should always point to the latest iteration

  • Where to find Java Class File Specification for Java 5.0?

    Where to find Java Class File Specification for Java 5.0?
    thank you in advance.

    same place you found it for 1.4Can u give more details? I thought the class spec for Java 1.4 is the same as Java 1.2.
    anyone can tell where to find Java Class File Specification for Java 5.0?
    Thanks.

  • Package can't find other classes in package

    Code Snippets:
    **++++++++++++++++++++++++++++++++++++++++++++++
    package fordsec;
    // Imports
    import java.sql.*;
    import java.math.*;
    public class AdminUsers {
    public int createSingleUser() throws SQLException {
    Connection tmpconn = null;
    int cnt = 0;
    try {
    OraConn myconn = new OraConn();
    **+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Javac error
    oracle@eccis72-LOGMON-> javac AdminUsers.java
    AdminUsers.java:107: cannot resolve symbol
    symbol : class OraConn
    location: class fordsec.AdminUsers
    OraConn myconn = new OraConn();
    OraConn is in the package directory,
    OraConn is a member of the package,
    OraConn compiles ok,
    OraConn as a default () constructor
    It appears the AdminUsers Class is not importing the package and making the members available to this class.
    Any Ideas (I hope this is simple)

    When calling javac, you can pass it the exact diretctory and filename of class AdminUsers. But still it will not try and locate another class of the same package in that same directory, if it's not on the classpath - even if that class is assumed to be in the same package.
    That means, the "base directory" should be included in the environment variable CLASSPATH or - if you use the -cp Option on the command prompt that starts javac, you should include it there.
    In your case, this base directory would be the one containing the directory fordsec (which has the name of the package). Javac will find class OraConn in the fordsec subdirectory of ANY base directory listed in the classpath - it will merrily accept the first one (according to the sequence of directorynames in the classpath) that happens to contain a fordsec which contains an OraConn.
    If it finds just the sourcefile OraConn.java, it will compile it first in order to produce OraConn.class in the directory where it found OraConn.java. If it already finds some OraConn.class anywhere on the classpath, it will not look for an OraConn.java; the compiler always verifies the existence of a referenced type by finding its .class file along the classpath (so if it cannot find or produce OraConn.class it cannot successfully compile AdminUsers either).

  • Tomcat can't locate my class files

    Tomcat can't locat my class file for my javabeans in a jsp page.
    (Tomcat 4.1.24/windows XP)
    I have created inside of webapps a directory thesis and also the WEB-INF\classes and WEB-INF\lib. I don't know what should I put in web.xml so it is basically almost empty.
    this is the error I get where Searcher is my javabean:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:89: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] Searcher seek = null;
    [javac] ^
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:91: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] seek = (Searcher) pageContext.getAttribute("seek", PageContext.PAGE_SCOPE);
    [javac] ^
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:94: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] seek = (Searcher) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Searcher");
    [javac] ^
    [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\thesis\search_jsp.java:111: cannot resolve symbol
    [javac] symbol : class Searcher
    [javac] location: class org.apache.jsp.search_jsp
    [javac] out.print(JspRuntimeLibrary.toString((((Searcher)pageContext.findAttribute("seek")).getAnalyze())));
    [javac] ^
    [javac] 4 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)

    did you create the Searcher class? if so stick it in a package and put it under your web-inf directory. then use an <%@ page import="" %> statement to import the code.
    if you didn't create the class is it in some jar library you downloaded? if so stick the jar file in your web-inf/lib folder.
    -S-

  • Cannot find the class file

    Hi All,
    Can any one help me regarding the issue?
    Error:
    package com.support.misc.feedback
    I am getting the following error for the above line. But I have created the Hierarchy in folder structure. But still it is throwing the error.
    1. Cannot find the class file for com.sapportals.htmlb.page.DynPage
    2. This compilation unit indirectly references the missing type com.sapportals.htmlb.page.DynPage (typically some required class file is referencing a type outside the class path)     FeedbackBean.java
    Thanks in Advance.
    Message was edited by: Gowsika Kannan

    Hi Gowsika,
    the class needed is located in htmlb.jar which can be found under <irj-root>/WEB-INF/portal/portalapps/com.sap.portal.htmlb/lib
    You need to integrate this jar in your .classpath
    Hope this helps,
    Robert
    PS: Please do not post the same question 3 times

  • Cannot find the class file for com.sap.portal.services.api.connectorgateway

    Hi,
    I was trying the "How to BI JAVA SDK in a Portal iView and get the following error.
    The project was not built since its classpath is incomplete. Cannot find the class file for com.sap.portal.services.api.connectorgateway.IConnectorGatewayService. Fix the classpath and try rebuilding this project.
    I have the following in my portalapp.xml file
    <property name="SharingReference" value="com.sap.portal.ivs.connectorservice"/>
    and i have also added the jar file "com.sap.portal.ivs.connectorservice_api" in the set of lib's
    Has some faced a similar issue? or can someone suggest how I could possibly resolve this.
    Thanks,
    Smitha

    Hi Smitha:
       My webdynpro dc was build failed for "This compilation unit indirectly references the missing type com.sap.engine.services.webservices.espbase.client.dynamic.content.GenericObject (typically some required class file is referencing a type outside the classpath)".
    How should i do?  Thank you!

  • Installing 10g on Windows XP machine JVM launcher "Can't find main class"

    I am trying to install 10g Release 2 on a Windows XP machine. I downloaded the zip from the OTN. Unzipped the file. No problems. Tried to run the OUI, it opened up a shell and said to wait. The shell closed and a message frome the JVM Launcher displayed "Can't find main class. Program will exit." I have seen several people on this and other discussion boards having this problem, but have yet to get a solution. Please help.

    What's the value of CLASSPATH environment variable? Possibly a non-oracle application has set this variable and the installer catches it. If there is such a variable, comment it out and try again.

Maybe you are looking for

  • CRM - BI Interactive Reports in CRM

    Hi, I have some questions regarding BI Interactive Reports. Can anyone help me? 1. Can we access the BI Interactive reports in the CRM client itself through CRM_UI transaction or do we need to login into the        BI client separately? 2. If we don'

  • Oracle 10g DCN

    Hi, I am trying to use the new feature DCN in oracle 10g. I am using oracle 10g (10.2.0.3.0). I have followed the instruction given in the link http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_dcn.htm#CHEIJIHI to develop my app

  • Html5 animation problem, scrollbar

    Hi everyone! I need help in something, i made a webpage, and insert a animation made in flash but transformed into a html5, then i put it in some of the pages like "nosotros" "comtacto" of the webpage inserting a html, when I export it to the web the

  • Which option do you use? PSD or TIFF for external edits?

    I'd like to hear why you use PSD or TIFF for external edits. Why do you choose one over the other? Do you wish you had a choice, as in an option, when you click on Edit in External Editor?

  • Does Mail have to be open to receive messages?

    Hey guys Does Mail have to be running to check and get messages? Thanks