India wrote:
>
> You need to first import your bean class before calling the jsp:useBean tag
> as well as check out the syntax of the useBean tag.
> <%@ page import = "harman.BeanTest" %>

No, import has nothing to do with run-time exceptions. The import mechanism
in Java is just a way to avoid typing the fully qualified class name
(package name plus class name) in your code. It's only used at compilation
time.

The problem described by Cory, below, is most likely a class path problem.
Make sure that the harman.BeanTest class is included in the class path
correctly, i.e. as a file named "BeanTest.class" located in a subdirectory
(in a JAR file or to a file system directory that's in the class path)
named "harman".

> ----- Original Message -----
> From: Cory L Hubert <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 02, 1999 7:33 AM
> Subject: Can't create Bean Object????
>
> >         Check out this error I get.
> >
> >         500 Internal Server Error
> >         javax.servlet.ServletException: Can't create the bean Object:
> Object
> > [Object]
> >         at com.livesoftware.jrun.plugins.jsp.JSP.getBean(JSP.java:1392)
> >         at jsp.testbeans.service(testbeans.java:82)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> >         at
> com.livesoftware.jrun.plugins.jsp.JSPCore.runServlet(JSPCore.java:763)
> >         at com.livesoftware.jrun.plugins.jsp.JSP.callPage(JSP.java:621)
> >         at com.livesoftware.jrun.plugins.jsp.JSP.service(JSP.java:543)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> >         at com.livesoftware.jrun.JRun.runServlet(JRun.java, Compiled Code)
> >         at
> com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java:116)
> >         at
> >
> com.livesoftware.jrun.JRunGeneric.handleProxyConnection(JRunGeneric.java:78)
> >         at
> >
> com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(JR
> > unProxyServiceHandler.java:102)
> >         at
> >
> com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.ja
> > va, Compiled Code)
> >
> >
> > ------ My Bean ------
> > package harman;
> > import java.io.Serializable;
> >
> > public class BeanTest implements Serializable
> > {
> >                 private String name ="Cory L Hubert";
> >                 private String title = "Site Developer";
> >                 private String company = "Plumb Design";
> >
> >                 public static void main(String args[]) {
> >                 System.out.println("Package Works");
> >                 }
> >
> >                 public String getName() {
> >                 return name;
> >                 }
> >
> >                 public void setName(String name) {
> >                 this.name = name;
> >                 }
> >
> >                 public String getTitle() {
> >                 return title;
> >                 }
> >
> >                 public void setTitle(String Title) {
> >                 this.title = title;
> >                 }
> >
> >                 public String getCompany() {
> >                 return company;
> >                 }
> >
> >                 public void setCompany(String company)
> >                 {
> >                         this.company = company;
> >                 }
> > }
> > ----- My JSP -----
> > <html>
> > <head>
> > <title>Bean Testin</title>
> > </head>
> >
> > <body>
> > <useBean name="BeanTest" class="harman.BeanTest" scope="session">
> > <getProperty name="BeanTest" property="name">
> > </useBean>
> >
> > </body>
> > </html>

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
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