Skip to main content

Cannot deploy Ed Burn's Virtual Trainer sample application

4 replies [Last post]
sariga
Offline
Joined: 2007-09-27
Points: 0

I try to deploy the Virtual Trainer sample application from the Ed Burn's JSF book, on Glassfish 3. But I get the following message:

Exception while preparing the app : java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'trainer' in SerialContext [Root exception is javax.naming.NameNotFoundException: trainer not found]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Edward Burns

On 5/12/10 9:46 , webtier@javadesktop.org wrote:
> I try to deploy the Virtual Trainer sample application from the Ed Burn's JSF book, on Glassfish 3. But I get the following message:
>
> Exception while preparing the app : java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'trainer' in SerialContext [Root exception is javax.naming.NameNotFoundException: trainer not found]
> [Message sent by forum member 'sariga']

Thank you for sharing this with the list. I'm really busy with some
performance fixes right now and I'm not able to give a prompt response.
Are you starting GlassFish from the command line or from the IDE?

Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

sariga
Offline
Joined: 2007-09-27
Points: 0

I am starting Glassfish from Netbeans IDE & using Glassfish's visual admin console interface (localhost:4848) to deploy the WAR file.

Thank you.

mpscholz
Offline
Joined: 2003-06-12
Points: 0

sariga,

Tried it out; the problem you are facing when deploying via Glassfish's admin console is that Glassfish doesm not know the jdbc resource named "trainer" (which is used by JPA in the Virtual Trainer application), given that you have not created it manually before.

You could use maven for deployment on the contained pom.xml file from the Netbeans IDE, as the jdbc resource and the referred jdbc connection pool get deployed in course of that also (see sun-resources.xml in the project).

What still remains is to create a database named "trainer" in the JavaDB database server (you can do that also using Netbeans).

In short, these were the steps I performed to get Virtual trainer running:

1. Download cp10.zip from http://www.jsfcompref.com
2. Unzip the file
3. Load the "trainer" maven project into Netbeans 6.8 (as a Maven project)
4. Build it there
5. Create a database named "trainer" in the JavaDB server (using the Services tab of Netbeans)
6. Deploy the application into Glassfish using "Run" on the Netbeans project

Note that for Step 4, I had to augment the pom.xml for the maven repository that contains the org.eclipse.persistence:javax.persistence dependency.

Alternatively, you could create the resources mentioned also manually using Glassfish's admin console.

Message was edited by: mpscholz

sariga
Offline
Joined: 2007-09-27
Points: 0

mpscholz,

I have deployed the sample application using your advice.

Thank you very much.