How to access java beans

I have just started learning JSPs and am running them from Tomcat version 4. I have copied the examples folder to my own folder (called Kathy) and am trying to run the examples from within my own folder. I have changed the server.xml file to add the Kathy folder to the Context as shown below. When I run simple JSPs from the Kathy folder, all works fine eg the date program. However when I run a jsp which imports a bean eg numguess, then I get a Tomcat 4.1 500 error. I am guessing that I am missing some pointer to the folder where the source and class files exist. They are in the C:\jtomcat4\tomcat\webapps\kathy\WEB-INF\classes\num folder. Where do I set up this pointer?? I look forward to hearing from you <!-- Tomcat Examples Context --> <Context path="/examples" docBase="examples" debug="0" reloadable="true"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_examples_log." suffix=".txt" timestamp="true"/> <Ejb name="ejb/EmplRecord" type="Entity" home="com.wombat.empl.EmployeeRecordHome" remote="com.wombat.empl.EmployeeRecord"/>

just change the environmental setting CLASSPATH to point to the dir/dir's that have your classes. If that doesnt work search your tomcat start script to see if that is setting your classpath, and change it there. (should be ${TOMCAT_HOME}/bin/startup .sh or .bat(for windows). set your classpath like this: SET CLASSPATH=C:\yourclasses;C:\yourlib\classes.jar;. or (on unix) setenv CLASSPATH /yourlib/classes.jar:/yourclasses/:.

You shouldn't have to play games with the CLASSPATH to make things work, and in fact, I'm not certain that in Tomcat's case that would even help. Tomcat maintains serveral distinct classpaths internally and it's sufficiently complex that I'll simply say if you need to know, check the Tomcat documentation at their website. You are listing an "Ejb" tag in your server.xml, but your message topic simply says "java beans", so I'm going on the assumption that you either aren't worrying about EJBs (yet) or that you just copied the specimen code. The EJB tag is specific to Tomcat 4 and I don't even know how functional it is at the moment. Also, it's best to know how standard JavaBean classes are located before going to the more complex EJB mechanism. So, for a NON-EJB named "Walkabout" in source file "Walkabout.java" (note capitalization!), which contains the statement: package com.wombat.employee; You'll need to place the compiled class "Walkabout.class" (Again, note capitalization!) in as follows. For a Windows system, with tomcat4 installed on drive C: C:\Tomcat4\webapps\kathy\WEB-INF\classes\com\wombat\employee\Walkabout.class Or in the case of Linux (other Unix-like systems similar) typically: /var/tomcat4/webapps/kathy/WEB-INF/classes/com/wombat/employee/Walkabout.class Did I mention that filenames must be precisely capitalized? Windows people often get into trouble because Windows doesn't care but Java does. Also, I recommend trying out a non-bean JSP (just something like "Hello, World") first, just to make sure that the problem is in fact related to the JavaBean and not to basic operation.

Customer surveys are for companies who didn't pay proper attention to begin with.

Check out the presentation that I gave at JavaOne last year on the subject of deploying web application, that ought to point you in the right place. Tim is right in that you DON'T need to modify the classpath, and in fact you should not do this. The presentation is avaliable on my website athttp://www.samjdalton.com/ Click on conferences, and it is under the JavaOne heading. S