NullpointerExceptionBuster NullpointerExceptionBuster - 29 days ago 12
Java Question

Payara Micro - 404 after deployment

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).

enter image description here

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 :

enter image description here

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>



Answer

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/