users@glassfish.java.net

Deploying an exploded application in GlassFish embedded

From: <glassfish_at_javadesktop.org>
Date: Thu, 02 Apr 2009 03:54:45 PDT

Hi there,
I'm trying to use GlassFish embedded to deploy an exploded web application, as explained in these blog entries:
http://blogs.sun.com/arungupta/entry/embeddable_glassfish_in_action_servlet
http://www.adam-bien.com/roller/abien/entry/embedding_glassfish_v3_in_unit

However, it seems that the functionality is "not implemented yet", as I'm getting a "java.lang.UnsupportedOperationException: Not supported yet.". So, I wonder if I'm using an old version, as I think it is the latest:
    <dependency
      org="org.glassfish.embedded"
      name="glassfish-embedded-all"
      rev="3.0-Prelude-Embedded-m2"
      conf="..." />

My code looks like this:
---
      params = new Properties();
      params.put(ParameterNames.CONTEXT_ROOT, theConfiguration.getContext());
      Collection<URL> classesCollection = new java.util.ArrayList();
       classesCollection.add(new File(theConfiguration.getBasePath(),
          "WEB-INF/classes").toURI().toURL());
      theSAR = new ScatteredWar(theConfiguration.getContext(), new File(
          theConfiguration.getBasePath()), new File(theConfiguration
          .getBasePath(), "WEB-INF/web.xml"), classesCollection);
      ...
    // Start
    theServer.start();
    // Deploy
    app = theServer.deploy(theSAR, params);
---
And the output looks like this:
---
no resource bundle found for version, using default GlassFish version
02-abr-2009 12:42:03 AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
02-abr-2009 12:42:04 com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Listening on port 4848
02-abr-2009 12:42:04 com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Listening on port 8080
02-abr-2009 12:42:04 com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish v3 Prelude startup time : Embedded(625ms) startup services(859ms
) total(1484ms)
Exception in thread "main" org.glassfish.embed.EmbeddedException: java.lang.Unsu
pportedOperationException: Not supported yet.
        at org.glassfish.embed.Server.deploy(Server.java:625)
        at org.wembed.impl.GlassFishEmbeddedContainer.start(GlassFishEmbeddedContainer.java:131)
        at org.wembed.ServerLauncher.start(ServerLauncher.java:129)
        at org.wembed.ServerLauncher.main(ServerLauncher.java:61)
Caused by: java.lang.UnsupportedOperationException: Not supported yet.
        at org.glassfish.embed.ScatteredWar.entries(ScatteredWar.java:141)
        at org.glassfish.persistence.jpa.JPASniffer.handles(JPASniffer.java:82)
        at com.sun.enterprise.v3.server.SnifferManager.getSniffers(SnifferManager.java:127)
        at org.glassfish.embed.Server.deploy(Server.java:605)
        ... 3 more
---
Am I using the wrong version?
S!
[Message sent by forum member 'greeneyed' (greeneyed)]
http://forums.java.net/jive/thread.jspa?messageID=340239