BTW.... the same error occurs, using AeroGear-iOS 1.0.1 (based on AFN 1.0RC1)

Looks like the controller receives "text/html":

Expected content type {(

    "text/json",

    "application/json",

    "text/javascript"

)}, got text/html}





On Tue, Jun 18, 2013 at 8:10 AM, Matthias Wessendorf <matzew@apache.org> wrote:
Nope,

tried the staging URL, and I am still getting that error 


08:08:25,988 ERROR [org.jboss.aerogear.controller.log] (http--0.0.0.0-8080-1) AG_CONTROLLER000005: Exception Message: 'AG_CONTROLLER000012: No Consumer found for Parameter: 'Parameter[type=ENTITY, type=class org.aerogear.prodoctor.model.SaleAgent]'. The registered Consumers were: '[JsonConsumer[mediaType=application/json]]'. Please add a Consumer for one the media types supported by the route: [application/json].': java.lang.RuntimeException: AG_CONTROLLER000012: No Consumer found for Parameter: 'Parameter[type=ENTITY, type=class org.aerogear.prodoctor.model.SaleAgent]'. The registered Consumers were: '[JsonConsumer[mediaType=application/json]]'. Please add a Consumer for one the media types supported by the route: [application/json].
at org.jboss.aerogear.controller.util.ParameterExtractor.getConsumer(ParameterExtractor.java:152) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.util.ParameterExtractor.extractArguments(ParameterExtractor.java:70) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor.process(DefaultRouteProcessor.java:53) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor$Proxy$_$$_WeldSubclass.process(DefaultRouteProcessor$Proxy$_$$_WeldSubclass.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.rest.pagination.PaginationHandler.process(PaginationHandler.java:80) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:78) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.interceptor.util.proxy.TargetInstanceProxyMethodHandler.invoke(TargetInstanceProxyMethodHandler.java:43) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.weld.bean.proxy.TargetBeanInstance.invoke(TargetBeanInstance.java:88) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.process(DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.decorators.SecurityHandler.process(SecurityHandler.java:65) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:78) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.interceptor.util.proxy.TargetInstanceProxyMethodHandler.invoke(TargetInstanceProxyMethodHandler.java:43) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.weld.bean.proxy.TargetBeanInstance.invoke(TargetBeanInstance.java:88) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.process(DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.decorators.ErrorHandler.process(ErrorHandler.java:61) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:78) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.interceptor.util.proxy.TargetInstanceProxyMethodHandler.invoke(TargetInstanceProxyMethodHandler.java:43) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.weld.bean.proxy.TargetBeanInstance.invoke(TargetBeanInstance.java:88) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.process(DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.decorators.ResponseHandler.process(ResponseHandler.java:53) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:78) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.interceptor.util.proxy.TargetInstanceProxyMethodHandler.invoke(TargetInstanceProxyMethodHandler.java:43) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.weld.bean.proxy.TargetBeanInstance.invoke(TargetBeanInstance.java:88) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.process(DefaultRouteProcessor$Proxy$_$$_Weld$Proxy$.java) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:59) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouteProcessor$Proxy$_$$_WeldSubclass.process(DefaultRouteProcessor$Proxy$_$$_WeldSubclass.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.DefaultRouter.dispatch(DefaultRouter.java:74) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.DefaultRouter$Proxy$_$$_WeldSubclass.dispatch(DefaultRouter$Proxy$_$$_WeldSubclass.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.router.decorators.cors.CorsHandler.dispatch(CorsHandler.java:72) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:78) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.interceptor.util.proxy.TargetInstanceProxyMethodHandler.invoke(TargetInstanceProxyMethodHandler.java:43) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.weld.bean.proxy.TargetBeanInstance.invoke(TargetBeanInstance.java:88) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouter$Proxy$_$$_Weld$Proxy$.dispatch(DefaultRouter$Proxy$_$$_Weld$Proxy$.java) [aerogear-controller-1.0.1.jar:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:59) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.aerogear.controller.router.DefaultRouter$Proxy$_$$_WeldSubclass.dispatch(DefaultRouter$Proxy$_$$_WeldSubclass.java) [aerogear-controller-1.0.1.jar:1.0.1]
at org.jboss.aerogear.controller.filter.AeroGear.doFilter(AeroGear.java:52) [aerogear-controller-1.0.1.jar:1.0.1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]





On Tue, Jun 18, 2013 at 6:14 AM, Daniel Bevenius <daniel.bevenius@gmail.com> wrote:
Hi, 

this sounds like a bug that we found a while back:

Perhaps you could try the staged version 1.0.1 that Bruno deployed yesterday:

/Dan 


On 18 June 2013 00:56, Sebastien Blanc <scm.blanc@gmail.com> wrote:
Hi Corinne,
On a route you can set different consumers ( http://aerogear.org/docs/guides/aerogear-controller/mediatypes.html ) , I've updated the Route on Prodoctor and now it seems to work. I can not reproduce your ios example here on my fedora box but this curl works now :

curl -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json; charset=utf-8" -X POST -d '{"loginName": "john", "password":"123"}' http://localhost:8080/prodoctor/login

Update the repo and give it a try ! 

Seb



On Mon, Jun 17, 2013 at 10:47 PM, Corinne Krych <corinnekrych@gmail.com> wrote:

Hello Guys

Writing code for ProDoctor demo, on client side, I'm using Xcode template for AGPush which is based on AFNetworking 121

When doing my login request in iOS I bumped into the issue of having content type set to "application/json; charset=utf-8" whereas on routes (backend) only "application/json" is set which causes this exception:

[application/json].': java.lang.RuntimeException: AG_CONTROLLER000012: No Consumer found for Parameter: 'Parameter[type=ENTITY, type=class org.aerogear.prodoctor.model.SaleAgent]'. The registered Consumers were: '[JsonConsumer[mediaType=application/json]]'. Please add a Consumer for one the media types supported by the route: [application/json].

at org.jboss.aerogear.controller.util.ParameterExtractor.getConsumer(ParameterExtractor.java:152) [aerogear-controller-1.0.1.jar:1.0.1]

at org.jboss.aerogear.controller.util.ParameterExtractor.extractArguments(ParameterExtractor.java:70) [aerogear-controller-1.0.1.jar:1.0.1]


I think we should support both  "application/json; charset=utf-8" and  "application/json". /shall we open a JIRA on AeroGear Controller to support both?


wdyt?


Corinne



_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf