correct Run/Debug configuration for Payara Micro

Answered

I have an existing maven/war project that hosts some REST endpoints, and uses JPA.
I am currently running the war file in a full payara server using the Glassfish Server configuration. This plugin doesn't seem appropriate for Payara Micro, which just runs from a downloaded jar file.

I am experimenting with using Payara Micro, which executes from the command line as follows:

`java -jar payara-micro-5.182.jar --deploy c:\path\pcc.war`

This is working well, but I want to execute and debug the "command line" payara application.

What is the correct way to setup a Run/Debug configuration in InteliJ IDEA for Payara Micro?
(at some point I will be using docker, but for now, just a regular Run/Debug configuration is what I need)

5 comments
Comment actions Permalink

IntelliJ IDEA app server integration is more complex than that and requires the specifically designed support for every app server it integrates with.

There is no support for Payara Micro at the moment.

For the plain Java code debugging you can use the Remote run/debug configuration and start the server with the debug options manually or via Maven, then connect to it using the Remote configuration.

The limitation of the Remote configuration is that it will not work for JSP debugging.

0
Comment actions Permalink

Hi Serge,

Whilst I really appreciate you taking the time to respond, thank you. I find it very hard to accept that Intelij is capable of running/debugging a full Payara application server locally, but somehow can only debug a command line Payara-Micro remotely?

That's seriously disappointing, especially as whilst I probably won't be using JSP much, I am sure in the fullness of time, there will be some.
Regards

Craig.

0
Comment actions Permalink

You can use local Application configuration as well if you add payara-micro-5.182.jar to the module dependencies (https://www.jetbrains.com/help/idea/working-with-module-dependencies.html) and specify the main class from this jar's META-INF/MANIFEST.MF to run.

0
Comment actions Permalink

No,

Doesn't work:

[2018-07-17T13:51:19.748+0200] [] [SEVERE] [] [fish.payara.micro.PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1531828279748] [levelValue: 1000] [[

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at fish.payara.micro.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:107)
at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:70)
at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:79)
at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:397)
Caused by: fish.payara.micro.BootstrapException: A MultiException has 8 exceptions. They are:
1. java.lang.RuntimeException: Authorization Service initialization failed, exception java.lang.IllegalStateException, message Authorization Provider simpleAuthorization not found.
2. java.lang.IllegalStateException: Unable to perform operation: post construct on org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.sun.enterprise.admin.util.CommandSecurityChecker errors were found

0
Comment actions Permalink

It is a bit disturbing that this unresolved issue has high relevance in goole and shows top always.

I believe as many others one could easily create a execute jar task in the CLI runner above and just add the --deploy to your packed WAR-file or target directory. (However latter will change the context path of your app).

Debugging works out of the box.

 

0

Please sign in to leave a comment.