Bug 980488 - bad response REST methods for helloworld-html5
bad response REST methods for helloworld-html5
Status: CLOSED INSUFFICIENT_DATA
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Examples (Show other bugs)
2.3.0
Unspecified Unspecified
unspecified Severity medium
: ---
: 2.4.0
Assigned To: Marek Novotny
Stefan Miklosovic
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-02 10:04 EDT by Stefan Miklosovic
Modified: 2015-08-02 19:42 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
The README.md file of the helloworld-html5 quickstart suggests that the application's REST endpoint can be manually accessed using a web browser. Because the POST method is used in the endpoint's implementation, the manual access fails. To work around the issue and allow manual access to the endpoint, change all occurrences of POST to GET in the org.jboss.as.quickstarts.html5rest.HelloWorld class and the index.html file.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-16 11:59:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ppenicka: needinfo+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFK2-32 Major Open bad response REST methods for helloworld-html5 2013-08-12 03:14:03 EDT

  None (edit)
Description Stefan Miklosovic 2013-07-02 10:04:11 EDT
Description of problem:
I am unable to test helloworld-html5 application for REST communication on any JBoss AS / EAP server. The problem is that in documentation, it is said I have to query 

http://localhost:8080/jboss-as-helloworld-html5/hello/xml/David

in order to get some xml formatted answer of David (substitue xml to json for json response).

However, I am getting 404/405 error codes.

The solution lies in class org.jboss.as.quickstarts.html5rest.HelloWorld where both endpoints are set. They are set as @POST but it does not make sense, they have to be annotated as @GET. After it, the application behaves correctly.

Web counterpart of the application behaves without issues.
Comment 1 sgilda 2013-07-03 14:24:34 EDT
Issued pull 553 with the fix:
https://github.com/jboss-jdf/jboss-as-quickstart/pull/553
Comment 2 sgilda 2013-07-03 14:25:45 EDT
@pmuir: There is also a 'Quickstarts' component under JBoss Enterprise Application Platform. Would that be a better location for this one?
Comment 3 Pete Muir 2013-07-04 12:06:17 EDT
@sgilda, no this one is targeted at WFK. An issue in JDF is the correct thing.
Comment 4 sgilda 2013-07-04 14:49:56 EDT
@pmuir: OK. This one is fixed an merged.
Comment 5 Petr Penicka 2013-07-07 16:43:06 EDT
Edited doc text for WFK 2.3 release notes.
Comment 6 sgilda 2013-07-08 07:23:46 EDT
The commit with the fix is here:
https://github.com/jboss-jdf/jboss-as-quickstart/commit/f2158fa4fd177b65b4a1f543fbe62165e69b8099

The fix impacts the following files:
helloworld-html5/README.md
helloworld-html5/src/main/java/org/jboss/as/quickstarts/html5rest/HelloWorld.java
helloworld-html5/src/main/webapp/index.html

@ppenicka, @smikloso: Should this fix be applied to the WFK repository (https://github.com/jboss-eap/quickstart/tree/master-wfk23) also?  Or is it too late?
Comment 7 sgilda 2013-07-08 07:25:39 EDT
@ppenicka: Please note, the index.html file also needs modification. Otherwise, the simple "Hello" doesn't work when you click the button.
Comment 9 Petr Penicka 2013-07-08 08:28:05 EDT
Changed the doc text so that the workaround matches the mentioned upstream fix, thanks sgilda for the notice ;)
Comment 10 Petr Penicka 2013-07-08 08:30:10 EDT
.. and inserted the doc text into the right field (Doc Text instead of Environment).
Comment 11 Pete Muir 2013-07-16 11:59:32 EDT
Migrated to JIRA
Comment 12 JBoss JIRA Server 2013-07-30 16:12:15 EDT
Sande Gilda <sgilda@redhat.com> made a comment on jira WFK2-32

This issue was fixed in the community version of the quickstarts here: https://github.com/jboss-jdf/jboss-as-quickstart 

This is the commit that was done on July 3, 2013: https://github.com/jboss-jdf/jboss-as-quickstart/commit/f2158fa4fd177b65b4a1f543fbe62165e69b8099

In the bug comments (https://bugzilla.redhat.com/show_bug.cgi?id=980488#c6), I asked whether the fix needed to be applied to the WFK repository. From the comments after, it's not clear what was decided.

After I fixed bug 980488, I reassigned it to Marek Novotny. Since this is fixed in the community quickstarts, should this JIRA be assigned Marek or someone on the WFK team?
Comment 13 sgilda 2013-07-31 06:50:29 EDT
Added dev_ack flag.

Note You need to log in before you can comment on or make changes to this bug.