1

I have a webapp project in NetBeans, and I created a "Run class - main method" to startup programatically

PayaraMicro.getInstance()....bootstrap();

Then, to compile and to run without problems in NetBeans with Shift+F6 Run.class, I have to put these two internal JARs from Payara Micro in the libraries of the NetBeans project. Here, all ok.

But, when I need to run out of NetBeans, like this:

java -jar payara-micro.jar --deploy mywebapp.war

I would like to remove these two JARs from mywebapp.war, because I thought it was not needed. But if I remove from my .war file, Payara Micro doesn't get to find my REST webservices and this error message arises: Application mywebapp has no deployed JAX-RS applications.

I tried to remove just one of two JARs, same error. Both are required into my war.

I don't understand why Payara Micro (that already has these JARs into it), needs again the JARs in my war.

I use version 174.

whatamidoingwithmylife
  • 1,119
  • 1
  • 16
  • 35

1 Answers1

2

You need to configure Netbeans so that it doesn't package the JARs into the WAR. You can do this in project properties, Libraries, and untick the checkbox in the "Package" column next to the Payara Micro JAR. Netbeans will then exclude the JAR in the WAR file.

Payara Micro doesn't need those JARs in your WAR. On the contrary, they shouldn't be there. Your issue is that Netbeans needs them to compile your application and since your project is a web application, Netbeans automatically puts the JAR files into the WAR.

OndroMih
  • 7,280
  • 1
  • 26
  • 44
  • Hi, the problem is not into NetBeans. I get to package without these two JARs. The real problem is when I run in production, I continues to put these two files in the lib of my webapp, Payara Micro doesn't run the webapp without them into WEB-INF/lib dir of my app. – Edilmar Alves Dec 29 '17 at 12:24
  • I realized that the message "Application mywebapp has no deployed JAX-RS applications" isn't any error. It's just a statement that your application doesn't declare any REST service endpoints and that's fine. If the application declares REST service endpoints, their URLs are printed instead of the "no deployed JAX-RS applications" message. – OndroMih Jan 02 '18 at 11:35
  • In other words, safely remove the 2 JARs from your WAR and ignore the message. – OndroMih Jan 02 '18 at 11:36