tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Alberto Peláez Ayala <c...@cuao.edu.co>
Subject RE: How to implements JavaBean in Tomcat 4.1.x in Win 2000 and solaris
Date Tue, 01 Apr 2003 19:19:27 GMT
Hello friend, thanks for help me. I try with your idea, but appear the same
problem.

-----Mensaje original-----
De: graghupathy@aegonuk.co.uk [mailto:graghupathy@aegonuk.co.uk]
Enviado el: martes, 01 de abril de 2003 12:03
Para: tomcat-user@jakarta.apache.org
Asunto: RE: How to implements JavaBean in Tomcat 4.1.x in Win 2000 and
solaris


remove the constructor and initialize the variable to null  and try ...

should be

package userinfo;
import java.io.*;

public class FormBean implements Serializable

  private String name = null;
  private String email = null;

  public void setName(String name)

   this.name = name;
  }
  public String getName()

   return name;
  }
  public void setEmail(String email)

   this.email = email;
  }
  public String getEmail()

   return email;
  }
}



-----Original Message-----
From: Carlos Alberto Peláez Ayala [mailto:capa@cuao.edu.co]
Sent: 01 April 2003 18:00
To: tomcat-user@jakarta.apache.org
Subject: How to implements JavaBean in Tomcat 4.1.x in Win 2000 and
solaris


Hello Friends,
Iam a beggining in the use of javabeans and jsp pages.
I try to run this example:

The file login7.jsp:
<jsp:useBean id="FormBean" class="userinfo.FormBean"/>
<jsp:setProperty name="FormBean" property="*"/>
<HTML>
<HEAD>
<TITLE>Form Example</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffcc">
<% if (request.getParameter("name")==null
 && request.getParameter("email") == null) { %>
<CENTER>
<H2>User Info Request Form </H2>
<form method="GET" action="process2.jsp">
<P>
Your name: <input type="text" name="name" size=27>
<p>
Your email: <input type="text" name="email" size=27>
<P>
<input type="submit" value="Process">
</FORM>
</CENTER>
<% } else { %>
<P>
<B>You have provided the following info</B>:
<P>
<B>Name</B>: <jsp:getProperty name="FormBean" property="name"/>
<P>
<B>Email</B>: <jsp:getProperty name="FormBean" property="email"/>
<% } %>
</BODY>
</HTML>


and the file FormBean.java:

package userinfo;
import java.io.*;

public class FormBean implements Serializable

  private String name;
  private String email;
  public FormBean()

   name = null;
   email = null;
  }
  public void setName(String name)

   this.name = name;
  }
  public String getName()

   return name;
  }
  public void setEmail(String email)

   this.email = email;
  }
  public String getEmail()

   return email;
  }
}



When i try to run the login7.jsp in my browser, appear the follow error:

HTTP Status 500 -

----------------------------------------------------------------------------
----

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: userinfo.FormBean
	at
org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:18
3)
	at
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:69
1)
	at org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:552)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:232)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
	at
org.apache.jasper.compiler.Generator.generate(Generator.java:1871)
	at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:238)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
	at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:4
74)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:1
84)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:493)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:386)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:530)
	at java.lang.Thread.run(Unknown Source)


root cause

java.lang.ClassNotFoundException: userinfo.FormBean
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1428)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1274)
	at
org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:18
1)
	at
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:69
1)
	at org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:552)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:232)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
	at
org.apache.jasper.compiler.Generator.generate(Generator.java:1871)
	at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:238)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
	at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:4
74)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:1
84)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:493)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:386)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:530)
	at java.lang.Thread.run(Unknown Source)



----------------------------------------------------------------------------
----

Apache Tomcat/4.1.18



Please, tell me how to i run a jsp page with javebean implementation.
Thanks for help me and sorry by my english.




Carlos Alberto


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

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



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


Mime
View raw message