aspose file tools*
The moose likes JSP and the fly likes unnable to create object  of a class.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "unnable to create object  of a class.." Watch "unnable to create object  of a class.." New topic
Author

unnable to create object of a class..

K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
i have created a class Test inside a package called "utilities" . in jsp i have included the package but while calling that page, error is thrown..

package utilities does not exists.. and so on..

can you explain me what may be the problem..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Where did you put this package ? It should be under /WEB-INF/classes


[My Blog]
All roads lead to JavaRanch
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
im using tomcat server.
but there is no classes folder inside the web-inf folder..
what should i do now?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You have to create it yourself. For example, make the following structure:

TOMCAT_INSTALL/webapps/myapp/WEB-INF/lib
TOMCAT_INSTALL/webapps/myapp/WEB-INF/classes
TOMCAT_INSTALL/webapps/myapp/WEB-INF/classes/utilities
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
still its not working..
and i even tried without using package also..

i placed the class in
Tomcat 4.1\webapps\design\WEB-INF\classes
directory..

its telling ..

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] Compiling 1 source file

C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\design\Sample_jsp.java:11: cannot resolve symbol
symbol : class Test
location: class org.apache.jsp.Sample_jsp
Test t=new Test();
^
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\design\Sample_jsp.java:11: cannot resolve symbol
symbol : class Test
location: class org.apache.jsp.Sample_jsp
Test t=new Test();
^
2 errors
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Please show how you import the class from JSP.
(and you didn't forget the "package utilities;" in Test.java, did you?)
(and Test.class is in /classes/utilities/, isn't it?)
[ October 05, 2006: Message edited by: Satou kurinosuke ]
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Code is not showing
And when we solve your problem, please take some time to read the naming policy and change your name accordingly. Thank you.
http://www.javaranch.com/name.jsp
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
the Test class which i created is default.
but i changed it to public and its working properly.

thanks a lot in helping me to place the files in correct directory..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Glad you've found the problem :thumb:
Don't forget about your name ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unnable to create object of a class..