--
You received this message because you are subscribed to the Google Groups "caelum-vraptor" group.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/juTPSpbGIgsJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/caelum-vraptor?hl=en.
Existe este plugin que usei há algum tempo atrás para fazer uns testes.
https://github.com/luizsignorelli/vraptor-gson-serializer
2012/4/13 Renan Reis <renanrei...@gmail.com>
Pessoal,estou propondo desenvolvermos um plugin para que o vraptor possa serializar JSON com o Gson. O motivo é que apesar do Xstream fazer um ótimo trabalho com xml, ele possui algumas deficiências quando se trata de json.Existem algumas implementações legais, porém, não são 100% compatíveis com a API do Vraptor.--O Gson serializa todos os atributos dos objetos e pelo que notei é em recursão de profundidade.Comecei uma implementação, mas ficou horrível. Consegui fazer a compatibilidade incluindo apenas alguns campos no result como .include("pessoa.empresa.endereco"), assim, ele serializa o endereço da empresa, porém, depois serializa o endereço da pessoa, oque não pode ocorrer (vou criar um teste para essa situação). Me esforcei muito e confesso achei complicado resolver tal problema. Também preciso tratar collections, oque não fiz ainda.Caso alguém se interesse na proposta existe um git https://github.com/renanreismartins/vraptor-gson-compatiblegrande abraço
You received this message because you are subscribed to the Google Groups "caelum-vraptor" group.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/juTPSpbGIgsJ.
To post to this group, send email to caelum-vraptor@googlegroups.com.
To unsubscribe from this group, send email to caelum-vraptor+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/PmprDnHOt3sJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/CylTslbm4ocJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
Pessoal, depois de muito trabalhos conseguimos desenvolver um plugin enxuto e que passa em todos os testes do vraptor, sendo 100% compativel com a api.vou falar com o lucas e o paulo para que coloquemos no rep.
abrasss
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/xV9IDzymbIIJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/oUQGqEqEjGkJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/7MTtcFPhybUJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter?
Field path 'list.escolaridade' doesn't exists in interface java.util.Collection
Com List
Field path 'list.escolaridade' doesn't exists in interface java.util.List
Por exemplo tenho um wrapper:
wrapper{Integer total;
String message;
Collection<T> list; // ou List<T> list;
}
Dai nessa Collection/List eu geralmente tenho alguma classe que tem composição, ou até mesmo outra lista.
então no Controller faço:
result.use(json()).withoutRoot().from(new Wrapper<Pessoa>(page, this.repository.count(), limit, true, "get", entityList)).include("list", "list.escolaridade", "list.telefoneList").serialize();
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/Ini1BwKMoj8J.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/MLNe1YHJAXoJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/ym4Y56d895cJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
exception
br.com.caelum.vraptor.InterceptionException: exception raised, check root cause for details: org.hibernate.HibernateException: Javassist Enhancement failed: br.com.fourdata.model.user.User br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:96) br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54) br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:61) br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)....root cause
org.hibernate.HibernateException: Javassist Enhancement failed: br.com.fourdata.model.user.User org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:142) org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:71) org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:631) org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3736) org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:360) org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:281) org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090) org.hibernate.impl.SessionImpl.load(SessionImpl.java:985) org.hibernate.impl.SessionImpl.load(SessionImpl.java:978) br.com.fourdata.controller.TaskController.x(TaskController.java:214) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
To view this discussion on the web visit https://groups.google.com/d/msg/caelum-vraptor/-/_mZOuwPm_ocJ.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "caelum-vraptor" group.
To post to this group, send email to caelum-...@googlegroups.com.
To unsubscribe from this group, send email to caelum-vrapto...@googlegroups.com.
Merge remote-tracking branch 'original/master'
--
--