• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unnable to create object of a class..

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you put this package ? It should be under /WEB-INF/classes
 
K Vidhyakar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im using tomcat server.
but there is no classes folder inside the web-inf folder..
what should i do now?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad you've found the problem :thumb:
Don't forget about your name ;)
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic