A mudança foi aqui, acho eu: flex.messaging.io.amf.Amf3Output.writePropertyProxy
depois re-gerei o jar e pumba, funcionou. coloquei um try catch pra o erro do Lazy e mando null no atributo na classe flez :) 2008/11/4 LeonardoW <[EMAIL PROTECTED]> > > ERROR [LazyInitializationException] could not initialize proxy - the > owning Session was closed > org.hibernate.LazyInitializationException: could not initialize proxy > - the owning Session was closed > at > > org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java: > 56) > at > > org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java: > 98) > at > > org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java: > 158) > at br.com.cpr.flex.Usuario$$EnhancerByCGLIB$ > $1c43bd33_3.getNuContatelefone(<generated>) > at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: > 25) > at java.lang.reflect.Method.invoke(Method.java:597) > at flex.messaging.io.BeanProxy$BeanProperty.get(BeanProxy.java:738) > at flex.messaging.io.BeanProxy.getBeanValue(BeanProxy.java:199) > at flex.messaging.io.BeanProxy.getValue(BeanProxy.java:176) > at > flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java: > 565) > at > flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java: > 518) > at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193) > at > flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java: > 26) > at > flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java: > 243) > at > flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java: > 566) > at > flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java: > 518) > at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193) > at > flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java: > 26) > at > flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java: > 817) > at flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java: > 431) > at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:179) > at > flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java: > 26) > at > flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java: > 97) > at > flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java: > 556) > at > flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java: > 462) > at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:175) > at > flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java: > 26) > at > flex.messaging.messages.AbstractMessage.writeExternal(AbstractMessage.java: > 352) > at > flex.messaging.messages.AsyncMessage.writeExternal(AsyncMessage.java: > 140) > at > > flex.messaging.messages.AcknowledgeMessage.writeExternal(AcknowledgeMessage.java: > 92) > at > > flex.messaging.messages.AcknowledgeMessageExt.writeExternal(AcknowledgeMessageExt.java: > 55) > at > flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java: > 556) > at > flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java: > 518) > at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:193) > at > flex.messaging.io.amf.Java15Amf3Output.writeObject(Java15Amf3Output.java: > 26) > at flex.messaging.io.amf.Amf0Output.writeObject(Amf0Output.java:193) > at > flex.messaging.io.amf.Java15Amf0Output.writeObject(Java15Amf0Output.java: > 41) > at > > flex.messaging.io.amf.AmfMessageSerializer.writeObject(AmfMessageSerializer.java: > 196) > at > > flex.messaging.io.amf.AmfMessageSerializer.writeBody(AmfMessageSerializer.java: > 186) > at > > flex.messaging.io.amf.AmfMessageSerializer.writeMessage(AmfMessageSerializer.java: > 142) > at > > flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java: > 179) > at > flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java: > 274) > at > flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java: > 377) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) > at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: > 252) > at > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: > 173) > at > > net.digitalprimates.persistence.hibernate.utils.filters.HibernateSessionServletFilter.doFilter(HibernateSessionServletFilter.java: > 62) > at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: > 202) > at > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: > 173) > at > > org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java: > 96) > at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: > 202) > at > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: > 173) > at > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: > 213) > at > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: > 178) > at > > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java: > 175) > at > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java: > 524) > at flex.messaging.security.TomcatValve.invoke(TomcatValve.java:143) > at > > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java: > 74) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: > 126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: > 105) > at > > org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java: > 156) > at > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: > 107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: > 148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: > 869) > at org.apache.coyote.http11.Http11BaseProtocol > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java: > 664) > at > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java: > 527) > at > > org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java: > 112) > at java.lang.Thread.run(Thread.java:619) > > On 4 nov, 14:02, "George Queiroz" <[EMAIL PROTECTED]> wrote: > > Leo, eu sai da empresa, e os caras num encontraram o fonte modificado... > > > > manda o stack q vai q lembro, te aviso. > > > > 2008/11/4 Léo <[EMAIL PROTECTED]> > > > > > Blz!!! E a solução feita no blazeDS, podes me passar para dar uma > olhada?Muito > > > obrigado pelas idéias > > > Vlw > > > > > 2008/11/4 George Queiroz <[EMAIL PROTECTED]> > > > > > Leo em resumo ou vc liga o opensessioninview no web.xml pra os lazy > serem > > >> carregados ou num tem solução, pois o blazeds pega todos os atributos > da > > >> entidade pai e manda um get... se vc ligar o OSIV ai ele vai carregar > tudo e > > >> num é a idéia. > > > > >> 2008/11/4 Léo <[EMAIL PROTECTED]> > > > > >>> Olá pessoal, estou bem informado sobre lazy loading... sei pq > acontence > > >>> etc...de qualquer forma agradeço a todos pelas respostas. > > >>> Essa alternativa de alterar o source do BlazeDS não me parece ideal, > pois > > >>> sempre que atualizar o blazeDS terei que lembrar de alterar novamente > e > > >>> gerar o respectivo jar. certo? > > >>> Mas posta ai essa solução, fiquei interessado. > > >>> Vlw > > > > >>> 2008/11/4 Mário Júnior <[EMAIL PROTECTED]> > > > > >>>> Dá pra alterar no source do blazeDS para nao lançar > > >>>> LazyInitializationException, e setar o atributo da coleção para > null. > > >>>> O George já fez isso aqui, eu até vi no source onde faz... assim q > eu > > >>>> tiver um tepinho te passo.. mas será bem intrusivo alterar o source > do > > >>>> blazeds. > > > > >>>> George.. aparece aí rapaz... > > > > >>>> 2008/11/4 Léo <[EMAIL PROTECTED]> > > > > >>>> Sim, eu sei...mas sempre que retorno os dados do java para o flex > ele > > >>>>> tenta carregar os proxys, ai a sessão está fechada e ocorre o erro. > Deveria > > >>>>> pelo menos ter a opção de escolher se você quer que carregue ou > não. > > >>>>> No caso ou eu seto para null os proxys ou deixo o erro acontecer... > > > > >>>>> 2008/11/4 Rafael Nami <[EMAIL PROTECTED]> > > > > >>>>> Não é essa a questão Leo. O problema existe - Lazy initialization é > o > > >>>>>> um problema de implementação. Provavelmente esteja chamando um > proxy em um > > >>>>>> local aonde não possua mais contexto persistente. Dá uma caçada às > bruxas ae > > >>>>>> mano. > > >>>>>> Abraços > > > > >>>>>> Rafael Mauricio Nami > > > > >>>>>> 2008/11/4 LeonardoW <[EMAIL PROTECTED]> > > > > >>>>>>> Bom acho que vou abandonar esse fw.... > > >>>>>>> Porque justamente não quero carregar todos os mapeamentos, o que > > >>>>>>> onera > > >>>>>>> as consultas na base... > > >>>>>>> E se fosse para carregar tudo, eu poderia fazer direto pelas > > >>>>>>> configurações do hibernate! > > >>>>>>> Me corrija se eu estiver errado...Melhor deixar do jeito que > está... > > >>>>>>> Tem como não lançar a exceção de lazy loading? > > >>>>>>> Vlw > > > > >>>>>>> On 3 nov, 19:37, "Rafael Nami" <[EMAIL PROTECTED]> wrote: > > >>>>>>> > Fala Leo, beleza?Seguinte mano, eu já testei essa biblioteca, e > já > > >>>>>>> olhei o > > >>>>>>> > código fonte, faz uns treco bizarro (tipo, colocar chamadas a > > >>>>>>> remoteObject > > >>>>>>> > para chamar um "contexto persistente extendido" aonde tem > > >>>>>>> HibernateProxy). > > >>>>>>> > Ou seja, ele propaga o contexto de persistência para o servlet > > >>>>>>> filter que o > > >>>>>>> > dpHibernate configura (lembra da tabajarisse do > > >>>>>>> OpenSessionInViewFilter?). > > >>>>>>> > Alem do mais, até aonde vi, é necessário fazer tanto seus beans > > >>>>>>> java quanto > > >>>>>>> > os .as extenderem classes do framework, o que é muito invasivo, > no > > >>>>>>> que diz > > >>>>>>> > respeito à estruturas legadas Java (o que pode ser seu caso :) > ). > > >>>>>>> > A melhor solução é a que sempre falo - use o hibernate com > > >>>>>>> moderação :) > > >>>>>>> > Use e abuse de Projections e HQL construindo objetos e/ou Maps, > que > > >>>>>>> ae você > > >>>>>>> > que "controla" o select que será executado no banco. E recupere > > >>>>>>> para a > > >>>>>>> > camada de visão algo que tenha significado apenas para a camada > de > > >>>>>>> > apresentação (aka - PresentationModels). Expor na camada view > > >>>>>>> coisas de > > >>>>>>> > Hibernate, além de ser um problema de design, é algo que pode > > >>>>>>> trazer > > >>>>>>> > problemas de performance. > > > > >>>>>>> > Aquele abraço > > > > >>>>>>> > Rafael Nami > > > > >>>>>>> > 2008/11/3 LeonardoW <[EMAIL PROTECTED]> > > > > >>>>>>> > > Olá pessoal, > > >>>>>>> > > estou começando a usar o dpHibernate para solucionar o > problema > > >>>>>>> de > > >>>>>>> > > lazy load e gostaria de saber se tem como fazer ele funcionar > com > > >>>>>>> o > > >>>>>>> > > hibernate.properties ao invez do hibernate.cfg.xml? > > >>>>>>> > > Outra questão, meus objetos .as e .java tem que > obrigatoriamente > > >>>>>>> > > extender as classes hibernatebean e hiberanteProxy? Pois a > > >>>>>>> princípio > > >>>>>>> > > apenas configurei o web.xml e o remote-config.xml + as > > >>>>>>> bibliotecas > > >>>>>>> > > necessárias e ele parou de gerar erro de lazy.... Só não > afirmo > > >>>>>>> isso > > >>>>>>> > > com 100% de certeza, pois ainda não está funfando 100%. > > >>>>>>> > > Vou fazer alguns testes aqui... > > >>>>>>> > > []´s > > > > >>>> -- > > >>>> Mário de Souza Júnior > > >>>> Programador Java / Adobe Flex > > >>>> (44) 4009-3550 Maringá-PR > > >>>>http://blog.mariojunior.com > > >>>> [EMAIL PROTECTED] (gtalk, msn, etc..) > > > --~--~---------~--~----~------------~-------~--~----~ Você recebeu esta mensagem porque está inscrito na lista "flexdev" Para enviar uma mensagem, envie um e-mail para [email protected] Para sair da lista, envie um email em branco para [EMAIL PROTECTED] Mais opções estão disponíveis em http://groups.google.com/group/flexdev -~----------~----~----~----~------~----~------~--~---
