You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by rbaumhof <ra...@web.de> on 2008/08/01 21:18:52 UTC

Is java.util.date not supported by remote interface??

Hello at Geronimo,

i have a fine working geronimo web application. All calls from tomcat are
passed to the ejb container by local interfaces. Now i want to create for
special users a second java swing application. This of course works with
remote interfaces. Most calls towards the new remote interfaces (which are
identical to the local interfaces) are working, but some of them don't work
because the data objects returned from the ejb container have java.util.date
properties. It seems that they can not be passed over the remote interface. 

Error message:
Exception on login:Unknown Container Exception: java.rmi.RemoteException:
Cannot read the response from the server.  The class for an object being
returned is not located in this system:; nested exception is: 
	java.lang.ClassNotFoundException:
org.apache.openjpa.util.java$util$Date$proxy

If i omit the java.util.date objects the service call succeds. I am
surprised that this simple data type is not supported by the remote
interfaces. Can i do anything to make it work??

thanks in advance,.....


-- 
View this message in context: http://www.nabble.com/Is-java.util.date-not-supported-by-remote-interface---tp18781027s134p18781027.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Is java.util.date not supported by remote interface??

Posted by Kevin Sutter <kw...@gmail.com>.
Pinaki,
If the entities are detached, shouldn't we be serializing the non-proxy
version of the various utility classes?  For simple clients, we shouldn't
require the use of the OpenJPA binaries, should we?

Kevin

On Sun, Aug 3, 2008 at 10:39 PM, Pinaki Poddar <pp...@apache.org> wrote:

>
> Hi,
>   > Looks like OpenJPA is subclassing the java.util.Date class so what's
> passed is actually not the simple data type you're expecting but  rather an
> instance of org.apache.openjpa.util.java$util$Date$proxy
>
>   You are right. OpenJPA proxies all mutable second class types [1] so that
> any change in their state while they are remoted can be tracked and hence
> can later be merged to a different persistence context.
>
>
> > It looks like a dynamically generated class,
>   Yes. These proxy classes are dynamically generated.
>
> > It seems that they can not be passed over the remote  interface.
>
> These dynamic proxies can be transmitted over the wire. If the remote
> process has access to openjpa.jar then these classes should work as well in
> the remote process without any explicit user level knowledge.
>
>
> > Can i do anything to make it work??
>
> The most obvious solution is to make openjpa.jar available to the Swing
> client.
> If that is not possible then consider custom proxy [2] [3].
>
> [1]
>
> http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_pc_scos_proxy_custom
> [2]
>
> http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/util/ProxyManager.html
> [3]
>
> http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/util/ProxyManagerImpl.html
>
>
> --
> View this message in context:
> http://n2.nabble.com/Re%3A-Is-java.util.date-not-supported-by-remote-interface---tp667769p667799.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>
>

Re: Is java.util.date not supported by remote interface??

Posted by Pinaki Poddar <pp...@apache.org>.
Hi,
  > Looks like OpenJPA is subclassing the java.util.Date class so what's
passed is actually not the simple data type you're expecting but  rather an
instance of org.apache.openjpa.util.java$util$Date$proxy 

  You are right. OpenJPA proxies all mutable second class types [1] so that
any change in their state while they are remoted can be tracked and hence
can later be merged to a different persistence context.


> It looks like a dynamically generated class,  
  Yes. These proxy classes are dynamically generated. 

> It seems that they can not be passed over the remote  interface.

These dynamic proxies can be transmitted over the wire. If the remote
process has access to openjpa.jar then these classes should work as well in
the remote process without any explicit user level knowledge.
  

> Can i do anything to make it work??

The most obvious solution is to make openjpa.jar available to the Swing
client.
If that is not possible then consider custom proxy [2] [3]. 

[1]
http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_pc_scos_proxy_custom
[2]
http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/util/ProxyManager.html
[3]
http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/util/ProxyManagerImpl.html


-- 
View this message in context: http://n2.nabble.com/Re%3A-Is-java.util.date-not-supported-by-remote-interface---tp667769p667799.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Re: Is java.util.date not supported by remote interface??

Posted by Kevan Miller <ke...@gmail.com>.
On Aug 5, 2008, at 3:41 PM, rbaumhof wrote:

>
> Thanks for your hints. The class is of course contained in the  
> openjpa.jar
> included in geronimo. I only included the openejb-client.jar -  
> according to
> the client example at the geronimo website.  And i did not closely  
> look at
> the error message and did not see the prefixing org.apache.openjpa  
> of the
> missing class. So the problem was quite easy to solve.

Thanks for the update. I'm glad things are working for you. However,  
would prefer that we find a better solution in the future. We  
shouldn't be requiring the inclusion of the openjpa jar. Hopefully, we  
can find a better resolution in the future.

--kevan


Re: Is java.util.date not supported by remote interface??

Posted by rbaumhof <ra...@web.de>.
Thanks for your hints. The class is of course contained in the openjpa.jar
included in geronimo. I only included the openejb-client.jar - according to
the client example at the geronimo website.  And i did not closely look at
the error message and did not see the prefixing org.apache.openjpa of the
missing class. So the problem was quite easy to solve.



Kevan Miller wrote:
> 
> 
> On Aug 4, 2008, at 2:56 AM, David Blevins wrote:
> 
>> Totally thought I did that.  Thanks for the backup.
> 
> No problem. Was pretty sure that's what you meant to do...
> 
> --kevan
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-java.util.date-not-supported-by-remote-interface---tp18781027s134p18838463.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Is java.util.date not supported by remote interface??

Posted by Kevan Miller <ke...@gmail.com>.
On Aug 4, 2008, at 2:56 AM, David Blevins wrote:

> Totally thought I did that.  Thanks for the backup.

No problem. Was pretty sure that's what you meant to do...

--kevan


Re: Is java.util.date not supported by remote interface??

Posted by David Blevins <da...@visi.com>.
Totally thought I did that.  Thanks for the backup.

-David

On Aug 3, 2008, at 7:58 PM, Kevan Miller wrote:

> Cross-posting to OpenJPA list... Hopefully, they'll have some  
> insight...
>
> --kevan
>
>
>
> On Aug 1, 2008, at 6:05 PM, David Blevins wrote:
>
>>
>> On Aug 1, 2008, at 12:18 PM, rbaumhof wrote:
>>
>>>
>>> Hello at Geronimo,
>>>
>>> i have a fine working geronimo web application. All calls from  
>>> tomcat are
>>> passed to the ejb container by local interfaces. Now i want to  
>>> create for
>>> special users a second java swing application. This of course  
>>> works with
>>> remote interfaces. Most calls towards the new remote interfaces  
>>> (which are
>>> identical to the local interfaces) are working, but some of them  
>>> don't work
>>> because the data objects returned from the ejb container have  
>>> java.util.date
>>> properties. It seems that they can not be passed over the remote  
>>> interface.
>>>
>>> Error message:
>>> Exception on login:Unknown Container Exception:  
>>> java.rmi.RemoteException:
>>> Cannot read the response from the server.  The class for an object  
>>> being
>>> returned is not located in this system:; nested exception is:
>>> 	java.lang.ClassNotFoundException:
>>> org.apache.openjpa.util.java$util$Date$proxy
>>>
>>> If i omit the java.util.date objects the service call succeds. I am
>>> surprised that this simple data type is not supported by the remote
>>> interfaces. Can i do anything to make it work??
>>
>> Looks like OpenJPA is subclassing the java.util.Date class so  
>> what's passed is actually not the simple data type you're expecting  
>> but rather an instance of org.apache.openjpa.util.java$util$Date 
>> $proxy, whatever that is.  It looks like a dynamically generated  
>> class, which could be tricky.
>>
>> Anyone from the OpenJPA crowd know which jars might have to be  
>> included in the client classpath to deserialize a  
>> org.apache.openjpa.util.java$util$Date$proxy?
>>
>> Also, have you ever considered using a writeReplace method in the  
>> org.apache.openjpa.util.java$util$Date$proxy class so that it can  
>> be swapped out for a plain java.util.Date instance upon  
>> serialization?
>>
>> -David
>>
>
>


Re: Is java.util.date not supported by remote interface??

Posted by Kevan Miller <ke...@gmail.com>.
Cross-posting to OpenJPA list... Hopefully, they'll have some insight...

--kevan



On Aug 1, 2008, at 6:05 PM, David Blevins wrote:

>
> On Aug 1, 2008, at 12:18 PM, rbaumhof wrote:
>
>>
>> Hello at Geronimo,
>>
>> i have a fine working geronimo web application. All calls from  
>> tomcat are
>> passed to the ejb container by local interfaces. Now i want to  
>> create for
>> special users a second java swing application. This of course works  
>> with
>> remote interfaces. Most calls towards the new remote interfaces  
>> (which are
>> identical to the local interfaces) are working, but some of them  
>> don't work
>> because the data objects returned from the ejb container have  
>> java.util.date
>> properties. It seems that they can not be passed over the remote  
>> interface.
>>
>> Error message:
>> Exception on login:Unknown Container Exception:  
>> java.rmi.RemoteException:
>> Cannot read the response from the server.  The class for an object  
>> being
>> returned is not located in this system:; nested exception is:
>> 	java.lang.ClassNotFoundException:
>> org.apache.openjpa.util.java$util$Date$proxy
>>
>> If i omit the java.util.date objects the service call succeds. I am
>> surprised that this simple data type is not supported by the remote
>> interfaces. Can i do anything to make it work??
>
> Looks like OpenJPA is subclassing the java.util.Date class so what's  
> passed is actually not the simple data type you're expecting but  
> rather an instance of org.apache.openjpa.util.java$util$Date$proxy,  
> whatever that is.  It looks like a dynamically generated class,  
> which could be tricky.
>
> Anyone from the OpenJPA crowd know which jars might have to be  
> included in the client classpath to deserialize a  
> org.apache.openjpa.util.java$util$Date$proxy?
>
> Also, have you ever considered using a writeReplace method in the  
> org.apache.openjpa.util.java$util$Date$proxy class so that it can be  
> swapped out for a plain java.util.Date instance upon serialization?
>
> -David
>


Re: Is java.util.date not supported by remote interface??

Posted by Kevan Miller <ke...@gmail.com>.
Cross-posting to OpenJPA list... Hopefully, they'll have some insight...

--kevan



On Aug 1, 2008, at 6:05 PM, David Blevins wrote:

>
> On Aug 1, 2008, at 12:18 PM, rbaumhof wrote:
>
>>
>> Hello at Geronimo,
>>
>> i have a fine working geronimo web application. All calls from  
>> tomcat are
>> passed to the ejb container by local interfaces. Now i want to  
>> create for
>> special users a second java swing application. This of course works  
>> with
>> remote interfaces. Most calls towards the new remote interfaces  
>> (which are
>> identical to the local interfaces) are working, but some of them  
>> don't work
>> because the data objects returned from the ejb container have  
>> java.util.date
>> properties. It seems that they can not be passed over the remote  
>> interface.
>>
>> Error message:
>> Exception on login:Unknown Container Exception:  
>> java.rmi.RemoteException:
>> Cannot read the response from the server.  The class for an object  
>> being
>> returned is not located in this system:; nested exception is:
>> 	java.lang.ClassNotFoundException:
>> org.apache.openjpa.util.java$util$Date$proxy
>>
>> If i omit the java.util.date objects the service call succeds. I am
>> surprised that this simple data type is not supported by the remote
>> interfaces. Can i do anything to make it work??
>
> Looks like OpenJPA is subclassing the java.util.Date class so what's  
> passed is actually not the simple data type you're expecting but  
> rather an instance of org.apache.openjpa.util.java$util$Date$proxy,  
> whatever that is.  It looks like a dynamically generated class,  
> which could be tricky.
>
> Anyone from the OpenJPA crowd know which jars might have to be  
> included in the client classpath to deserialize a  
> org.apache.openjpa.util.java$util$Date$proxy?
>
> Also, have you ever considered using a writeReplace method in the  
> org.apache.openjpa.util.java$util$Date$proxy class so that it can be  
> swapped out for a plain java.util.Date instance upon serialization?
>
> -David
>


Re: Is java.util.date not supported by remote interface??

Posted by David Blevins <da...@visi.com>.
On Aug 1, 2008, at 12:18 PM, rbaumhof wrote:

>
> Hello at Geronimo,
>
> i have a fine working geronimo web application. All calls from  
> tomcat are
> passed to the ejb container by local interfaces. Now i want to  
> create for
> special users a second java swing application. This of course works  
> with
> remote interfaces. Most calls towards the new remote interfaces  
> (which are
> identical to the local interfaces) are working, but some of them  
> don't work
> because the data objects returned from the ejb container have  
> java.util.date
> properties. It seems that they can not be passed over the remote  
> interface.
>
> Error message:
> Exception on login:Unknown Container Exception:  
> java.rmi.RemoteException:
> Cannot read the response from the server.  The class for an object  
> being
> returned is not located in this system:; nested exception is:
> 	java.lang.ClassNotFoundException:
> org.apache.openjpa.util.java$util$Date$proxy
>
> If i omit the java.util.date objects the service call succeds. I am
> surprised that this simple data type is not supported by the remote
> interfaces. Can i do anything to make it work??

Looks like OpenJPA is subclassing the java.util.Date class so what's  
passed is actually not the simple data type you're expecting but  
rather an instance of org.apache.openjpa.util.java$util$Date$proxy,  
whatever that is.  It looks like a dynamically generated class, which  
could be tricky.

Anyone from the OpenJPA crowd know which jars might have to be  
included in the client classpath to deserialize a  
org.apache.openjpa.util.java$util$Date$proxy?

Also, have you ever considered using a writeReplace method in the  
org.apache.openjpa.util.java$util$Date$proxy class so that it can be  
swapped out for a plain java.util.Date instance upon serialization?

-David