Tomcat doesn't see my beans :-(
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Joost_Schouten
Posted On:   Thursday, December 13, 2001 06:00 AM

Hi, I placed my fruit.java in my rootsrc folder. The confirm.jsp file (located in the root) imports the class, and uses it's methods. After I deploy the application using ant, and try to run my app, I get the following exception org.apache.jasper.JasperException: Fruit and the following root cause: java.lang.ClassNotFoundException: Fruit The Fruit.class is located in the WEB-INF folder in my remote root directory, and the confirm.jsp is directly located in the root. What's wrong? Do I need to creat a web.xml? If so why and how? I'm trying to learn JSP, but I find myself spending more time on configuring Tomcat.    More>>

Hi,


I placed my fruit.java in my rootsrc folder. The confirm.jsp file (located in the root) imports the class, and uses it's methods. After I deploy the application using ant, and try to run my app, I get the following exception


org.apache.jasper.JasperException: Fruit


and the following root cause:


			
java.lang.ClassNotFoundException: Fruit


The Fruit.class is located in the WEB-INF folder in my remote root directory, and the confirm.jsp is directly located in the root. What's wrong?


Do I need to creat a web.xml? If so why and how? I'm trying to learn JSP, but I find myself spending more time on configuring Tomcat.


Thanks a lot for any help,
Joost

   <<Less

Re: Tomcat doesn't see my beans :-(

Posted By:   Ed_Hoden  
Posted On:   Thursday, December 13, 2001 01:59 PM

In Tomcat web-applications, your class files need to start in a subdirectory of WEB-INF called classes. You should set up a directory structure something like this...


  • app-name-here

    • WEB-INF

      • classes

      • lib







Stand alone class files should go in and under the classes directory. Jar files for the web-app should go in the lib directory.


HTH - Ed
About | Sitemap | Contact