Return-Path: Delivered-To: apmail-openejb-users-archive@www.apache.org Received: (qmail 36701 invoked from network); 7 Aug 2008 10:17:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2008 10:17:13 -0000 Received: (qmail 83718 invoked by uid 500); 7 Aug 2008 10:17:12 -0000 Delivered-To: apmail-openejb-users-archive@openejb.apache.org Received: (qmail 83706 invoked by uid 500); 7 Aug 2008 10:17:11 -0000 Mailing-List: contact users-help@openejb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openejb.apache.org Delivered-To: mailing list users@openejb.apache.org Received: (qmail 83695 invoked by uid 99); 7 Aug 2008 10:17:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 03:17:11 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sami.jaber@gmail.com designates 209.85.198.229 as permitted sender) Received: from [209.85.198.229] (HELO rv-out-0506.google.com) (209.85.198.229) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 10:16:13 +0000 Received: by rv-out-0506.google.com with SMTP id g37so347648rvb.35 for ; Thu, 07 Aug 2008 03:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=zOMBIFhJlIW0Q2K93/Dc/jAZxYAN+Iyssfwc9noxJhc=; b=qs3wsAObXp0lHrLKSr7d4FeCKRva9k/WARo4HhXGToLLVK5pAHGkYQwL2quMhEcF3r IF7YGrI0kPZQ2OgPNVhQ0zBCLLW6ZVb0hU3qCmPad+IBN6hcqxQ2XFZsa3kBcJIeRRN8 HlL9QtyueMaH5DsoVKlifeOCr0H2M2mBV15Lg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=hnIEYRcBkTdjArdNZLbu32NjXy2GWVMFcVAqRPw4YCmKYfGurLGqHVXPNQUj1j67qW 2HpOR1JQjBuM/1nvjtBTei+p6oNFXK4fZUMqqG/+d3kagbZ1XNJWTuS5Ba/g2CjEY1kr GNzk1I2/PAVeFfj1iB94y8HUhZq8Kdk+xFng8= Received: by 10.141.89.13 with SMTP id r13mr624621rvl.177.1218104183692; Thu, 07 Aug 2008 03:16:23 -0700 (PDT) Received: by 10.141.51.21 with HTTP; Thu, 7 Aug 2008 03:16:23 -0700 (PDT) Message-ID: <7371f2650808070316y4d9fff6sf1bd7dd827854fac@mail.gmail.com> Date: Thu, 7 Aug 2008 12:16:23 +0200 From: "Sami Jaber" To: users@openejb.apache.org Subject: Re: Lazy fields issue with Hibernate/OpenEJB In-Reply-To: <4F08A164-E518-4A1C-B90A-840195532389@visi.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9550_25935234.1218104183692" References: <7371f2650808060953ie75b86bi5ff182e468b7715@mail.gmail.com> <7371f2650808061433j1e29006fm2513544b5c81a1fd@mail.gmail.com> <23363B53-5827-403F-B879-530E3F962728@visi.com> <7371f2650808070035x148ee1b6m79ee66241ce5d159@mail.gmail.com> <7371f2650808070108h16b8e202k16fc98a449b4b82@mail.gmail.com> <4F08A164-E518-4A1C-B90A-840195532389@visi.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9550_25935234.1218104183692 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks, in fact I have decompiled, patched and updated my openejb-client.jar with the content of the current trunk, it worked. That's better to have the whole thing instead of hacking out the bits. 2008/8/7 David Blevins > Ok. Whipped up another build. > > http://people.apache.org/~dblevins/openejb-3.1-r683569.zip > > Let's see if we don't have better luck with this one. > > -David > > > > On Aug 7, 2008, at 1:08 AM, Sami Jaber wrote: > > I have checked out the last revision of EjbOutputStream and resolveClass >> method : >> >> http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EjbObjectInputStream.java?view=markup&pathrev=672430 >> This bug should not occurs if I have the right version of >> openejbclient.jar >> >> catch (ClassNotFoundException e) { >> String n = classDesc.getName(); >> if (n.equals("boolean")) return boolean.class; >> if (n.equals("byte")) return byte.class; >> if (n.equals("char")) return char.class; >> if (n.equals("short")) return short.class; >> if (n.equals("int")) return int.class; >> if (n.equals("long")) return long.class; >> if (n.equals("float")) return float.class; >> if (n.equals("double")) return double.class; >> >> I have decompiled the jar you sent me David, here the result : >> >> // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. >> // Jad home page: http://www.kpdus.com/jad.html >> // Decompiler options: packimports(3) >> // Source File Name: EjbObjectInputStream.java >> >> package org.apache.openejb.client; >> >> import java.io.*; >> import java.lang.reflect.Proxy; >> >> public class EjbObjectInputStream extends ObjectInputStream >> { >> public EjbObjectInputStream(InputStream in) >> throws IOException >> { >> super(in); >> } >> >> protected Class resolveClass(ObjectStreamClass classDesc) >> throws IOException, ClassNotFoundException >> { >> return Class.forName(classDesc.getName(), false, getClassloader()); >> } >> >> protected Class resolveProxyClass(String interfaces[]) >> throws IOException, ClassNotFoundException >> { >> Class cinterfaces[] = new Class[interfaces.length]; >> for(int i = 0; i < interfaces.length; i++) >> cinterfaces[i] = getClassloader().loadClass(interfaces[i]); >> try >> { >> return Proxy.getProxyClass(getClassloader(), cinterfaces); >> } >> catch(IllegalArgumentException e) >> { >> throw new ClassNotFoundException(null, e); >> } >> } >> >> ClassLoader getClassloader() >> { >> return Thread.currentThread().getContextClassLoader(); >> } >> } >> >> We got it. If you can send a working jar of openejb-ejb I will be grateful >> >> >> Sami >> >> 2008/8/7 Sami Jaber >> >> Damned, here is my stacktrace >>> >>> Starting Main ... >>> Debug of initialContext >>> >>> {java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory, >>> java.naming.security.principal=USERNAME, >>> openejb.home=W:\dev_tools\openejb-3.0, >>> openejb.embedded.remotable=true, local-copy=false, >>> openejb.server.debug=true, openejb.deployments.classpath.ear=true, >>> openejb.configuration=W:\dev_tools\openejb-3.0\conf\openejb.xml, >>> openejb.loader=embed, java.naming.security.credentials=PASS} >>> >>> javax.ejb.EJBException: Container has suffered a SystemException >>> at >>> >>> org.apache.openejb.client.EJBObjectHandler._invoke(EJBObjectHandler.java:173) >>> at >>> >>> org.apache.openejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:117) >>> at >>> >>> org.apache.openejb.client.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:52) >>> at $Proxy0.call(Unknown Source) >>> at fr.aeag.redevances.presentation.Main.main(Main.java:45) >>> Caused by: java.rmi.RemoteException: The server has encountered a fatal >>> error: Error caught during request processing >>> java.lang.ClassNotFoundException: boolean; nested exception is: >>> java.lang.ClassNotFoundException: boolean >>> at >>> >>> org.apache.openejb.server.ejbd.EjbRequestHandler.replyWithFatalError(EjbRequestHandler.java:425) >>> at >>> >>> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:103) >>> at >>> >>> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164) >>> at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122) >>> at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84) >>> at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60) >>> at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78) >>> at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101) >>> at >>> >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) >>> at >>> >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) >>> at java.lang.Thread.run(Thread.java:619) >>> Caused by: java.lang.ClassNotFoundException: boolean >>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200) >>> at java.security.AccessController.doPrivileged(Native Method) >>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:306) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251) >>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Class.java:247) >>> at >>> >>> org.apache.openejb.client.EjbObjectInputStream.resolveClass(EjbObjectInputStream.java:35) >>> at >>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575) >>> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) >>> at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1462) >>> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1312) >>> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) >>> at >>> >>> org.apache.openejb.client.EJBRequest$Body.readMethodParameters(EJBRequest.java:386) >>> at >>> >>> org.apache.openejb.client.EJBRequest$Body.readExternal(EJBRequest.java:200) >>> at >>> >>> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:101) >>> ... 9 more >>> >>> Your test case works obviously over LocalInitialContext. >>> Does it mean it is a regression ? >>> >>> >>> Sami >>> >>> >>> 2008/8/7 David Blevins >>> >>> >>> On Aug 6, 2008, at 2:33 PM, Sami Jaber wrote: >>>> >>>> Well David, I have the bits you sent me (kindly) yesterday by mail when >>>> I >>>> >>>>> asked you for a "patched" version of 3.0 supporting >>>>> deployments.classpath.ear. >>>>> (http://people.apache.org/~dblevins/openejb-3.1-r683137.tar.gz >>>>> >>>>> >>>>> ) >>>>> Do you think that I could get a patched version of the patched version >>>>> that >>>>> correct this bug ? >>>>> I pay you a beer to thank you ;-) >>>>> >>>>> >>>> It should contain that bug fix. Hmmm... >>>> >>>> Give a bean like this a try over the RemoteInitialContextFactory, if it >>>> works, then the explanation given in >>>> https://jira.jboss.org/jira/browse/EJBTHREE-440 cannot be accurate. >>>> >>>> @Stateless >>>> public class TesterBean implements Tester { >>>> public Object call(Object object) { >>>> return object; >>>> } >>>> } >>>> >>>> public interface Tester { >>>> public Object call(Object object); >>>> } >>>> >>>> Then in your client code make these calls: >>>> >>>> tester.call(boolean.class); >>>> tester.call(byte.class); >>>> tester.call(char.class); >>>> tester.call(short.class); >>>> tester.call(int.class); >>>> tester.call(long.class); >>>> tester.call(float.class); >>>> tester.call(double.class); >>>> >>>> -David >>>> >>>> >>>> >>>> >>>> >>>>> 2008/8/6 David Blevins >>>>> >>>>> On Aug 6, 2008, at 10:28 AM, Dain Sundstrom wrote: >>>>> >>>>>> >>>>>> I believe this this the JIRA for the issue: >>>>>> >>>>>> >>>>>>> https://jira.jboss.org/jira/browse/EJBTHREE-440 >>>>>>> >>>>>>> It appears that Hibernate requires a custom ObjectInputStream to work >>>>>>> properly. They claim the root cause is this VM bug: >>>>>>> >>>>>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4171142 >>>>>>> >>>>>>> It seems strange that is could be the cause of the bug. >>>>>>> >>>>>>> David, what do you think? >>>>>>> >>>>>>> >>>>>>> We did have that bug in 3.0 final. It's since been fixed: >>>>>> >>>>>> http://issues.apache.org/jira/browse/OPENEJB-832 >>>>>> http://svn.apache.org/viewvc?view=rev&revision=672429 (the fix) >>>>>> http://svn.apache.org/viewvc?view=rev&revision=672444 (the tests) >>>>>> >>>>>> Sami, what version of the openejb-client.jar are you using? >>>>>> >>>>>> -David >>>>>> >>>>>> >>>>>> >>>>>> On Aug 6, 2008, at 9:53 AM, Sami Jaber wrote: >>>>>> >>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> >>>>>>>> I try to get the couple JPA(Hibernate) and OpenEJB works with an >>>>>>>> application >>>>>>>> that uses lazy fields in Pojo. >>>>>>>> My application is pretty simple, I have an inheritance and some lazy >>>>>>>> fields >>>>>>>> are declared FetchMode.LAZY. >>>>>>>> >>>>>>>> When I run a client remotely, i get the same error before any call : >>>>>>>> >>>>>>>> >>>>>>>> javax.ejb.EJBException: Unknown Container Exception: >>>>>>>> java.rmi.RemoteException: Error reading response from server >>>>>>>> (OEJP/3.0) : >>>>>>>> cannot assign instance of >>>>>>>> org.hibernate.proxy.pojo.javassist.SerializableProxy to field >>>>>>>> mypackage.Pojo.controleur of type mypackage.domain.user.User in >>>>>>>> instance >>>>>>>> of >>>>>>>> mypackage.OtherPojo; nested exception is: >>>>>>>> java.lang.ClassCastException: cannot assign instance of >>>>>>>> org.hibernate.proxy.pojo.javassist.SerializableProxy to field >>>>>>>> mypackage.Pojo.controleur of type mypackage.domain.user.User in >>>>>>>> instance >>>>>>>> of >>>>>>>> mypackage.OtherPojo >>>>>>>> >>>>>>>> OtherPojo inherits from Pojo. With all kind of combination >>>>>>>> (remotable=true, >>>>>>>> local-copy/true or false, ....), switching to cglib<->javaassist, I >>>>>>>> get >>>>>>>> desperately the same exception. Note that with LocalInitialContext, >>>>>>>> all >>>>>>>> works perfectly. As soon as I run cross JVM calls thru >>>>>>>> RemoteInitialContext, >>>>>>>> it hangs. >>>>>>>> >>>>>>>> My problem is very close to this issue : >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> http://www.jboss.com/index.html?module=bb&op=viewtopic&t=76737&postdays=0&postorder=asc&start=0 >>>>>>>> >>>>>>>> any clue? this is very frustrating ... >>>>>>>> >>>>>>>> Or, if anybody can provide me with a test case that makes OpenEJB >>>>>>>> and >>>>>>>> Hibernate work with lazy fields, i would really appreciate >>>>>>>> >>>>>>>> >>>>>>>> Sami >>>>>>>> >>>>>>>> ps : here is my server stacktrace when the error raises >>>>>>>> >>>>>>>> 2008-08-06 18:39:02,975 - FATAL - Couldn't write EjbResponse to >>>>>>>> output >>>>>>>> stream >>>>>>>> java.net.SocketException: Software caused connection abort: socket >>>>>>>> write >>>>>>>> error >>>>>>>> at java.net.SocketOutputStream.socketWrite0(Native Method) >>>>>>>> at >>>>>>>> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) >>>>>>>> at java.net.SocketOutputStream.write(SocketOutputStream.java:136) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1838) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1747) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1249) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1203) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1387) >>>>>>>> at >>>>>>>> >>>>>>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1538) >>>>>>>> at >>>>>>>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:329) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> org.apache.openejb.client.EJBResponse.writeExternal(EJBResponse.java:133) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:215) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164) >>>>>>>> at >>>>>>>> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122) >>>>>>>> at >>>>>>>> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84) >>>>>>>> at >>>>>>>> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60) >>>>>>>> at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78) >>>>>>>> at >>>>>>>> org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) >>>>>>>> at java.lang.Thread.run(Thread.java:619) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>> >>> > ------=_Part_9550_25935234.1218104183692--