Note that there are some explanatory texts on larger screens.

plurals
  1. POjavaee 5 bookstore sample to run with jboss 4.0 and hibernate
    primarykey
    data
    text
    <p>when i am trying to deploy bookstore1 web application from Netbeans ( JavaEE5 sample ) , i have changed the persistence.xml file to use hibernate :</p> <pre><code>&lt;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"&gt; &lt;persistence-unit name="book" transaction-type="JTA"&gt; &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt; &lt;jta-data-source&gt;java:/jdbc/BookDB&lt;/jta-data-source&gt; &lt;class&gt;com.sun.bookstore.database.Book&lt;/class&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>and my <code>mysql-ds.xml</code> file is :</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;datasources&gt; &lt;local-tx-datasource&gt; &lt;jndi-name&gt;jdbc/BookDB&lt;/jndi-name&gt; &lt;connection-url&gt;jdbc:mysql://localhost:3306/bookdb&lt;/connection-url&gt; &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt; &lt;user-name&gt;root&lt;/user-name&gt; &lt;password&gt;1234&lt;/password&gt; &lt;exception-sorter-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter&lt;/exception-sorter-class-name&gt; &lt;metadata&gt; &lt;type-mapping&gt;mySQL&lt;/type-mapping&gt; &lt;/metadata&gt; &lt;/local-tx-datasource&gt; &lt;/datasources&gt; </code></pre> <p>I am getting below error:</p> <pre> [STDOUT] Couldn't create bookstore database bean: null 19:16:53,846 INFO [[/bookstore1]] Marking servlet ShowCartServlet as unavailable 19:16:53,846 ERROR [[ShowCartServlet]] Allocate exception for servlet ShowCartServlet javax.servlet.UnavailableException: Couldn't get database. at com.sun.bookstore1.servlets.ShowCartServlet.init(ShowCartServlet.java:39) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) 19:17:17,534 INFO [[ShowCartServlet]] Servlet ShowCartServlet is currently unavailable </pre> <p>Can you please let me know where i am making wrong...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload