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 202346

Summary: Maven REST Sample Application doesn't work properly
Product: webservices Reporter: Jiri Skrivanek <jskrivanek>
Component: RESTAssignee: Denis Anisimov <ads>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Stack trace when getting messages.

Description Jiri Skrivanek 2011-09-20 09:55:58 UTC
Created attachment 110905 [details]
Stack trace when getting messages.

It is possible to build and run REST Sample Application but its functionality is broken. To reproduce:

- register GlassFish server to IDE
- open new project wizard
- choose "Samples|Java Web Services|REST: Message Board"
- finish the wizard
- run project
- open new project wizard
- choose "Samples|Maven|REST Sample Application (Maven)"
- finish the wizard
- build main project "rest-sample-application - NetBeans Platform Application"
- there is no Run action on this project (is it a bug also?)
- run project "rest-sample-application - NetBeans Platform based application". It opens NetBeans platform app. but it fails to download messages
from message board application (see attached stack trace).

Product Version: NetBeans IDE Dev (Build 201109190600)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)
Comment 1 Denis Anisimov 2011-09-20 10:11:28 UTC
Right.
This sample requires other sample.
It is REST Message Board  Java EE 6 sample project.

- First of all : 
there should be notice about this in the Maven project description. 
Current description is ugly and should be corrected itself.
- REST: Message Board application has different root url for REST resources.
This project should be corrected. It has also some bad content of Java classes.

As result : the url which is required by Maven project doesn't exist and server doesn't handle request properly. So there is no XML response. That's why you get an exception.

Both samples should be corrected.
Comment 2 Denis Anisimov 2011-09-21 11:29:20 UTC
I was wrong about correctness of URLs.
All URLs are good and synchronized between projects.
The problem is different. REST client expects XML response . But REST service
always returns response in text format.
So there is no XML root element and this is a problem.
Comment 3 Denis Anisimov 2011-09-22 06:38:57 UTC
web-main#fb7fd8c03e8d