Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Class not found

  Asked By: Richard    Date: Apr 28    Category: Java    Views: 1079

I am facing some problem in fact error in JSP i am using a useBean property and
it is saying that file not found the code for the jsp is as follows:

<jsp:useBean id="help" scope="request" class="JSPPractice.Hello1">

<jsp:setProperty name="help" property="*"/>

<jsp:getProperty name="help" property="word" />

<%= request.getParameter("word") %>
return value form bean is <%= help.sHello() %>

i am just getting a parameter from HTML and not usinf is one in Java class i
just have one method which return a string and i wanna display that but it is
giving error of class not found.

class ="JSPPractice.Hello1" i also have tried to do is as

class ="JSPPractice\Hello1" but both doesn't work.



6 Answers Found

Answer #1    Answered By: Alexis Castillo     Answered On: Apr 28

I think you are just starting learning JSP. If so use JBuilder
it will be a great tool for beginners.

Answer #2    Answered By: Dot net Sachin     Answered On: Apr 28

But tell me how the tips like for thati have to 1st learn how to use JBuilder
and then JSP but can you tell me Please.

Answer #3    Answered By: Renee Lane     Answered On: Apr 28

JBuilder is quite friendly tool. You just install it and click on
File>New menu. It will pop up a window . You select Web Tab and then
click on Java Server Page. You will be asked few more question on
next screens . Just click on Next page if you do't know about
different options.It will create a jsp  page with a sample bean  as

To view the output of jsp page just select the page in left panel.
Right click on it and click on Run in web.

if you still have any problem  tell me. OK.

Answer #4    Answered By: Volney Fischer     Answered On: Apr 28

I am writing a Java class  MyTest.java with methods to call functions
(also java  methods) in an API, and return  a result. My Java works fine
in my IDE (Jcreator) but when I compile and call the same methods from
my application, or from the command line, I get eg

Exception occurred: java.lang.ClassNotFoundException
(uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=199

which looks to me that the class definition existed when I compiled,
but can no longer be found.

Other methods in MyTest class that don't call the API work  fine.

I have set the CLASSPATH in the System Control Panel, it looks fine,
though I note that when I checked the classpath from the command line
in JDB it has commas rather than the semicolons; both have

I have also created a method  in CallAPI to set the classpath with
System.setProperty ("java.class.path" ...) I can call that from my
app; it sets the classpath (with forward slashes) but still get the
exception when I call any method that calls a class in the JARs

I am struggling to see what's different between the IDE and the
compiled class.

Answer #5    Answered By: Sophie Campbell     Answered On: Apr 28

Dont know the architecture of ur application, but it is possible
that it involves two separate jar files:
1 for declaring the interfaces -- typically called client_jars.
These help u to compile ur code. This does not contain any

the second jar will contain the implementations of the interfaces.
these would be important while running ur application; but are not
required while compiling.

so, first check if u need any other jar file; if so, include this
jar in ur class  path.

Whatever be the solution, plz do let us know what the issue was.
This is worth archiving.

Answer #6    Answered By: Adalwine Fischer     Answered On: Apr 28

Look for the class  name .You have saved as MyTest.java .In the code  the
class name should match exactly.
The other possibility is setting class path.

Didn't find what you were looking for? Find more on Class not found Or get search suggestion and latest updates.