users@glassfish.java.net

Re: How to create an Embedded GlassFish Server File System?

From: Bhavanishankar <bhavanishankara.sapaliga_at_oracle.com>
Date: Tue, 24 Jan 2012 22:19:03 +0530

Hi,

You can use the API documentation at
http://embedded-glassfish.java.net/nonav/apidocs/

You can also refer to some of the tests here.
<http://java.net/projects/glassfish/sources/svn/show/trunk/main/appserver/tests/embedded>

You should set the installRoot only if you have a valid installation of
GlassFish. For Embedded GlassFish to run, you don't necessarily need to
set an installroot.

Thanks,

Bhavani

On 01/24/2012 10:12 PM, forums_at_java.net wrote:
> Hi,
>
> How can I create an Embedded GlassFish Server File System?
>
> I tried:
>
> BootstrapProperties bootstrapProperties = new BootstrapProperties();
> bootstrapProperties.setInstallRoot("glassfish");
> GlassFishRuntime runtime =
> GlassFishRuntime.bootstrap(bootstrapProperties);
> GlassFish glassFish = runtime.newGlassFish();
> glassFish.start();
> System.out.println("Press Enter to stop server");
> // wait for Enter
> new BufferedReader(new InputStreamReader(System.in)).readLine();
> glassFish.dispose();
> runtime.shutdown();
> But the directory "glassfish" + contents wasn't created. Only a temporary
> filesystem gets created in the tmp directory.
>
> While the documentation of v3.1 is quite scarce:
>
> http://docs.oracle.com/cd/E18930_01/html/821-2424/gkubb.html [1]
>
> There is some more documentation for v3.0.1:
>
> http://docs.oracle.com/cd/E19798-01/821-1754/giiab/index.html [2]
>
> There it says it should get created if it doesn't exist.
>
> But there are 2 issues:
>
> * v3.1 has a new API
> * I couldn't get it created with the old API either
>
> How can I create a persistent filesystem at a specific location with
> the new
> API?
>
>
>
> Note: I cross-posted this question here:
> http://stackoverflow.com/questions/8989053/how-to-create-an-embedded-glassfish-server-file-system
>
>
>
> [1] http://docs.oracle.com/cd/E18930_01/html/821-2424/gkubb.html
> [2] http://docs.oracle.com/cd/E19798-01/821-1754/giiab/index.html
>
> --
>
> [Message sent by forum member 'puce']
>
> View Post: http://forums.java.net/node/882970
>
>