tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: JasperException: The value for the useBean class ___ attribute is invalid
Date Thu, 19 Apr 2012 00:12:03 GMT
2012/4/19 Chris Patterson <tomcat@vittox.com>:
> Dear Konstantin, thanks for asking, I will try to answer your questions
>
> My experience level is relative, idea is to spend less time sharing your
> experience.
> I have installed Tomcat servers for many years mostly on Unix/Linux,
> and allready have a CentOS 5.6 with Tomcat 6.x (default) on  a local server.
>

OK. Thank you for detailed answer. It makes more sense now.

> I could deploy my "Dynamic Web Application" (eclipse language) named Test-03
> from a
> WAR format and it worked for both cases. _So it should not be the "code"._
> Of course it is not a Web App, its only a Test.
>
> Differences are:
> Local host has Tomcat 6.x, VPS server has Tomcat 5.3.35
> Local host has Java 1.6.0_22 / OpenJDK 64-Bit, VPS server has Java 1.6.0_29
> / Java Hotspot 64-Bit
>
> I checked following files having basically the same default configuration:
> server.xml, web.xml, context.xml
>
> When deployed on the /local server/ using the Tomcat Manager
> I see the following directories:
>
>  docs
>  examples
>  host-manager
>  manager
>  ROOT
>  sample
>  Test-03
>  Test-03.war
>
> Under ROOT is working the Test with URLs:
>  localhost:8080/prg1.jsp
>  localhost:8080/subdir/prg2.jsp
>
> Also work fine under Test-03
>    localhost:8080/Test-03/prg1.jsp
>    localhost:8080/Test-03/subdir/prg2.jsp
>
> The class files are respectively under ROOT/WEB-INF/classes and
> Test-02/WEB-INF/classes
> I just copied all content undet Test-03 to the ROOT folder and reloaded
> (using the Manager)
>

There are two apparent differences with the above copy+reload
procedure, as compared with "clean" deploy:

1. Reload != (Start + Stop).

It is a more lightweight operation than stopping and then starting a
webapp. Maybe something went wrong there.


2. You have not cleared the work directory of the ROOT webapp.

So there might be previous compiled classes for those JSPs. Depending
on timestamps they will be not recompiled.  (E.g. if you replace a jsp
with an older copy of that jsp, it will not be recompiled. Check
whether the clock on the server has the correct time. Thought it is
easier to just clean the work directory for the webapp.)


The resource id for that "The value for the useBean class" message is
"jsp.error.invalid.bean".

It is thrown is in jasper.compiler.Generator#visit() when it visits
<jsp:useBean> node if it cannot load the class specified in the
useBean tag.

http://svn.apache.org/viewvc/tomcat/tc5.5.x/tags/TOMCAT_5_5_35/jasper/src/share/org/apache/jasper/compiler/Generator.java?view=markup#l1199


You have to check that you did not forget to copy necessary supporting
classes and libraries. If that fails, try to write a simple jsp that
explicitly loads that class.

> The same excersise on the VPS running CPanel for a domain like etrust.us
> does only work for etrust.us/Test-03/prg1.jsp
> When trying etrust.us/prg1.jsp it only works until trying
> etrust.us/subdir/prg2.jsp,
> then i get the error 500: JasperException: The value for the useBean class
> ___ attribute is invalid
>
> Log file shows no more details about the issue.
>
> As "main directory" I mean the docBase referenced in the server.xml file.
> I have read the Servlet Specificacion (2.4) and did several changes to the
> configuration files with no success.
>
> Does someone here have any idea where to check some configuration ?
>
>
> El 18/04/2012 12:08 p.m., Konstantin Kolinko escribió:
>>
>> 2012/4/18 Chris Patterson<tomcat@vittox.com>:
>>>
>>> More on this, now I think it is some configuration issue for the tomcat
>>> server:
>>>
>>> I am using eclipse to check both JSP files, and they work without any
>>> problems
>>> in my PC. When deploying to Tomcat 5.5.35 to a sub-directory like de
>>> project
>>> name
>>> they also work fine. For example at www.domain.com/Test1/prg1.jsp and
>>> www.domain.com/Test1/subdir/prg2.jsp.
>>>
>>> If I copy them to the main directory with a shell command:
>>> cp -pr * .. from the Test1 directory and undeploy the Test1 application
>>> then only www.domain.com/prg1.jsp works and but the second one,
>>> www.domain.com/subdir/prg2.jsp gives me the same (500) error:
>>>
>>> /prg2.jsp(26,0) The value for the useBean class attribute
>>> jdbcbean.Stringbean is invalid.
>>>
>>>
>>> Is this like a BUG ? Or perhaps something about the Java version ?
>>> I have the following version running on a CentOS release 5.8:
>>> java version "1.6.0_29"
>>> Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
>>> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
>>>
>>> Hope this info help a little more to find a solution.
>>>
>>>
>> What is your experience level?
>>
>> Do you know what a "web application" is?
>> Have you read The Servlet specification, Documentation, etc.?
>>
>> Do you know where your classes must be put in a Web application?
>>
>> Your "main directory" terminology does not make sense.
>>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message