Reputation: 107
I wanted to try this cool micro app server - Payara Micro, but Im somehow unable to deploy the simplest example possible. I've created a blank web-app maven project from netbeans, using JavaEE7 with no dependencies. Tried to compile it (nothing much to compile), and ran it successfully with Glassfish 4.1.1 - Hello World welcome page appears, and everything is OK.
Did a clean&build, and tried to deploy resulting WARfile to payara. (java -jar payara-micro.jar --deploy mywarfile.war) Startup was quick, just noticed two messages in output - > "No META-INF/deploy" directory and "Deployed 1 archives". Tried to open the index page, but oops -> error 404 (as seen below).
The project is really simple, I may be doing something wrong when deploying. Maybe some errors in project structure ? Hereby I present the primitive project structure used :
Thank you very much for any valuable solution/feedback. I think I'm just overlooking some minor, stupid thing.
Edit: pomfile attached. Tried to run it with both dependencies, with EE or payara only, but no change :(
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.myproject.sigag</groupId>
<artifactId>sigag</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>sigag</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!--<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>-->
<dependency>
<groupId>fish.payara.extras</groupId>
<artifactId>payara-micro</artifactId>
<version>4.1.152.1</version>
<scope>provided</scope>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Upvotes: 3
Views: 3306
Reputation: 107
thank you very much, for your effort. After all, it was really stupid mistake and I'm kinda sorry I wasted your time.
The answer is simple - based on filename of the war - the deploy URL is created.
So basically - since I had a full "Mavenous" file name : Sigag-1.0.0-SNAPSHOT.war, the correct URL of deployed app was localhost:8080/Sigag-1.0.0-SNAPSHOT/
Thanks again for your answers.
Upvotes: 1
Reputation: 7710
You should be able to see in the logs the context root of your application (couple of lines before the line Payara Micro 4.1.1.163 #badassmicrofish (build 215) ready in 10436 (ms)
).
Something like this:
Loading application [sigag] at [/sigag]
Then your application should be available at http://localhost:8080/sigag/
Upvotes: 4