• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question relating to an error I got during a rest call to @Get count of my model

 
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am new to rest and i try to learn it. I am struggling with a run time error related to the @get count of my model.
I tried to approach it two different ways but still got the same error.
I would like to seek your help if you happen to know what was wrong with my code.

My program is as follow :

I have a simple rest application and it consists of three packages called Order, OrderDAO , and OrderServices.




and I have my Rest simple client project which consists of a simple java program calling my rest service.




Every thing in the simple client program worked fine, except the @Get path("orders").path("count").accept(MediaType.TEXT_PLAIN).get(String.class)) to the rest service. It gave me a run time error saying that GET http://localhost:8080/RestSimpleApp/rest/orders/count returned a response status of 405.
I searched for the error 405 and it basically said that a HTTP Status code of 405 refers to Method Not Allowed. I wonder if my syntax @Get path("orders").path("count").accept(MediaType.TEXT_PLAIN).get(String.class)) is correct? I tried to use MediaType.APPLICATION.XML but it gave me the same error.
I 'd like to get your help if you can shed some light into what I did wrong.

Thank you very much in advance.

Mark




 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It worked when I changed the produces type to Text_Plain.
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic