Hello,
I've created my first entity bean like this..
bookdtls.java

Java Code:
package bk;

import java.io.Serializable;
import java.util.*;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Collection;
import javax.persistence.*;



/**
 *
 * @author RITU
 */
@Entity
@Table(name="BookDetails")
@SequenceGenerator(name = "book_sequence", sequenceName = "book_id_seq") 
public class bookdtls implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id; private String name; private String author; private String publication;
    
    public bookdtls(){
        super();
    }
public bookdtls(Long id, String name, String authr, String pbltn){
        super();
       this.id = id; 
       this.name = name;
        this.author = authr;
        this.publication = pbltn;
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public String getBookName() {
        return name;
    }

    public void setBookName(String Bookname) {
        this.name = Bookname;
    }
     public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }
     public String getPublication() {
        return publication;
    }

    public void setPublication(String publication) {
        this.publication = publication;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof bookdtls)) {
            return false;
        }
        bookdtls other = (bookdtls) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bk.bookdtls[id=" + id + " name="+name+" author="+author+" publication="+publication+"]";
    }

}
which get called in the following session bean...
bookbank.java
Java Code:
package bk;

import javax.ejb.Stateful;
import java.util.Iterator;
import java.util.Collection;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.io.Serializable;
import javax.ejb.Remote;


/**
 *
 * @author RITU
 */
@Stateful
public class bookbank implements Serializable, bookbankRemote, bookbankLocal {
    @PersistenceContext(unitName="ChkEntity-ejbPU")
    EntityManager em;
    protected bookdtls book;
    protected Collection<bookdtls>booklist;

    public void addBook(Long id, String title, String author, String publication) {
        if (book==null){
            book=new bookdtls(id, title, author, publication);
            em.persist(book);
        }
  
       
    }
   
    
}
i called this bookbank.java through addBook.java servlet..
Java Code:
package pack;
import bk.bookbankLocal;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class addbook extends HttpServlet {
   
    
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        Long id=Long.parseLong(request.getParameter("bookid"));
        String nm=request.getParameter("booknm");
        String authr=request.getParameter("author");
        String pub=request.getParameter("publication");

        try {
            Context c = new InitialContext();
           bookbankLocal bk= (bookbankLocal) c.lookup("java:global/ChkEntity/ChkEntity-ejb/bookbank!bk.bookbankLocal");
            bk.addBook(id, nm, authr, pub);
            System.out.println("Data Saved.");
        }
        catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }finally {
            out.close();
        }
    } 

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** 
     * Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    } 

    /** 
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /** 
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
now when i try to run this i am getting this error saying--
Java Code:
Initial deploying ChkEntity to C:\Users\RITU\Documents\NetBeansProjects\ChkEntity\dist\gfdeploy\ChkEntity
Completed initial distribution of ChkEntity
Initializing...
deploy?path=C:\Users\RITU\Documents\NetBeansProjects\ChkEntity\dist\gfdeploy\ChkEntity&name=ChkEntity&force=true failed on GlassFish Server 3
C:\Users\RITU\Documents\NetBeansProjects\ChkEntity\nbproject\build-impl.xml:293: The module has not been deployed.
BUILD FAILED (total time: 3 seconds)
what does it mean?? how could i rectify this error?? Please help someone, i am new to Entitybeans, so i am feeling like :confused:
my persistence.xml file is...
Java Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="ChkEntity-ejbPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>bks</jta-data-source>
    <properties>
      <property name="eclipselink.ddl-generation" value="create-tables"/>
    </properties>
  </persistence-unit>
</persistence>
web.xmlfile is..
Java Code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <servlet>
        <servlet-name>addbook</servlet-name>
        <servlet-class>pack.addbook</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>addbook</servlet-name>
        <url-pattern>/addbook</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>addItems.html</welcome-file>
    </welcome-file-list>
    <ejb-local-ref>
        <ejb-ref-name>bookbank</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>bk.bookbankLocal</local>
        <ejb-link>ChkEntity-ejb.jar#bookbank</ejb-link>
    </ejb-local-ref>
</web-app>
I am totally new to Entitybeans/POJOs, can some one tell me where should i place my application.xml file?
I am using Netbeans 6.9.1 and EJB 3.0.
I hadn't use Hibernate, should i use that?