I have an enterprise application I have been developing in Netbeans, and I'm now trying to add some RESTful web services to the -war module. The problem I'm having is that when I use the Netbeans feature to create the web services, no ApplicationConfig.java class is being created.
All the examples and tutorials I've found on the web explain that Netbeans will automatically generate an ApplicationConfig.java class that extends Application, and by editing the @ApplicationPath annotation on this class, I can configure the URI at which the web services will be reachable. And in fact, if I create a new Java EE application from scratch, and then invoke New --> RESTful Web Services from Patterns, this is exactly how it works. But when I try this with the Netbeans project I am developing, no ApplicationConfig.java is created.
My questions:
1) Any idea why this is happening? Netbeans bug? Are there some known circumstances in which Netbeans does not create an ApplicationConfig?
2) Can I just create an ApplicationConfig.java myself manually? I have seen examples (not with Netbeans) that use an empty ApplicationConfig class which does nothing except provide a place to put the @ApplicationPath annotation to allow that part of the URI to be configured. If I do this, will Netbeans get confused?
3) I see that when Netbeans creates this class, it includes code that overrides the Application.getClasses method. It looks simple enough to manually create my own code that does exactly the same thing that the automagically generated code would do. Do I need it?
Details of my environment are:
- Product Version: NetBeans IDE 8.1 (Build 201510222201)
- Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
- Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14
- Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14
- System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
- Project type: Java EE 7 application
- Server: Wildfly 9.0.2
Thanks!
Duncan