resthub / spring-amqp-hessian Goto Github PK
View Code? Open in Web Editor NEWSpring RPC based on RabbitMQ and Hessian
License: Apache License 2.0
Spring RPC based on RabbitMQ and Hessian
License: Apache License 2.0
When there are 2 similar methods (same name & same parameter count), the amqp hessian proxy calls sometimes the wrong method.
ie:
@Override public List requestSimpleOr(String indexName, String documentType, String keyWords, Class expectedClass, Sort sort) { return faceted_requester.requestSimpleOr(indexName, documentType, keyWords, expectedClass, sort).getResults(); } @Override public Page requestSimpleOr(String indexName, String documentType, String keyWords, Class expectedClass, Pageable pageable) { return faceted_requester.requestSimpleOr(indexName, documentType, keyWords, expectedClass, pageable).getResults(); }
The only solution for now is to rename one of the two methods, to avoid method collision problems
Hi,
When we serialize an object whith lazy fields, we got some lazyInitialization exceptions
16:21:04 [SimpleAsyncTaskExecutor-1] ERROR o.r.rpc.RawMessageDelegate - Exception occurs during method call
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:186) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:137) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:242) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at com.caucho.hessian.io.CollectionSerializer.writeObject(CollectionSerializer.java:96) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:421) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.io.UnsafeSerializer$ObjectFieldSerializer.serialize(UnsafeSerializer.java:293) ~[hessian-4.0.7.jar:na]
Wrapped by: java.lang.RuntimeException: could not initialize proxy - no Session
field: fr.parcours4.auth.model.InternalUser.workPlaces
at com.caucho.hessian.io.UnsafeSerializer$ObjectFieldSerializer.serialize(UnsafeSerializer.java:295) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.io.UnsafeSerializer.writeInstance(UnsafeSerializer.java:212) ~[hessian-4.0.7.jar:na]
Wrapped by: java.lang.RuntimeException: could not initialize proxy - no Session
field: fr.parcours4.auth.model.InternalUser.workPlaces
class: fr.parcours4.auth.model.InternalUser (object=User[Id: 36, Login: login1, Email: [email protected]])
at com.caucho.hessian.io.UnsafeSerializer.writeInstance(UnsafeSerializer.java:215) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.io.UnsafeSerializer.writeObject(UnsafeSerializer.java:171) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:421) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.io.AbstractHessianOutput.writeReply(AbstractHessianOutput.java:558) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:323) ~[hessian-4.0.7.jar:na]
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:202) ~[hessian-4.0.7.jar:na]
at org.resthub.rpc.RawMessageDelegate.createResponseBody(RawMessageDelegate.java:162) ~[spring-amqp-hessian-1.0.1-SNAPSHOT.jar:na]
at org.resthub.rpc.RawMessageDelegate.handleMessage(RawMessageDelegate.java:116) ~[spring-amqp-hessian-1.0.1-SNAPSHOT.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
Jean-Sébastien
If we use this configuration:
<sec:global-method-security
pre-post-annotations="enabled" proxy-target-class="true">
<sec:expression-handler ref="expressionHandler" />
</sec:global-method-security>
the method findRemoteAPI return a bad name "springProxy" instead of "myInterface".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.