I have a JavaEE simple HelloWorld project developed using Netbeans. If I debug it or run it it works as expected in these situations (at least):

1) Netbeans 8.2 + Wildfly 12
2) Netbeans 10 + Wildfly 12
3) Netbeans 11 + Wildfly 12

but it fails (at least):

1) Netbeans 8.2 + Wildfly 15
2) Netbeans 10 + Wildfly 15
3) Netbeans 11 + Wildfly 15

The error shown when I try to run or debug using Wildfly 15 is:

Browsing: http://localhost:8080undefined/

java.net.MalformedURLException: For input string: "8080undefined"
    at java.net.URL.<init>(URL.java:627)
    at java.net.URL.<init>(URL.java:490)
    at java.net.URL.<init>(URL.java:439)
    at org.netbeans.modules.ant.browsetask.NbBrowse.execute(NbBrowse.java:67)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:449)
    at org.apache.tools.ant.Target.performTasks(Target.java:470)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
Caused by: java.lang.NumberFormatException: For input string: "8080undefined"

If I go deeper in the problem, it seems to be caused by wrong interpretation of ${client.url} on build-impl.xml, but I cannot figure out how to solve it.

A workaround could be to add

<target if="do.display.browser.debug" name="debug-display-browser">
        <nbbrowse context="" url="http://localhost:8080/" urlPath="${client.urlPart}"/>
</target>

at the end of build.xml on the project root, but I would like to know how to fix the origin of the problem.

I have to say that the error is not blocking, that means that the project is successfully deployed, but the browser is not opened, what is somehow annoying. If I manually open the browser and write down the URL then everythings goes right.

Kind regards

1

There are 1 best solutions below

1
On BEST ANSWER

!!!! Updated on 10/5/19. There is now a solution - see the lower section of this answer. !!!!


This is an answer, but unfortunately not a solution!...

  • This is a possible duplicate of Wildfly 15.0.1.Final - Web Application Error, though no solution is offered.

  • I can also reproduce your problem with Netbeans 8.2 + Wildfly 15, although it works fine with Wildfly 12. You are unlikely to get any fix for this from Oracle for NB 8.2.

  • Note that there is an open bug report regarding the use of Wildfly with NB11: NETBEANS-2415 Bring back support for WildFly server. Apparently (at a minimum) there are licensing issues with the plugin:

    AFAIK, there are license issues with that plugin. We have a contributor from them who tries to push the management to provide the wildfly plugin stuff with an Apache compatible license. If that does not work out the plugin might need to move to an external portal.

  • Also see open bug report NETBEANS-2367 wildfly support disabled, and this this discussion: No wildlfy plugin on Netbeans 11

  • As you point out:
    • This is not a problem with Wildfly, but with NetBeans.
    • It is annoying, but not serious.

In summary:

  • You will almost certainly not get a fix for your problem with NetBeans 8.2 from Oracle.
  • For more recent releases of Apache NetBeans (>= NetBeans 9.0) it seems that Wildfly is not supported at present. Until that is resolved you won't get any fix for more recent NetBeans releases either.

Updated on 10/5/19 to provide a true solution:

Notes:

  • I verified this by creating a Maven web application on NetBeans 11.1, using JDK 13, and running it on Wildfly 18.
  • As an unrelated matter, Wildfly 17 and later support Java EE 8.