Hi myself ;),

Forget my last post. I remembered my experience with RMI and checked
that my Bean was really serializable, it wasn't. Even though the class
is found, sometimes non seriable classes that should be serializable
give this "Class not found" exception so in case it helps somebody, the
mantra I learnt from RMI is that "A class is serializable if it
implements Serializable AND all it's members in RUNTIME are either
transient or serializable". This usually gives people headaches when non
serializable elements are put inside hashtables in runtime, the class
then becomes non serializable. I hope somebody can benefit from this
experience as well.
Regards,
Dan
-------------------------------------------
Daniel Lopez Janariz ([EMAIL PROTECTED])
Web Services
Computer Center
Balearic Islands University
-------------------------------------------


Daniel Lopez wrote:
>
> Hi guys,
>
> Now that I decided to use Beans I'm getting a strange problem which
> could be described as follows:
> This is my old JSP page
> *** No-beans versions that works
> <%@ page import="es.uib.waf.UIBwad"%>
> <BODY bgcolor="#FFFFCC">
> <%
>         UIBwad descriptor = (UIBwad)request.getAttribute("descriptor");
>         if(descriptor != null)
>         {
> %>
> ....
>
> And here it is the new version
> *** No-beans versions that does NOT work
> <%@ page import="es.uib.waf.UIBwad"%>
> <BODY bgcolor="#FFFFCC">
> <jsp:useBean id="descriptor" class="es.uib.waf.UIBwad" scope="request">
>
> The error is giving me is shown below. I find it quite strange as I had
> a look at the source of the JSP and the import is correctly written ane
> everthing seems fine. The classpath setting is okey as the first version
> of the JSP works so... Might it be a problem with the Bean? The class
> UIBwad has a no-arg constructor, all the necessary setters and
> implements Serializable so... what else do I need?
>
> Exception:
> javax.servlet.ServletException: Could not load class
> 'es.uib.waf.UIBwad'.  Class was not found.
>         at com.livesoftware.jsp.JSPRuntime.instantiateBean(JSPRuntime.java:88)
>         at jsp.waf.WAFui._jspService(WAFui.java:39)
>
> Environment:
> WinNT + Apache 1.3.9 + JRun 2.3.3(Build 153 + Patch) (JSP 1.0)
>
> Any hints?
>
> Thanks in advance
> Dan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to