score:2
there are a number of issues i think.
first, the persistence.xml looks a bit odd, i would have expected something like this:
<?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="jpaproject2" transaction-type="jta">
<provider>oracle.toplink.essentials.persistenceprovider</provider>
<jta-data-source>jdbc/sample</jta-data-source>
<class>model.customer</class>
</persistence-unit>
</persistence>
that is, a provider field, and the necessary fields to indicate that you're running in a server (jta-data-source). of course, jta-data-source has to refer to a datasource that you configured in glassfish.
next, i think it's quite odd that your application runs on ports 4848, normally that's the administrative listener for glassfish, and i'd expect only the admin console to run there. did you reconfigure your glassfish's ports?
one thing that puzzles me is how you got this far with such a configuration: it looks like toplink thinks it has to contact a derby running on localhost (port 1527 is standard for derby) so maybe there's still some other persistence.xml floating around? please check that.
about tutorials: i use glassfish a lot, but always with netbeans. here are a couple of links to tutorials from the netbeans site, they might help you.
- http://www.netbeans.org/kb/docs/web/customer-book.html
- http://www.netbeans.org/kb/61/javaee/persistence.html
it may be easiest to just install netbeans, follow the tutorials and have a look at all the files that get generated, netbeans automates the creation of a lot of this stuff and i have no idea what degree of assistance eclipse gives you with these files.
here is a rather complete tutorial based on eclipse: http://wiki.eclipse.org/eclipselink/examples/jpa/glassfishv2_web_tutorial
a last one: a tutorial for gf3 should get you going on gf2 as well, at least for these technologies (servlet and jpa). ok, gf3 comes with eclipselink instead of toplink essentials, but these two are not that different at all.
edit: when i saw tle trying to connect to a derby on localhost i forgot the part about mysql. this has been corrected now - references to how you should start derby have been removed.
Source: stackoverflow.com
Related Query
- How can I configure a Servlet in Eclipse to use a JPA project?
- What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't?
- How can I use the java Eclipse Abstract Syntax Tree in a project outside Eclipse? (ie not an eclipse plugin)
- how can I configure Jenkins to use maven that's pre-installed on eclipse
- How can I make eclipse perl project use a specific perl version?
- How can I use Gradle dependency managemenent with an Eclipse WTP project without errors?
- How can I connect Kie Workbench with eclipse, So that I can use the project created in kie workbench in eclipse
- How can I use static lib in Shared Library project in Eclipse CDT
- How to configure project in Eclipse so that jsps can be validated properly including <%@page import="...%>in <@include file="...">
- How can I add servlet project to Tomcat server in Eclipse in a stable way besides usage of mvn clean package
- How can I configure and use auto-complete and other Eclipse features within a Maven-managed project?
- How do I configure the proxy settings so that Eclipse can download new plugins?
- How to configure Eclipse build path to use Maven dependencies?
- How to convert an Eclipse Android project to use Ant for build?
- How to use Gradle to generate Eclipse and Intellij project files for Android projects
- How do you configure GCC in Eclipse to use C99?
- How can I get Eclipse 2018.09 to use the JUnit 4 test runner by default?
- How can I make hidden files display in Eclipse Project explorer when using a RSE linked folder?
- How to use sbt-eclipse to create Eclipse project files of a project?
- How can I add current Eclipse project to git with EGit?
- How can I import NetBeans project to Eclipse and vise versa?
- How can I run a Maven webapp in Eclipse when I use profiles to populate properties files at build time?
- How do i configure eclipse to make use of different version of JDK
- How do I configure eclipse to automatically refresh a project as part of it's build?
- How can I properly configure my Eclipse Luna dark theme?
- How to use Linked Files in Eclipse for PhoneGap project with Android
- How Can I Tell Eclipse to Compile and Build a Project with a Different JRE Version than it Normally Does?
- How can I use classes from other project with maven? (ClassNotFoundException and NoClassDefFoundError is thrown)
- How to make Eclipse use an existing makefile that is not in root of project
- How can I configure Eclipse to run an external builder or shell command?
More Query from same tag
- Java started but returned exit code =1
- How to find references to a Spring converter in Eclipse?
- Java Path settings for Eclipse on Linux
- Not able to install svn connectors in eclipse
- Eclipse (SWT composite): How to run and where is build?
- displaying Google Maps API v2 on real device/emulator. can't figure out error
- dx.failed error show up when i'm exporting apk file by ecilpse
- Not able to retrieve data after executing preparatory statement in Eclipse after JDBC Connection
- Unable to Configure JRE_HOME after JAVA update
- JavaScript editor within Eclipse
- "AWT-EventQueue-0" java.lang.NullPointerException error on MySQL JDBC java project
- How to install jinput in eclipse?
- Eclipse workspace projects suddenly have bad build path
- Is it possible to track resource read-only property in Eclipse?
- How can I stop Python's csv.DictWriter.writerows from adding empty lines between rows in Windows when using stdout?
- How do i start google maps at my location
- How do I query for empty/nonempty fields in a Trac reposoitory with Mylyn?
- Eclipse PhoneGap HTML div link isn't working
- Eclipse Window Builder appearence
- Can't run node.js debug from eclipse using chrome devtools
- Button-click-count issue in eclipse
- Kindle Fire Devices not showing by eclipse sdk-manager
- How to completely disable the default Cursor.TEXT for a TextArea object
- Android - Button Question
- Setting up GTKmm in Eclipse for C++
- How to solve this error in windows, Exception caught during execution of merge command. org.eclipse.jgit.errors.CorruptObjectException: Invalid path:
- Syntax error on tokens, delete these tokens - kafka spring integration demo application
- How to register existing Glassfish server and how to change username/password
- Building FLTK Project in Eclipse
- In Eclipse, Cucumber feature steps not recognizing step definitions