Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

java bean problem

Thread view: 
albert85 - 16 Jan 2006 01:02 GMT
my problem is i have three classes file that all is javabean package file
which is bgoc, common, mrs.
when i run on the tomcat 5.5, error detected on my few of jsp file. the error
detected is like this:
"org.apache.jasper.JasperException: Cannot find any information on property
'EmpName' in a bean of type 'common.InfoBean'"

is it the page cannot get my javabean file? i put the javabean file in the
$CATALINA_HOME$/common/classes is it the right way?
how can i make the system can detect my javabean file?

hope those the expert can give the way to solve this problem.... thank you

regards,
albert
John C. Bollinger - 16 Jan 2006 04:19 GMT
> my problem is i have three classes file that all is javabean package file
> which is bgoc, common, mrs.
[quoted text clipped - 4 lines]
>
> is it the page cannot get my javabean file?

No, it looks more like a problem with your JSPs.  Bean property names
begin with lowercase letters (unless you expend considerable effort to
make it otherwise).  It is potentially confusing that the initial
lowercase letter by convention appears uppercase in getter and setter
names; for example, getEmpName() and setEmpName(String) would be the
getter and setter for property "empName".

If Jasper couldn't find the bean class then it would have said so; if it
goes so far as to check the presence of a particular property then it
has already introspected the bean class.

>                                              i put the javabean file in the
> $CATALINA_HOME$/common/classes is it the right way?

NO.  The correct place for classes specific to your web-application is
inside a jar in the webapp's WEB-INF/lib/ directory.  If you prefer, you
can also put it under WEB-INF/classes/ in a directory hierarchy
mirroring the package structure.

If multiple web applications in the same Tomcat instance need to share
classes then those classes should go into Tomcat's
$CATALINA_HOME/shared/lib/ or $CATALINA_HOME/shared/classes/ directory.

Under no circumstances should you put user classes anywhere under
$CATALINA_HOME/common/.

See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Moreover, make sure the classes are in exactly one place within any
given Tomcat instance's sphere.  I promise you that following this rule
will save you hours of grief and frustration.

> how can i make the system can detect my javabean file?

Put it in the classpath.  You have actually done this already, it seems,
even though you haven't gotten it into the correct part of the classpath.

Signature

John Bollinger
jobollin@indiana.edu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.