SOLUTION: NetBeans Run Command Deploys Slowly To Payara

My last blog “Build, Deploy and Run in a Browser a Web App with Maven” came out of a problem running web apps on Payara 5.194 from NetBeans 11.2 using Java 11 and MySQL 8 on Windows 10. Go to the blog to see the details.

Yesterday I discovered that the problem was caused by the glassfish-resources.xml file. If I copied this file into a project that did not do any JDBC or JPA then it also took 50 seconds to deploy.

Today I came across this page from Payara’s documentation This page pointed out that some of the glassfish configuration files had alternate names. One of those alternate names was payara-resources.xml.

How could changing the name make a difference? When deploying manually or with the Maven Cargo plugin the time for displaying the page in the browser was near instantaneous. It was using the NetBeans Run command to deploy that took 50 seconds until the web page came up in the browser.

Without any expectation of success I renamed glassfish-resources.xml to payara-resources.xml and used Run in NetBeans. It came up instantaneously. My non-database app that deployed slowly with glassfish-resources.xml now started up instantaneously when I renamed it.

I can’t imagine how this was missed. Was it like the time I had Arquillian issues and then discovered that the Arquillian team did not have any Windows machines in their office?

Whatever the reason I have vented on social media and filed a bug report with Payara. I’d like to know if this is an issue just on Windows or do Mac and Linux users also have slow deployments when using glassfish-resources.xml and the NetBeans Run command. I have never observed this when I used earlier versions of Payara and NetBeans with Java 8. I have calmed down and I’m a happy camper, more or less, again.

About Ken Fogel

Java Champion, JCP Executive Committee Member, Vice-President of the Jakarta EE Ambassadors, NetBeans Dream Team Member, and conference speaker/organizer. Currently a Research Scholar in Residence at Dawson College after retiring from the classroom. Passionate about teaching and inspiring everyone to be better programmers.

1 thought on “SOLUTION: NetBeans Run Command Deploys Slowly To Payara

  1. Danilo Magrini

    OMG! thx a lot!!! Works like a charm to me. Here, the run command to deploy took almost 5 MINUTES until the web page came up in the browser. I was switching to Intellij, but I love Netbeans! Now, it takes less than 15 seconds to Run.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.