[FIRSTCUP-18] Missing Persistence explanation Created: 16/Apr/14  Updated: 25/Apr/14  Resolved: 25/Apr/14

Status: Closed
Project: firstcup
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.1

Type: Improvement Priority: Major
Reporter: JKitzbichler Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified



The persistence functionality together with the needed database is completely missing.
Therefore also the sample code can't be deployed because of an EclipseLink failure.

Comment by jendrock [ 16/Apr/14 ]

Could you please list the software that you are running?

  • What version of the JDK?
  • What version of the Java EE 7 SDK?
  • Did you use GlassFish 4 that came with the SDK or NetBeans IDE or standalone?

We have never seen or heard of this error before, so I suspect it is a configuration issue that can easily be fixed once the problem has been narrowed down.

Please read Section 1.2, "Requirements for this Tutorial: A Checklist," which you can access here: http://docs.oracle.com/javaee/7/firstcup/doc/intro002.htm#GCQZL

Comment by JKitzbichler [ 17/Apr/14 ]

Hi Jendrock,

I have the following software versions installed:

Product Version: NetBeans IDE 7.4 (Build 201311011758)
Updates: NetBeans IDE wurde auf Version NetBeans 7.4 Patch 3 aktualisiert
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)

JDK: 1.7.0_45
SDK: Java EE SDK 7 - but the detailled version I can't find out

Glassfish: 4.0 (Build 89)

I think, but I'm no more really sure, that I have installed Netbeans separetly from the Glassfish server,
but I installed the Glassfish with a Windows installer under C:\Programs\...

The Glassfish error message during the deployment process - partely in German:
Schwerwiegend: Ausnahme beim Deployment der Anwendung [firstcup-war] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Fehler beim Zuweisen einer Verbindung. Ursache: Connection could not be allocated because: java.net.ConnectException: Fehler beim Herstellen der Verbindung zum Server localhost am Port 1527. Nachricht: Connection refused: connect.
Error Code: 0

Do I need the "Java EE 7 SDK Extensions 4.0-89" and or
the "Java EE 7 Profile Extensions 4.0-89" which I can see as available Add-Ons within the Glassfish Update Tool?

Also "Java EE 7 SDK Full Platform" and "Java EE 7 SDK Web Profile", each with version 4.0-89,
would be available as Add-Ons.

Do I have to install these four packages?
I read Section 1.2, "Requirements for this Tutorial: A Checklist". Do I miss some SDK packages?

In the first-cup tutorial the persistence part is not really explained. The database handling,
the involved tables, any JDBC settings (Connection Pool / JNDI) or persistence configurations are missing
or I couldn't read it...

Also it was not possible for me to create the projects out of the Maven Archetypes,
see http://docs.oracle.com/javaee/7/firstcup/doc/creating-example002.htm, section
and section
The "dukes-age-archetype"ArcheType is NOT listed within the known archetypes list...

Greetings Josef

Comment by Kim Haase [ 17/Apr/14 ]

Hi, Josef,

Your software versions look fine. You do not need the extensions, and you can use either the full profile or the web profile version of the Java EE 7 SDK.

This tutorial doesn't go into detail about the technologies – it is just a quick start to get you used to building and running an application. For information about persistence and JAX-RS you can consult the Java EE 7 Tutorial.

When you followed step 1 in " Install the Maven Archetypes", how many projects did you see under Projects after you selected "example" and clicked Open Project? You should see six:


If you saw only firstcup, it may be that the checkbox "Open Required Projects" was not selected. You need to open the required projects.

When you follow the instructions to create a dukes-age (and firstcup-war) application, you will then see two projects with identical contents. We suggest that you close the old ones before creating the new ones. By default, the new ones are created in your NetBeansProjects directory under your home directory, but they will appear next to the existing ones in the IDE, which can be quite confusing. Alternatively, you could give the new ones slightly different names from the existing ones.

We did encounter the same persistence error, which indicates that the database server is not running. This is because the Maven project doesn't start the database. We will need to change the project file and/or the instructions so that the database is started before you deploy the firstcup-war application.

The workaround for now is to go to the Services tab, expand the Databases node, right-click "Java DB" and choose Start Server, then deploy the application.

Thank you very much for pointing out this error. (We've found a few more while testing this, so thank you even more.)

Comment by jendrock [ 17/Apr/14 ]

Hi, Josef.
We made many fixes, including the ones that address the problem that you pointed out with the database not starting, in our documentation source files. We will provide an updated First Cup release in the near future.

Comment by Kim Haase [ 25/Apr/14 ]

We have released a new version of the First Cup Tutorial , 7.0.1-8, that fixes a number of issues we found. I hope you find it usable.

The description of Persistence is still brief, but the Java EE 7 Tutorial is the place to go for more information.

Thanks for bringing our attention to First Cup.

Generated at Wed Mar 29 13:57:59 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.