Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat can't see beans.

Status
Not open for further replies.

libaax

Technical User
Jul 22, 2003
38
US
Tomcat needs coffee. It cant see beans...the only time beans seem to work is when they r referenced through servlets, because they happen to be in the same folder. The problem is when the beans are referenced through jsp which happen to be in different folder....
I dont have this problem in my laptob...But, I dont know what I've done to configure the other one..Here is an example of error I see in some cases...(not all cases).


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] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] E:\Tomcat 4.1\work\Standalone\localhost\_\SaveName_jsp.java:41: cannot resolve symbol
[javac] symbol : class UserData
[javac] location: class org.apache.jsp.SaveName_jsp
[javac] UserData user = null;
[javac] ^
[javac] E:\Tomcat 4.1\work\Standalone\localhost\_\SaveName_jsp.java:43: cannot resolve symbol
[javac] symbol : class UserData
[javac] location: class org.apache.jsp.SaveName_jsp
[javac] user = (UserData) pageContext.getAttribute("user", PageContext.SESSION_SCOPE);
[javac] ^
[javac] E:\Tomcat 4.1\work\Standalone\localhost\_\SaveName_jsp.java:46: cannot resolve symbol
[javac] symbol : class UserData
[javac] location: class org.apache.jsp.SaveName_jsp
[javac] user = (UserData) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "UserData");
 
Thanks for your prompt suggestion but, I couldn't find anything that would lead to a solution at the site mentioned...
I flowed instructions to the letter...see instructions at

All my path variables are set. assuming "myApp" is package name
my jsp and project files are in:
e:\tomcat4.1\webapps\root\myApp
my beans and servlets are in:
e:\tomcat4.1\webapps\root\web-inf\classes\myApp

It's only the beans that are invisible to jsp and not to servlets:
Please see if you can find an specific solution...

ALLUSERSPROFILE=D:\Documents and Settings\All Users.WINDOWS
APPDATA=D:\Documents and Settings\libaax.DF8GUPGR56ERH51\Application Data
BOOKSHELF=e:\ifor\WIN\BIN\EN_US
CATALINA_HOME=e:\tomcat4.1
CLASSPATH=.;E:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes;d:\advanced;E:\jspdev;E:\SQLLIB\java\db2java.zip;e:/Tomcat 4.1/common/lib/servlet.jar;E:\SQLLIB\java\runtime.zip;
CommonProgramFiles=D:\Program Files\Common Files
COMPUTERNAME=MYSOLARIS
ComSpec=D:\WINDOWS\system32\cmd.exe
DB2INSTANCE=DB2
HELP=e:\ifor\WIN\BIN
HOMEDRIVE=D:
HOMEPATH=\Documents and Settings\libaax.DF8GUPGR56ERH51
I4_INSTALL_DRIVE=e:
I4_LANG=EN_US
IMNINST=help
IMNINSTSRV=E:\IMNNQ_NT
INCLUDE=E:\SQLLIB\INCLUDE
IPF_PATH32=e:\ifor\WIN\BIN\EN_US
JAVA_HOME=D:\jbuilder9\jdk1.4
LIB=E:\SQLLIB\LIB
LOGONSERVER=\\MYSOLARIS
NLSPATH=e:\ifor\LS\MSG\%L\%N
NMAPDIR=D:\Program Files\NMapWinNUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32\Wbem;D:\jbuilder9\jdk1.4\bin;D:\Program Files\NMapWin\\bin;e:\ifor\WIN\BIN;e:\ifor\WIN\BIN\EN_US;E:\IMNNQ_NT;E:\SQLLIB\BIN;E:\SQLLIB\FUNCTION;E:\SQLLIB\SAMPLES\REPL;E:\SQLLIB\HELP;e:\Tomcat4.1\common\lib
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0602
ProgramFiles=D:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=D:
SystemRoot=D:\WINDOWS
TEMP=D:\DOCUME~1\LIBAAX~1.DF8\LOCALS~1\Temp
TMP=D:\DOCUME~1\LIBAAX~1.DF8\LOCALS~1\Temp
TOMCAT_HOME=E:\tomcat4.1
USERDOMAIN=MYSOLARIS
USERNAME=libaax
USERPROFILE=D:\Documents and Settings\libaax.DF8GUPGR56ERH51
windir=D:\WINDOWS
 
Do you have this at the top of your code for your JSP page?
<jsp:useBean id=&quot;DBBeanId&quot; scope=&quot;page&quot;
class=&quot;project.DBBean&quot; />


Is your bean part of a package?
 
Sorry I forgot to include this:

useBean id = what you want to refer to the bean as in your code

 
yea...It worked, after packaging it...But, it dont know why the default package doesnt work...!

Libaax
Hakuna Matata....;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top