users@glassfish.java.net

Re: Embedded GlassFish Plugin with ScatteredArchive?

From: Magnus Kvalheim <magnus_at_kvalheim.dk>
Date: Tue, 23 Aug 2011 09:43:09 +0200

Before I wasn't properly subscribed to the mailing list. I'm forwarding the
response back to the list thread now.

---------- Forwarded message ----------
From: Magnus Kvalheim <magnus_at_kvalheim.dk>
Date: Mon, Aug 22, 2011 at 9:31 PM
Subject: Re: Embedded GlassFish Plugin with ScatteredArchive?
To: Bhavanishankar <bhavanishankara.sapaliga_at_oracle.com>


Hi _Bhavani, thank you for your quick reply

On Mon, Aug 22, 2011 at 6:05 PM, Bhavanishankar <
bhavanishankara.sapaliga_at_oracle.com> wrote:

> Hi Magnus Kvalheim,
>
>
> On 08/22/2011 09:26 PM, Magnus Kvalheim wrote:
>
> Hi Bhavanishankar,
>
> I have successfully deployed a web application which uses maven
> structure.
> This is deployed as scattered archive so I would not need to package
> artifact.
>
> * ScatteredArchive archive = new ScatteredArchive("testapp",
> ScatteredArchive.Type.WAR, new File("src/main/webapp"));*
> * archive.addClassPath(new File("target", "classes"));*
>
> When the server is running I have it setup so that I can hit enter in
> eclipse console for reloading.
> I deploy with commands:
> *deployer.deploy(archive.toURI(), "--force=true", "--keepstate=true");*
>
> The problem is that changes to class files are not reflected/redeployed.
>
> I believe the deployment goes fine and you are able to access the app. But
> what you are saying is if you change the files under target/classes later it
> is not getting reflected when you access the app again. Is my understanding
> correct?
>

Yes. The app is working and I can access.
As mentioned I'm running from eclipse - with embedded glassfish using the
eclipse project build path.
When I modify code and save, it will compile to target/classes.
At this point I (re)deploy app with --force, but no changes are reflected.

My initial assumption was that the problems was related to eclipse and
glassfish classloaders, but it's just a guess ...
Have you got any suggestion?

many thanks in advance
Magnus


>
> _Bhavani.
>
>
> I'm running this from eclipse and suspect that there could be a possible
> classoading issue when both eclipse and glassfish get in the mix.
> (Classpath is coming from maven and target/classes both resolved by
> eclipse)
>
>
> I think though that it could work better if it would be running as
> a ScatteredArchive from the glassfish plugin - then eclipse build path would
> not interfere...
>
> Do you think it's possible now to make the maven glassfish plugin run and
> deploy a maven project without packaging war artifact (ScatteredArchive)?
>
> This would be a huge benefit for us - and I guess anyone that are coming
> from dev cycles with jetty:run
> And I think it would also give the added benefit of resolving workspace
> artifacts - so packaging/install of related projects also can be avoided.
>
> best regards
> Magnus Kvalheim
>
>
> --
> Sun, an Oracle Company
>
>