users@glassfish.java.net

Re: Bookstore2 Tutorial Will Not Deploy

From: Jennifer Ball <Jennifer.Ball_at_Sun.COM>
Date: Mon, 18 Dec 2006 11:56:53 -0800

Hi Mark,

I ran your WAR file with the verifier and found that it failed because
you have three copies of the persistence.xml file in your WAR. In
addition to the one in WEB-INF/lib/bookstore.jar (where it's supposed to
be), you have one in WEB-INF/classes/META-INF and one in
WEB-INF/persistence.xml.

When I removed the extra persistence.xml files, your WAR file worked
fine. The question now is how the extra persistence.xml files go into
your WAR.

This is what I did to build and deploy my working WAR file:

1. I downloaded the latest tutorial bundle by going to
http://java.sun.com/javaee/5/docs/tutorial/doc/index.html and clicking
on Download Tutorial Bundle.
2. I unpacked the bundle.
3. I set my server administrator password in the admin-password.txt file
located in javaeetutorial5/examples/common.
4. I opened up the build.properties.sample file located in
javaeetutorial5/examples/bp-project and set the location of my server
installation and the location of my server password file and saved the
file as build.properties.
5. I ran ant in the javaeetutorial5/examples/web/bookstore2 directory to
build the WAR file. I used the ant version that came with build 28 of
glassfish.
6. I started the glassfish server and the database server.
7. I ran ant deploy in the javaeetutorial5/examples/web/bookstore2
directory to deploy the WAR file. Again, I used the ant version that
came with build 28 of glassfish.

Does your process differ at all from the steps I took? If it doesn't
then I don't know what could be the problem.

Jennifer


Mark Hansen wrote:

> I tried this with b28 and still am getting same error (below).
> Attached is the WAR. Any help will be appreciated!
>
>
> Jennifer Ball wrote:
>
>> Hello Mark,
>>
>> I downloaded the latest tutorial bundle and tested bookstore2 with
>> build 28 of glassfish. I had no trouble deploying or running the
>> application.
>>
>> Could you try with build 28? If that doesn't work, you can send your
>> WAR file to me and I'll take a look at it.
>>
>> Jennifer
>>
>>
>>>>>
>>>>>
>>>>> -------- Original Message --------
>>>>> From: Mark Hansen <marklists_at_javector.com>
>>>>> Subject: Bookstore2 Tutorial Will not Deploy
>>>>> To: users_at_glassfish.dev.java.net
>>>>>
>>>>> Running GlassFish V2 b27 on Windows XP.
>>>>>
>>>>> I am working through the JavaEE5 Tutorial and trying to deploy the
>>>>> Bookstore2 (javaeetutorial5/examples/web/bookstore2) WAR using Ant as
>>>>> described in the tutorial:
>>>>> http://java.sun.com/javaee/5/docs/tutorial/doc/ (Chapter 4).
>>>>>
>>>>> Am getting the following error. How is the persistence unit
>>>>> supposed to
>>>>> be resolved? Am I missing some configuration file?
>>>>>
>>>>> deploy:
>>>>> [exec] CLI171 Command deploy failed : Deploying application in
>>>>> domain failed; Deployment Error -- Could not resolve
>>>>> a persistence unit corresponding to the persistence-unit-ref-name
>>>>> [com.sun.bookstore2.listeners.ContextListener/emf] in scope of the
>>>>> module called
>>>>> C:\bin\glassfish-v2-b27\domains\domain1\applications\j2ee-modules\bookstore2].
>>>>>
>>>>> Please verify your application.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>
>>>>>
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>