openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: Lazy fields issue with Hibernate/OpenEJB
Date Wed, 06 Aug 2008 22:04:48 GMT

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 <david.blevins@visi.com>
>
>> 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)
>>>>
>>>
>>>
>>>
>>


Mime
View raw message