Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!

  • Post Reply Bookmark Topic Watch Topic
  • New Topic


Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any one can help-me?
<%@ page import="java.sql. *" %>
<jsp:useBean id="item" class="ItemBean">
private Connection conexao = null;
private Statement declaracao = null;
private ResultSet resultado = null;
private String pesquisa = null;
private String atualiza = null;
ItemBean item = new ItemBean ();
try {
String query = "SELECT Pcp_Codigo FROM PC WHERE Pcp_Codigo in ('10000','10001')";
conexao = DriverManager.getConnection("jdbc dbc:SERVIDOR02:1433?database=NomedoBanco","NomedaTabela","PSW");
declaracao = conexao.createStatement();
resultado = declaracao.executeQuery(query);
if ({
catch (ClassNotFoundException e){
System.err.println ("Nao funfou driver");
catch (SQLException e){
System.err.println ("Nao funfou banco");
finally {
try{ if (conexao != null) conexao.close() ;}
catch (SQLException e) { }

<HTML><HEAD><TITLE> New Document </TITLE></HEAD>
<jsp:getProperty name="item" property="id"/>

ERROR ------------>

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
org.apache.jasper.JasperException: ItemBean
root cause
java.lang.ClassNotFoundException: ItemBean
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your bean is not found! Is it in a package? If so you'll need to prefix the tag accordingly.
You'll also need to change your name, JavaRanch
has a naming convention, described at
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Brian.
Please change your "Publicly Displayed Name" by modifying your Profile after reviewing the guidelines at
Assuming you will do that, I am answering your qstn. Please cooperate.
<jsp:useBean id="item" class="ItemBean">

It is not a good practice to put beans without a package. If you do this then the App server will look for the bean in the same package that your generated Servlet code is. Obviously, that fails.
Also, you are NOT using the useBean tag correctly.
<jsp:useBean ...>
[ code ]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!