users@glassfish.java.net

Re: Couldn't create bookstore database bean: Unable to retrieve EntityManagerFa

From: <glassfish_at_javadesktop.org>
Date: Thu, 23 Jul 2009 15:58:08 PDT

Okay. I have edit persistence.xml to:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
  <persistence-unit name="book" transaction-type="JTA">
    <jta-data-source>jdbc/__default</jta-data-source>
    <properties>
            <property name="eclipselink.ddl-generation" value="create-tables"/>
           </properties>
  </persistence-unit>
</persistence>

And now my browser says:
The application is unavailable. Please try later.

The server.log is:
INFO: Loading application bookstore1 at /bookstore1
INFO: Deployment of bookstore1 done is 3,032 ms

INFO: =======================================================
The number of hits is: 1
=======================================================

SEVERE: StandardWrapperValve[BookStoreServlet]: PWC1406: Servlet.service() for servlet BookStoreServlet threw exception
com.sun.bookstore.exception.BookNotFoundException: Couldn't find book: 203
        at com.sun.bookstore1.database.BookDBAO.getBook(BookDBAO.java:58)
        at com.sun.bookstore1.servlets.BookStoreServlet.doGet(BookStoreServlet.java:75)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1461)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:346)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:216)
        at com.sun.bookstore1.filters.HitCounterFilter.doFilter(HitCounterFilter.java:71)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:216)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:291)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:187)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:647)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:351)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:249)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:146)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:746)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:655)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:905)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:161)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
[Message sent by forum member 'taitruong' (taitruong)]

http://forums.java.net/jive/thread.jspa?messageID=357329