This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228369 - Cannot create REST services in Java EE 5,6 project with GlassFish 4
Summary: Cannot create REST services in Java EE 5,6 project with GlassFish 4
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-08 11:16 UTC by Jiri Skrivanek
Modified: 2013-04-18 09:24 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack trace from Java EE 5 project. (7.42 KB, text/plain)
2013-04-08 11:16 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2013-04-08 11:16:40 UTC
Created attachment 133366 [details]
Stack trace from Java EE 5 project.

It is not possible to create REST services in Java EE 5,6 project with GlassFish 4. To reproduce:

- create web project with GlassFish 4 (Java EE 5 or 6)
- open new file wizard
- choose "Web Services|RESTful Web Services from Patterns" and click Next
- click Next
- provide package name
- select "Use Jersey specific feature" (for Java EE 6)
- confirm REST Resources Configuration dialog {for Java EE 5)
- click Finish
- it sometimes creates web service, sometimes not and if project is deployed service is not available. The following exception is thrown (see also attachment for stack trace when creating service in Java EE 5 project):

java.lang.IllegalStateException: this should not be needed!
	at org.netbeans.modules.websvc.rest.spi.WebRestSupport.addResourceConfigToWebApp(WebRestSupport.java:641)
	at org.netbeans.modules.websvc.rest.spi.WebRestSupport.configRestPackages(WebRestSupport.java:1086)
	at org.netbeans.modules.websvc.rest.spi.WebRestSupport.configure(WebRestSupport.java:574)
[catch] at org.netbeans.modules.websvc.rest.wizard.PatternResourcesIterator$1.run(PatternResourcesIterator.java:153)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)
Comment 1 Jiri Skrivanek 2013-04-16 10:13:52 UTC
The same problem is also in Maven projects.

java.lang.IllegalStateException: this should not be needed!
        at org.netbeans.modules.websvc.rest.spi.WebRestSupport.addResourceConfigToWebApp(WebRestSupport.java:641)
        at org.netbeans.modules.maven.jaxws.MavenProjectRestSupport.ensureRestDevelopmentReady(MavenProjectRestSupport.java:134)
[catch] at org.netbeans.modules.websvc.rest.wizard.PatternResourcesIterator.instantiate(PatternResourcesIterator.java:124)
Comment 2 David Konecny 2013-04-18 02:58:25 UTC
This should be resolved now. There were many changes which contributed to resolution of this problem.

web-main#c9cfd3e372ce
web-main#c1db726d58c7
web-main#d64660cdfb26
Comment 3 Jiri Skrivanek 2013-04-18 09:24:14 UTC
Verified in javaee7 build 240. Filed bug 228688 for Maven EE 5 project.