Pessoal , estava fazendo o tutorial de CRUD no NetBeans usando GlassFish http://blogs.sun.com/arungupta/entry/totd_15_delete_update_row
E tive problema nesta linha (passo 8 do tutorial):
<a:widget name="yahoo.dataTable" service="data.jsp" />
Quando substituo uma tabela de dados estáticos pelo arquivo data.jsp que faz uma consulta dinâmica. O código do data.jsp é este :
<%@ page import="java.util.*" %>
<%@ page import="server.Books" %>
<%@ page import="javax.persistence.*" %>
<%
EntityManagerFactory emf = Persistence.createEntityManagerFactory("jmaki-databasePU");
EntityManager em = emf.createEntityManager();
List<Books> list = em.createNamedQuery("Books.findAll").getResultList();
out.println("{columns : [" +
"{ label : 'Title', id : 'title'}," +
"{ label :'Author', id : 'author'}," +
"{ label :'ISBN', id : 'isbn'}," +
"{ label :'Description', id : 'description'}" +
"],");
out.println("rows: [");
for (int i=0; i<list.size(); i++) {
Books b = list.get(i);
out.print("{ id: '" + b.getIsbn() + "', " +
"title: '" + b.getTitle() + "'," +
"author: '" + b.getAuthor() + "'," +
"isbn: '" + b.getIsbn() + "'," +
"description: '" + b.getDescription() + "'}");
if (i >< list.size()-1)
out.println(",");
else
out.println();
}
out.println("] }");
%>
O erro é este :
Failed to load data: doAjax error communicating with data.jsp. Server returned status code 500.
Como posso resolver ?