You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by PTaco <be...@yahoo.com> on 2010/12/17 18:50:47 UTC

The value for the useBean class attribute *class* is invalid

I updated a currently working java web project by copying it, and renaming
it. However, I'm getting the error in the title on a few library files. For
some reason Tomcat either can't see the library file or something else is
wrong and I have no idea what it could be. All of my library files are in
their correct locations. Another strange thing is that I get that error MOST
of the time, but if you refresh the page, a second error will also randomly
show on screen saying "org.apache.jasper.JasperException:
org.apache.jasper.JasperException: Unable to load class for JSP"


Everything I have looked into says its because these files aren't in the
right locations OR the package names are incorrect.  I can assure you both
are correct because this is an exact copy/paste from a currently WORKING web
project.

Also, if i take the working project, copy it, and do nothing but re-name it
in the tomcat folder, the same error is thrown in the new we project, which
is an EXACT copy.
-- 
View this message in context: http://old.nabble.com/The-value-for-the-useBean-class-attribute-*class*-is-invalid-tp30483280p30483280.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: The value for the useBean class attribute *class* is invalid

Posted by PTaco <be...@yahoo.com>.

Okay. Where is the class file for com.upsnap.uatools.UAToolsBean? Scan
all your .jar files to make sure it only occurs in a single place. Also
make sure you haven't done something silly like placed that same
class/jar into Tomcat's lib/ directory as well.

its all in 1 place.  the jar file is named upsnap-uatools-1.4.8.jar

Also, please provide the full stack trace (including any "Caused by"
clauses) of the error that you get.

Here is one of the two errors.

org.apache.jasper.JasperException:
/sprinthoroscopes/_uatools_helper.jsp(9,0) The value for the useBean class
attribute com.upsnap.uatools.UAToolsBean is invalid.

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)

org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1203)
	org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1160)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
	org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
	org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:638)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
	org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
	org.apache.jasper.compiler.Generator.generate(Generator.java:3365)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

this is the other...

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable
to load class for JSP

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

org.apache.jasper.JasperException: Unable to load class for JSP

org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:620)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.ClassNotFoundException:
org.apache.jsp.sprinthoroscopes.welcome_jsp
	java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	java.security.AccessController.doPrivileged(Native Method)
	java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)

org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


Are there any other errors in either catalina.out or any of the other
log files in the logs/ directory?

catalina log produces..
java.lang.ClassNotFoundException:
org.apache.jsp.sprinthoroscopes.welcome_jsp
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
        at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
        at
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
        at
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:619)


What did you copy/paste/rename? If you just borrowed this JSP and it
references a bean that was set up explicitly in the old project but not
the new one, then you may have some problems like not being able to
initialize the application-scoped bean properly if it's not found in the
application scope when the JSP runs.

to took the entire folder in webapps.  the entire app folder i copied and
pasted under a new name.

in other words, the app folder is named horoscopes.  I copied it in webapps
and pasted it in webapps under the different name sprinthoroscpes. 
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0LuHgACgkQ9CaO5/Lv0PDyKwCfd8KvilMqiSrmk04iPny0ABo+
qWAAoIRXVVdYUZwwGQWqyboNTkZO0hAG
=/AP5
-----END PGP SIGNATURE-----

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




-- 
View this message in context: http://old.nabble.com/The-value-for-the-useBean-class-attribute-*class*-is-invalid-tp30483280p30484157.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: The value for the useBean class attribute *class* is invalid

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PTaco,

On 12/17/2010 1:21 PM, PTaco wrote:
> I'm using Apache Tomcat/6.0.18

You should seriously consider upgrading: Tomcat 6.0.29 is available and
.18 was released over 2 years ago.

> By library I mean .jar files located in the lib folder under
> webapps/project/WEB-INF/lib
> the URL is www.xsvoice.com/nextel/sprinthoroscopes
> I have found the declaration, its
> <jsp:useBean
>     id="uaBean"
>     scope="application"
>     class="com.upsnap.uatools.UAToolsBean" />

Okay. Where is the class file for com.upsnap.uatools.UAToolsBean? Scan
all your .jar files to make sure it only occurs in a single place. Also
make sure you haven't done something silly like placed that same
class/jar into Tomcat's lib/ directory as well.

Also, please provide the full stack trace (including any "Caused by"
clauses) of the error that you get.

Are there any other errors in either catalina.out or any of the other
log files in the logs/ directory?

> I know this error is usually caused from not having the correct path in the
> class portion of the useBean declaration.  However as I said before, I've
> taken an exact copy/paste from a working web application and just re-named
> the project and it still throws this error.

What did you copy/paste/rename? If you just borrowed this JSP and it
references a bean that was set up explicitly in the old project but not
the new one, then you may have some problems like not being able to
initialize the application-scoped bean properly if it's not found in the
application scope when the JSP runs.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0LuHgACgkQ9CaO5/Lv0PDyKwCfd8KvilMqiSrmk04iPny0ABo+
qWAAoIRXVVdYUZwwGQWqyboNTkZO0hAG
=/AP5
-----END PGP SIGNATURE-----

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


Re: The value for the useBean class attribute *class* is invalid

Posted by PTaco <be...@yahoo.com>.
Sorry Chris,

I'm using Apache Tomcat/6.0.18
By library I mean .jar files located in the lib folder under
webapps/project/WEB-INF/lib
the URL is www.xsvoice.com/nextel/sprinthoroscopes
I have found the declaration, its
<jsp:useBean
    id="uaBean"
    scope="application"
    class="com.upsnap.uatools.UAToolsBean" />

I know this error is usually caused from not having the correct path in the
class portion of the useBean declaration.  However as I said before, I've
taken an exact copy/paste from a working web application and just re-named
the project and it still throws this error.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PTaco,

*sigh*

What Tomcat version?
What is a "library"?
Where are you putting your "libraries" if they are in the "correct" place?
What is the URL you are trying to access?
Have you found the useBean declaration that it causing the error(s)?
Can you post that <jsp:useBean>?

You have provided basically no information except that you got an error
message at some point. Provide more details if you wish to get any help.

- -chris



-- 
View this message in context: http://old.nabble.com/The-value-for-the-useBean-class-attribute-*class*-is-invalid-tp30483280p30483509.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: The value for the useBean class attribute *class* is invalid

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PTaco,

*sigh*

What Tomcat version?
What is a "library"?
Where are you putting your "libraries" if they are in the "correct" place?
What is the URL you are trying to access?
Have you found the useBean declaration that it causing the error(s)?
Can you post that <jsp:useBean>?

You have provided basically no information except that you got an error
message at some point. Provide more details if you wish to get any help.

- -chris

On 12/17/2010 12:50 PM, PTaco wrote:
> 
> I updated a currently working java web project by copying it, and renaming
> it. However, I'm getting the error in the title on a few library files. For
> some reason Tomcat either can't see the library file or something else is
> wrong and I have no idea what it could be. All of my library files are in
> their correct locations. Another strange thing is that I get that error MOST
> of the time, but if you refresh the page, a second error will also randomly
> show on screen saying "org.apache.jasper.JasperException:
> org.apache.jasper.JasperException: Unable to load class for JSP"
> 
> 
> Everything I have looked into says its because these files aren't in the
> right locations OR the package names are incorrect.  I can assure you both
> are correct because this is an exact copy/paste from a currently WORKING web
> project.
> 
> Also, if i take the working project, copy it, and do nothing but re-name it
> in the tomcat folder, the same error is thrown in the new we project, which
> is an EXACT copy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0LpZ8ACgkQ9CaO5/Lv0PDYlgCffH3RuJilrotijJCZzUFgkOW2
KLMAnA/W5PemY8ROUVlLnBVeZi6Fd5We
=Qfy/
-----END PGP SIGNATURE-----

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