IntelliJ Java IDE
The moose likes Tomcat and the fly likes Help with Java Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Help with Java Beans" Watch "Help with Java Beans" New topic
Author

Help with Java Beans

Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 250
I am new to programming web apps with Java Beans and I am having some problems. I am running an apache-tomcat connection and everything seems to be working with the examples and such. I want my web application to be in my /var/www apache document root so I created a new Host tag in server.xml where name = sub.domain.com and document root = /var/www/java_apps/
in this i have two contexts ex1 and ex2 with document root /ex1 and /ex2 well I have no problems accessing these with the URL:
sub.domain.com/ex1/index.jsp and sub.domain.com/ex2/index.jsp
However, when I try to access a bean in ex2/index.jsp that is located in /var/www/java_apps/ex2/WEB-INF/classes/com/bean/bean.class I get a class not found error. I referenced the bean using: com.bean but it does not seem to find it. Any help would be greatly appreciated.


http://www.goodercode.com
SCJP 1.4
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18652
I'm moving this from EJB to Apache/Tomcat since they do better on configuration issues...


"I'm not back." - Bill Harding, Twister
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Does the page compile? (are you importing the bean?)

How are you trying to access the bean?
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 250
I have gotten it working I had left the last name out of the package i.e.:
com.HelloBean.HelloBean to retrieve classes/com/HelloBean/HelloBean.class
 
 
subject: Help with Java Beans
 
Threads others viewed
Button Recording to a File
Struts - JSR168 Ajax Portlet - Problem!
Deployment on Tomcat 6 error: Unable to compile class for JSP
Why is static considered as overriding?
JForum is not working with the IP address
MyEclipse, The Clear Choice