users@glassfish.java.net

Re: Issue with maven-embedded-glassfish-plugin version 3.1(3.1.1)

From: Bhavanishankar <bhavanishankara.sapaliga_at_oracle.com>
Date: Mon, 20 Feb 2012 11:55:36 +0530

Hi,

With 3.1 (onwards) you should set the instanceRoot iff you have
pre-created domain directory.

Otherwise, if you intend to make the embedded GlassFish use a different
temp. directory for its tiny instance root creation, then you should set
this in embedded plugin configuration:

<configuration>

...

    <systemProperties>

        <property>glassfish.embedded.tmpdir=${project.build.directory}/glassfish</property>

    </systemProperties>

...

</configuration>

HTH,

Bhavani

On 02/15/2012 04:04 PM, Mirea Vasile wrote:
>
>
> Hi,
>
> I have the following issue:
>
> I am using the maven-embedded-glassfish-plugin .
> I am having the following configuration in maven for it:
>
> <plugin>
> <groupId>org.glassfish</groupId>
> <artifactId>maven-embedded-glassfish-plugin</artifactId>
> <version>3.0</version>
>
> <configuration>
> <goalPrefix>embedded-glassfish</goalPrefix>
> <serverID>localhost</serverID>
> <name>${build.finalName}</name>
> <app>${project.build.directory}/${build.finalName}.war</app>
> <port>8080</port>
>
> <instanceRoot>${project.build.directory}/glassfish</instanceRoot>
>
> <autoDelete>true</autoDelete>
>
> </configuration>
>
> <executions>
> <execution>
> <id>start-glassfish</id>
> <phase>pre-integration-test</phase>
> <goals>
> <goal>start</goal>
> </goals>
> </execution>
> <execution>
> <id>glassfish-deploy</id>
> <phase>pre-integration-test</phase>
> <goals>
> <goal>deploy</goal>
> </goals>
> </execution>
> <execution>
> <id>glassfish-undeploy</id>
> <phase>post-integration-test</phase>
> <goals>
> <goal>undeploy</goal>
> </goals>
> </execution>
> <execution>
> <id>stop-glassfish</id>
> <phase>post-integration-test</phase>
> <goals>
> <goal>stop</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
> This configuration works just fine in the version 3.0.
> Important is the option: <instanceRoot>
>
> In the Version 3.1 I am getting a strange error:
> 15.02.2012 11:30:48
> com.sun.enterprise.v3.server.DomainXmlPersistence getPidFile
>
> ERROR: Cannot obtain lockfile location T:\workspace2\web-app\
> target\glassfish\config\lockfile, configuration changes will not be
> persisted
> java.io.IOException: The System cannot find the specied path.
> at java.io.WinNTFileSystem.createFileExclusively(Native Method)
> at java.io.File.createNewFile(File.java:883)
> at
> com.sun.enterprise.v3.server.DomainXmlPersistence.getPidFile(DomainXm
> lPersistence.java:92)
> at
> com.sun.enterprise.v3.server.DomainXmlPersistence.accessRead(DomainXm
> lPersistence.java:114)
> at
> org.glassfish.config.support.DomainXml.parseDomainXml(DomainXml.java:
> 210)
> ...
>
> In the version 3.0 the directory structure will be created by the
> plugin, in the version 3.1 not any more and then I get this errors.
> Something change in the new version or it is a bug ?
>
>
> Thanks,
> Vasile.
>