what does your database configuration in domain.xml look like
here is my derby database connection-pool configuration you can use for comparison
<domain log-root="${com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}/applications" version="5">
....
<resources>
...
<jdbc-resource pool-name="DerbyPool" jndi-name="jdbc/__default"></jdbc-resource>
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" res-type="javax.sql.XADataSource" name="__TimerPool">
<property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"></property>
<property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
<jdbc-connection-pool is-isolation-level-guaranteed="false" datasource-classname="org.apache.derby.jdbc.ClientDataSource" res-type="javax.sql.DataSource" name="DerbyPool">
<property name="PortNumber" value="1527"></property>
<property name="Password" value="APP"></property>
<property name="User" value="APP"></property>
<property name="serverName" value="localhost"></property>
<property name="DatabaseName" value="sun-appserv-samples"></property>
<property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
</resources>
datasource is identified thru xml configuration files in $GLASSFISH_HOME\lib\install\templates\resources\jdbc
here is my javadb_type4_datasource.xml you can use for reference
<!DOCTYPE resources PUBLIC "-//Sun Microsystems Inc.//DTD Application Server 9.0 Domain//EN" "*<install directory>/lib/dtds/sun-resources_1_3.dtd*">
<resources>
<jdbc-connection-pool
name="javadb_type4_pool"
datasource-classname="org.apache.derby.jdbc.ClientDataSource"
res-type="javax.sql.DataSource">
<property name="user" value="DB_USER"/>
<property name="password" value="DB_PASSWORD"/>
<property name="databaseName" value="DATABASE_NAME"/>
<property name="serverName" value="DB_HOSTNAME"/>
<property name="portNumber" value="1527"/>
<property name="connectionAttributes" value=";create=true"/>
</jdbc-connection-pool>
<jdbc-resource
enabled="true"
jndi-name="jdbc/javadb_type4"
object-type="user"
pool-name="javadb_type4_pool"/>
</resources>
of course you will need to tweak the
javadb_type4_datasource.xml
and domain.xml to supply the correct database parameters and attributes
HTH
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> To: users_at_glassfish.java.net
> Subject: Probelm deploying Servlet with PersistenceUnit
> From: forums_at_java.net
> Date: Tue, 21 Aug 2012 08:50:33 -0500
>
> Hi, I am quite new to glassfish and I have run into a problem I can't seem to
> get past. I am trying to create a webpage, it was working quite fine until I
> tried to integrate my database into code. I keep getting a runtime error and
> I have spent a large chunk of time trying to fix this but I am getting
> nowhere with this. I would appreciate some help if anyone can. Here is the
> code package org.glassfish.samples; import java.io.IOException; import
> java.io.PrintWriter; import javax.persistence.EntityManagerFactory; import
> javax.persistence.PersistenceUnit; import javax.servlet.ServletException;
> import javax.servlet.annotation.WebServlet; import
> javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse; import model.Person; // //**/
> / * Servlet implementation class TestServlet/ / *//
> /_at_WebServlet("/TestServlet")/ /public class TestServlet extends HttpServlet
> {/ / private static final long serialVersionUID = 1L;/ / / /
> @PersistenceUnit/ / EntityManagerFactory emf;/ // / /**/ / * @see
> HttpServlet#HttpServlet()/ / *// / public TestServlet() {/ / super();/ / //
> TODO Auto-generated constructor stub/ / }/ // / /**/ / * @see
> HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)/
> / *// / protected void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException {/ / // TODO Auto-generated
> method stub/ / response.setContentType("text/html");/ / PrintWriter out =
> response.getWriter();/ / out.println(" / "Transitional//EN\">\n" +/ / "\n" +/
> / "Hello WWW\n" +/ / "\n" +/ / "
> ======== HELLO WWW
> ===========================================================
>
> \n");/ / / / int count;/ / if(request.getSession().getAttribute("count") ==
> null)/ / count = 0;/ / else/ / count =
> (Integer)request.getSession().getAttribute("count");/ /
> request.getSession().setAttribute("count", ++count);/ /
> out.println("Accessed: " + request.getSession().getAttribute("count"));/ / /
> / / / Person p = (Person)emf.createEntityManager().createQuery("select p from
> Person p ").getResultList().get(0);/ / out.println(p.getName());/ /
> out.println("");/ / / / }/ /}/ And I always get this error messsage
> .... WARNING: StandardWrapperValve[org.glassfish.samples.TestServlet]:
> PWC1406: Servlet.service() for servlet org.glassfish.samples.TestServlet
> threw exception
>
> .... java.lang.VerifyError: Expecting a stackmap frame at branch target 18 in
> method model.Person._persistence_isAttributeFetched(Ljava/lang/String;)Z
> at offset 4
>
> .... at java.lang.Class.forName0(Native Method)
>
> .... at java.lang.Class.forName(Class.java:264)
>
> .... at
>
> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:93)
>
> .... at
>
> org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1258)
>
> .... at
>
> org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:367)
>
> .... at
>
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:338)
>
> .... at
>
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:185)
>
> .... at
>
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:242)
>
> .... at
>
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:230)
>
> .... at
>
> com.sun.enterprise.container.common.impl.EntityManagerFactoryWrapper.createEntityManager(EntityManagerFactoryWrapper.java:110)
>
> .... at org.glassfish.samples.TestServlet.doGet(TestServlet.java:57)
>
> .... at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
>
> .... at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>
> .... at
>
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
>
> .... at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
>
> .... at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> .... at
>
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
>
> .... at
>
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
>
> .... at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
>
> .... at
>
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
>
> .... at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
>
> .... at
>
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
>
> .... at
>
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
>
> .... at
>
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
>
> .... at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
>
> .... at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
>
> .... at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
>
> .... at
>
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
>
> .... at
>
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>
> .... at
>
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>
> .... at
>
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>
> .... at
>
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>
> .... at
>
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>
> .... at
>
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>
> .... at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
>
> .... at
>
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>
> .... at
>
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>
> .... at java.lang.Thread.run(Thread.java:722)
>
> Please I would appreciate help with this, it is driving me crazy. Also,
> anyone no how to use the debugger with JavaEE. I try running debugging mode
> but it doesn't to make any difference./
>
> --
>
> [Message sent by forum member 'dodo_manni']
>
> View Post: http://forums.java.net/node/889396
>
>