Hmm...then I'm not sure what's going on...so is there a package statement in
InfoBean?
As for a setting in tomcat, I don't think you have to set anything to get a
bean to instantiate. I wonder if it has anything to do with Jann mentioned.
I've always put my jsp's in /webapps/mycontext and my beans in
/webapps/mycontext/WEB-INF/classes/package_path and not had any problems
with instantiation.
Also, check your case on the jsp directive. I noticed you've got
<jsp:useBean.../>, and if you copied/pasted that into your original message,
then you've got that part correct. However, in one I was trying to do, I
thought I had the case correct, but I actually had <jsp:usebean..../> and
that was why I couldn't get it to instantiate.
--Kyle
-----Original Message-----
From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 5:48 PM
To: [EMAIL PROTECTED]
Subject: RE: Instantiating Beans on Tomcat
It is in a package, but it is at the very top level. It is not a classpath
issue, I have tried to move it to a different directory which is off the
classpath. When I do that, the error says that it can't find the class at
all. This error says the class is found, but for some reason can't create a
bean out of it. I would think that my problem is that I don't have a
constructor with no parameters, but that is not the case. I'm thinking
there are some permission settings to run a bean or something maybe. ???
Brandon
-----Original Message-----
From: Kyle Tippetts [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 6:38 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Instantiating Beans on Tomcat
Is InfoBean in a package? If it is, you need to put the fully-qualified name
in the class= attribute.
It could also be a classpath issue. For example, if your jsp sits at
/jakarta-tomcat/webapps/app, and your bean sits at
/jakarta-tomcat/webapps/app/WEB-INF/classes/com/foo, then you do need to put
/jakarta-tomcat/webapps/app/WEB-INF/classes on the classpath...at least
that's what I've found I have to do to get the beans to instantiate from a
jsp....
--Kyle
-----Original Message-----
From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 5:15 PM
To: [EMAIL PROTECTED]
Subject: RE: Instantiating Beans on Tomcat
Yeah, there must be something I'm missing, maybe there's some setting in
tomcat which allows me to use beans or something, but I can't find where
that would be.
Brandon
-----Original Message-----
From: Hunter Hillegas [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 6:00 PM
To: Tomcat User List
Subject: Re: Instantiating Beans on Tomcat
I was getting those but it was because my bean didn't have a constructor
that took no args but it looks like yours does...
Not sure...
Hunter
> From: "Brandon Cruz" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 10 Apr 2001 17:54:24 -0500
> To: <[EMAIL PROTECTED]>
> Subject: Instantiating Beans on Tomcat
>
> I am trying to instantiate a very simple bean on Tomcat in a JSP using the
> directive...
>
> <jsp:useBean id="sessionBean" scope="session" class="InfoBean" />
>
> Everytime I try to run it, I get the following exception...
>
> javax.servlet.ServletException: Cannot create bean of class InfoBean