[TENEO] EMF and Serializable [message #635277] |
Tue, 26 October 2010 05:12  |
Eclipse User |
|
|
|
Hi,
how can i serializable a EClassImpl ? I have problems with the remoting because the EClassImpl is not serializable.
Caused by: java.io.NotSerializableException: org.eclipse.emf.ecore.impl.EClassImpl
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.doWriteRemoteInvocation(AbstractHttpInvokerRequestExecutor.java:199)
at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.writeRemoteInvocation(AbstractHttpInvokerRequestExecutor.java:167)
at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.getByteArrayOutputStream(AbstractHttpInvokerRequestExecutor.java:147)
at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:131)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:192)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:174)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:142)
... 30 more
Thanks
[Updated on: Wed, 27 October 2010 07:26] by Moderator
|
|
|
|
|
|
|
Re: EMF and Serializable [message #635664 is a reply to message #635508] |
Wed, 27 October 2010 12:26  |
Eclipse User |
|
|
|
Hi,
I don't know much of your setup but it seems that the exception is thrown on the client when de-serializing correct?
Teneo replaces standard EMF ELists to give them extra persistence behavior, it seems that the Teneo EclipseLink classes
are not present on the client somehow. (but maybe I don't understand the exception or setup....).
gr. Martrin
On 10/27/2010 09:22 AM, SirWayne wrote:
> Thanks for the answer:
>
> But I don't understand the solution:
>
> The model
>
> public abstract class DBObjectImpl extends EObjectImpl implements
> DBObject, java.io.Serializable {
>
>
> The code on the Server side
>
>
> public <T extends DBObject> List<T> findAll(EClass entityClass, Class<T>
> returnClass){
> // create query...
>
> List<T> list = query.getResultList();
> logger.info(list.toString());
> return list;
> }
>
> public <T extends DBObject> T saveOrUpdate(T entity) {
> logger.info("Save Entity" + entity);
> return entityManager.merge(entity);
>
> }
>
>
> The saveOrUpdate methode works fine. But the findAll throws the
> Exception and how can I solve it with Resources?
>
> My second Problem and my second try was to change the findAll methode:
>
>
>
> public <T extends DBObject> List<T> findAll(EClass entityClass, Class<T>
> returnClass){
> // create query...
>
> List<T> list = query.getResultList();
> return new ArrayList(list);
> }
>
>
> Exception on client side
>
> org.springframework.remoting.RemoteAccessException: Could not
> deserialize result from HTTP invoker remote service
> [http://localhost:8080/web/remoting/BaseService]; nested exception is
> java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.eclipselink.elist.IndirectEList not found from
> bundle [emf-rcp]
> at
> org.springframework.remoting.httpinvoker.HttpInvokerClientIn terceptor.convertHttpInvokerAccessException(HttpInvokerClien tInterceptor.java:208)
>
> at
> org.springframework.remoting.httpinvoker.HttpInvokerClientIn terceptor.invoke(HttpInvokerClientInterceptor.java:145)
>
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvocation.java:172)
>
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke( JdkDynamicAopProxy.java:202)
>
> at $Proxy5.findAll(Unknown Source)
> at handler.View$4.widgetSelected(View.java:151)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:234)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at emfrcp.Application.start(Application.java:20)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>
>
> Is this a spring problem? Don't understand why the ArrayList will mapped
> to a org.eclipse.emf.teneo.eclipselink.elist.IndirectEList?
>
> On the client Side I want wo work with a ArrayList not with a teneo List...
>
> Do anybody find a mistake?
>
> Thank
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.09457 seconds