users@glassfish.java.net

Re: Glassfish app deployment with Derby

From: Alexis Moussine-Pouchkine <alexis.moussine-pouchkine_at_oracle.com>
Date: Fri, 13 Jan 2012 16:09:50 -0500

The general topic of using GlassFish without the IDE is covered here: http://blogs.oracle.com/alexismp/entry/glassfish_without_the_ide
(pretty much still up-to-date except for sun-*.xml deployments descriptors now called glassfish-*.xml) but you've figured most of it already.

Some details below.

On 13 janv. 2012, at 15:16, forums_at_java.net wrote:

> I've been reading docs and googling around but have not had any success with
> these glassfish deployment issues. I'm new to web/enterprise development.
>
> I created a web application with netbeans version 7.0.1. I first used
> netbeans to create a database. Then used create entity classes from database
> to create the entity classes and persistence unit. I coded up an app and it
> runs fine with the glassfish and derby versions that came with netbeans.
>
> Now, I want to deploy and demo the app. I installed a standalone version of
> glassfish (version 3.1.1). This came with derby which I started up using
> asadmin start-database. I used the glassfish admin console to deploy the app
> from the .war file that netbeans generated. The deployment failed to create
> the JDBC resources. This is the first problem. I can deploy the app by
> manually creating the JDBC resources but then I need to figure out how to
> deploy the applications database. This is the second problem. The application
> is running but there is no database. I can't figure out how to depoy the
> database that I created with netbeans.
>
> So, hopefully someone can point me in the right direction for these two
> problems as described above:
>
> 1) Have the app automatically create the JDBC resources.

Application-scoped resources defined in glassfish-resources.xml are probably what you are looking for:
http://docs.oracle.com/cd/E18930_01/html/821-2417/giydj.html#SJSASEEADGgiydj


> 2) Deploy the database created with netbeans.

This should help :
http://db.apache.org/derby/docs/10.6/adminguide/cadminhubbkup12677.html
http://db.apache.org/derby/docs/10.6/adminguide/tadmincrtdbbkup.html

Ideally and in development at least you would have SQL scripts to create and populate the database.

cheers,
-Alexis


> Help!
>
> Thanks, Ed.
>
>
>
>
> --
>
> [Message sent by forum member 'eshober']
>
> View Post: http://forums.java.net/node/882700
>
>