eagle0445 / hessdroid Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/hessdroid
Automatically exported from code.google.com/p/hessdroid
Hessian service on the server returns a list of Nodes. The Node class is
implemented exactly on the client side. When I make the remote call, the
function returns a list of HashMap instead of a list of Nodes. It is wierd
though there is no exception when the output is cast to ArrayList<Node> but the
problem arises when I try to iterate through the list, then I get class cast
exception.
What steps will reproduce the problem?
1. On the server side create a function that will return a list
(ArrayList<Node>) of some object, say Node
2. On the client side do the remote call and try to access the ArrayList content
3. You get class cast exception
What is the expected output? What do you see instead?
We should see no exception, a runtime exception is thrown root cause being the
class cast exception.
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 19 Oct 2011 at 1:08
What steps will reproduce the problem?
1. GAE Hessian 4.07
2. On android side
HessianProxyFactory proxyFactory = new HessianProxyFactory();
a) working
proxyFactory.setDebug(true); //!!!!
proxyFactory.setHessian2Reply(false); //!!!
b) not working
proxyFactory.setDebug(false); //!!!! or
proxyFactory.setHessian2Reply(true); //!!!
3. What is not working?
ICar api = (ICar) proxyFactory.create(ICar.class, webServiceUrl,
getClassLoader());
dan = api.dan(); //works in first attempt (also with setDebug(false)
dan = api.dan(); //second try no response (server is sending response)
dan = api.dan(); ....
What version of the product are you using? On what operating system?
Last from svn!
Original issue reported on code.google.com by [email protected]
on 13 Aug 2010 at 6:47
Hello
ActivityManager gives a warning:
"Launch timeout has expired, giving up wake lock!" after call 1
Later a exception :
"Caused by: com.caucho.hessian.client.HessianConnectionException: -1: "
is thrown
...
proxyFactory.setHessian2Reply(false);
api = (BasicAPI) proxyFactory.create(BasicAPI.class, webServiceUrl,
getClassLoader());
System.out.println(api.saySomething()); // call 1
System.out.println(api.saySomething()); // call 2
...
saySomething() returns a random number from the server
call 1 works fine and returns a random number as expected
call 2 was expected to do the same but hangs for a few seconds and throws
the exception mentioned above
i am running the above code in eclipse with android plugin
How should i reuse the same interface(api from code above), so that i can
recall the web service a few more time.
Since now it is only working only once during a execution.
Note: the string returned for the call 2 is seen in the LogCat though
mangled as "r�À�SÀ��Random String 14351 From serverz"
which was expected as "Random String 14351 From server" in System Out.
i appreciate your any help in this issue.
thank you and regards
-robin
Original issue reported on code.google.com by [email protected]
on 1 Sep 2009 at 7:56
The scenario is:
If the server is down, for example. The client app wants to connect to the
server to get data.
Hopefully, the client side should know exceptions happen. However, the app gets
stuck. No response at all.
Any ideas???
Many thanks.
Original issue reported on code.google.com by [email protected]
on 5 Jul 2013 at 10:20
What steps will reproduce the problem?
1. We are using hessdroid library for android client.
2. When the server sends an object of java.util.Locale then hessdroid
library throws the following exception:
com.caucho.hessian.io.HessianFieldException:
com.<custom data type having locale as field>.locale:
com.caucho.hessian.io.LocaleHandle
(com.caucho.hessian.io.LocaleHandle@437aaa60) cannot be assigned to
'java.util.Locale'
3. While debugging we found inside method
com.caucho.hessian.io.JavaDeserializer.ObjectFieldDeserializer.deserialize()
that the statement
field.set(obj, value);
throws the exception while setting the Locale field type.
4. We tried to fix this. We changed the access modifier of
com.caucho.hessian.io.LocaleHandle.readResolve() method from private to
public. This resolved the problem.
What is the expected output? What do you see instead?
The Locale object should be properly resolved.
What version of the product are you using? On what operating system?
Checked out source code on April 8, 2010. We are working on Windows XP SP3.
Please provide any additional information below.
Could you please confirm if the fix is appropriate and when can we expect
the new library release?
Thanks
Raju Mahore
Original issue reported on code.google.com by rajumahore
on 21 Apr 2010 at 12:40
What steps will reproduce the problem?
1. write code as example
2. use emulator below api 8 to test the application
3. throw exception(where BC is a remote interface):
08-11 22:42:49.941: ERROR/AndroidRuntime(323): Caused by:
java.lang.IllegalArgumentException: android.engine.BC is not visible from class
loader
08-11 22:42:49.941: ERROR/AndroidRuntime(323): at
java.lang.reflect.Proxy.getProxyClass(Proxy.java:120)
08-11 22:42:49.941: ERROR/AndroidRuntime(323): at
java.lang.reflect.Proxy.newProxyInstance(Proxy.java:230)
08-11 22:42:49.941: ERROR/AndroidRuntime(323): at
com.caucho.hessian.client.HessianProxyFactory.create(HessianProxyFactory.java:34
6)
08-11 22:42:49.941: ERROR/AndroidRuntime(323): at
com.caucho.hessian.client.HessianProxyFactory.create(HessianProxyFactory.java:32
0)
What is the expected output? What do you see instead?
app runs smoothly in froyo
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 11 Aug 2011 at 2:52
JavaSerializer is the default serializer for custom classes. instead of
creating new serializer instances
for every class, the serializers could be rewritten to be thread-safe
singletons.
Original issue reported on code.google.com by andre.steingress
on 10 Aug 2009 at 11:18
JavaSerializer throws the following np when date property is null:
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): java.lang.NullPointerException
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.io.JavaSerializer$DateFieldSerializer.serialize(JavaSerialize
r.java:430)
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.io.JavaSerializer.writeObject10(JavaSerializer.java:241)
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:221)
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.io.HessianOutput.writeObject(HessianOutput.java:317)
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.io.HessianOutput.call(HessianOutput.java:131)
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.client.HessianProxy.sendRequest(HessianProxy.java:307)
08-06 21:41:22.008: ERROR/AndroidRuntime(1111): at
com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:160)
This is bug is due to Date.getTime() is called without checking whether value
is null or not.
Original issue reported on code.google.com by andre.steingress
on 6 Aug 2009 at 7:54
What steps will reproduce the problem?
1. GAE Hessian 4.07
2. On android side
HessianProxyFactory proxyFactory = new HessianProxyFactory();
a) working
proxyFactory.setDebug(true); //!!!!
proxyFactory.setHessian2Reply(false); //!!!
b) not working
proxyFactory.setDebug(false); //!!!! or
proxyFactory.setHessian2Reply(true); //!!!
3. What is not working?
ICar api = (ICar) proxyFactory.create(ICar.class, webServiceUrl,
getClassLoader());
dan = api.dan(); //works in first attempt (also with setDebug(false)
dan = api.dan(); //second try no response (server is sending response)
dan = api.dan(); ....
What version of the product are you using? On what operating system?
Last from svn!
Original issue reported on code.google.com by [email protected]
on 13 Aug 2010 at 6:47
What steps will reproduce the problem?
1. Using Hessdroid as client to Hessian service.
2. Created HessianProxyFactory factory = new HessianProxyFactory();
3. trying to get the service using: factory.create(MyService.class,
"http://localhost:9080/myservice",getApplicationContext().getClassLoader());
What is the expected output? What do you see instead?
I got the exception below.
Error:java.net.SocketException: socket failed: EACCES (Permission denied)
What version of the product are you using? On what operating system?
Android AVD 4.0.3
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 27 Jun 2012 at 5:52
If I call a method on the client that does not expect on the server, I
think it is perfectly reasonble for that to throw some kind of
exception. But I think it ought to be a clear exception that one
would expect to catch.
Here's what happens with rev 29:a1c0504b5811 if I call a method
(updatePushNotificationInfo) that does not exist on the server:
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.updatePushNotificationInfo(Native Method)
... 3 more
Caused by: com.caucho.hessian.io.HessianServiceException: The service has no method named: updatePushNotificationInfo
at com.caucho.hessian.io.Hessian2Input.prepareFault(Unknown Source)
at com.caucho.hessian.io.Hessian2Input.startReply(Unknown Source)
at com.caucho.hessian.client.HessianProxy.invoke(Unknown Source)
at $Proxy0.updatePushNotificationInfo(Native Method)
... 3 more
I would think that a HessianServiceException would be a reasonable
thing to throw. I'm not entirely sure why (I'm not the familiar with
reflection), but as far as I can tell, I always get a
java.lang.reflect.UndeclaredThrowableException if I throw any kind of
declared exception. This is despite the fact that
HessianProxy.invoke() declares that it throws Throwable, and almost
every call to invoke() that I can find within the hessdroid library
declares that it throws IOException, except for the call in
JavaDeserializer.resolve() that declares that it throws Exception.
So it appears to me that my only recourse is to throw an undeclared
exception. See the attached patch. In HessianProxy.invoke() I'm
catching the HessianServiceException and re-throwing it as a
HessianRuntimeException. With this, I can now detect this situation
cleanly in my code by catching HessianRuntimeException, which seems to
me to be far better than UndeclaredThrowableException:
com.caucho.hessian.client.HessianRuntimeException: com.caucho.hessian.io.HessianServiceException: The service has no method named: updatePushNotificationInfo
at com.caucho.hessian.client.HessianProxy.invoke(Unknown Source)
at $Proxy0.updatePushNotificationInfo(Native Method)
... 3 more
Caused by: com.caucho.hessian.io.HessianServiceException: The service has no method named: updatePushNotificationInfo
at com.caucho.hessian.io.Hessian2Input.prepareFault(Unknown Source)
at com.caucho.hessian.io.Hessian2Input.startReply(Unknown Source)
at com.caucho.hessian.client.HessianProxy.invoke(Unknown Source)
at $Proxy0.updatePushNotificationInfo(Native Method)
... 3 more
Any thoughts? Is there any way to throw a non-RuntimeException in
this case? Are there any other unintended consequences of doing this
(like other cases for HessianServiceException where this might not be
appropriate?)
This is compiled on OSX 10.6.8 and running on Android 2.3.5, but I
doubt any of that matters.
Original issue reported on code.google.com by [email protected]
on 13 Jan 2012 at 8:24
Attachments:
What steps will reproduce the problem?
It works immediatly after starting the app, but when I wait a minute and let
the app call a network function again (e.g. logout()) I get this error message:
What is the expected output? What do you see instead?
com.caucho.hessian.client.HessianConnectionException: 500: java.io.EOFException
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:197)
at $Proxy1.getPassword(Native Method)
at tsch.serviceApp.net.DataHandler.getPassword(DataHandler.java:50)
at tsch.serviceApp.PageSystemApps$1$1.run(PageSystemApps.java:91)
Caused by: java.io.EOFException
at libcore.io.Streams.readAsciiLine(Streams.java:203)
at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:167)
What version of the product are you using? On what operating system?
newest?
Original issue reported on code.google.com by [email protected]
on 30 Apr 2013 at 2:11
my object is complex Object,include Map class.
in my project ,using ObjectInputStream is more faster than HessianInput.
Original issue reported on code.google.com by [email protected]
on 18 Jun 2012 at 6:30
There exists a method
com.caucho.hessian.client.HessianProxyFactory.setReadTimeout(long
timeout) which allows one to set the socket timeout on requests in
milliseconds. This is ultimately used to call
java.net.URLConnection.setReadTimeout(int) in
com.caucho.hessian.client.HessianProxyFactory.openConnection(java.net.URL).
There is also a corresponding
com.caucho.hessian.client.HessianProxyFactory.getReadTimeout().
If you look at the android docs for java.net.URLConnection, in
addition to set/get methods for the read timeout:
http://developer.android.com/reference/java/net/URLConnection.html#setReadTimeout(int)
http://developer.android.com/reference/java/net/URLConnection.html#getReadTimeout()
There are set/get methods for the connect timeout:
http://developer.android.com/reference/java/net/URLConnection.html#setConnectTimeout(int)
http://developer.android.com/reference/java/net/URLConnection.html#getConnectTimeout()
If you look at the javadoc for the current version (4.0.7) of the
server side Java implementation of Hessian, all 4 of these methods are
supported:
http://www.caucho.com/resin-4.0-javadoc/com/caucho/hessian/client/HessianProxyFactory.html#setReadTimeout(long)
http://www.caucho.com/resin-4.0-javadoc/com/caucho/hessian/client/HessianProxyFactory.html#getReadTimeout()
http://www.caucho.com/resin-4.0-javadoc/com/caucho/hessian/client/HessianProxyFactory.html#setConnectTimeout(long)
http://www.caucho.com/resin-4.0-javadoc/com/caucho/hessian/client/HessianProxyFactory.html#getConnectTimeout()
This appears to be present in hessian 4.0.3:
http://caucho.com/download/hessian-4.0.3-src.jar
but not in hessian 4.0.1:
http://caucho.com/download/hessian-4.0.1-src.jar
(There does not appear to exist a hessian 4.0.2, at least not at
http://hessian.caucho.com/#Java)
But hessdroid (as of rev 29:a1c0504b5811) only supports the read
timeout, and not the connect timeout.
My suggestion is to add support for the connect timeout. A patch is
attached.
Original issue reported on code.google.com by [email protected]
on 16 Jan 2012 at 10:02
Attachments:
What steps will reproduce the problem?
1. Server site
1.1 Create TestAPI.java interface
[Source code]
---------------
public interface TestAPI {
public String getMessage(String name);
}
---------------
1.2. Create TestAPIImpl.java implement TestAPI interface
[Source code]
---------------
public class TestAPIImpl extends HessianServlet implements TestAPI {
public String getMessage(String name) {
return "Hello, " + name;
}
}
---------------
2. Android Client site
[Source code]
---------------
String webServiceUrl = "http://10.0.2.2:8080/Sample/servlet/TestAPI";
HessianProxyFactory proxyFactory = new HessianProxyFactory();
TestAPI api = (TestAPI) proxyFactory.create(TestAPI.class,
webServiceUrl, getClassLoader());
Log.d("AAAAAA", api.getMessage("DungNT3"));
---------------
3. Start Android application normal with Galaxy Tab virtual device
What is the expected output? What do you see instead?
==>
Run and finish normal. But it throw below exception
---------------
03-23 22:14:14.236: ERROR/AndroidRuntime(400): H���R�Hello, DungNT3
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.os.Handler.dispatchMessage(Handler.java:99)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.os.Looper.loop(Looper.java:123)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.ActivityThread.main(ActivityThread.java:4627)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
java.lang.reflect.Method.invokeNative(Native Method)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
java.lang.reflect.Method.invoke(Method.java:521)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
dalvik.system.NativeStart.main(Native Method)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): Caused by:
com.caucho.hessian.client.HessianRuntimeException:
com.caucho.hessian.io.HessianProtocolException: expected hessian reply at 0x48
(H)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): H���R�Hello, DungNT3
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:235)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at $Proxy0.getMessage(Native
Method)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
vn.co.sample.HelloActivity.initData(HelloActivity.java:43)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
vn.co.sample.HelloActivity.onCreate(HelloActivity.java:25)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): ... 11 more
03-23 22:14:14.236: ERROR/AndroidRuntime(400): Caused by:
com.caucho.hessian.io.HessianProtocolException: expected hessian reply at 0x48
(H)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): H���R�Hello, DungNT3
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2705)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
com.caucho.hessian.io.Hessian2Input.startReply(Hessian2Input.java:402)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): at
com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:221)
03-23 22:14:14.236: ERROR/AndroidRuntime(400): ... 16 more
---------------
What version of the product are you using? On what operating system?
==> Server: Hessian 4.0.7
Client: Lastest version from server (2011/03/23)
Android 2.2 (API 8)
Target platform: Galaxy Tab
Please provide any additional information below.
==>
I created java application to test this server code and it run well.
Original issue reported on code.google.com by nguyen.trong.dung830323
on 24 Mar 2011 at 12:38
You should provide a pre-compiled binary jar so that people can easily try this
out. I'm attaching the one I built to help other users.
Original issue reported on code.google.com by [email protected]
on 22 Aug 2011 at 4:56
Attachments:
The org.ast.tests.base.AbstractSkeleton import in the HessianProxy class
can not be resolved inside my Android project.
I checked out a version of the project a few days ago; am I missing something?
Regards,
Robert
Original issue reported on code.google.com by [email protected]
on 25 Aug 2009 at 1:22
Please help me!My English is very poor :(
——————————————————————
server hessian version:hessian-3.0.20.jar
——————————————————————
Common Code:
public class TestVO implements Serializable {
public int Id;
public String Title;
public String Content;
}
public interface BasicAPI {
public TestVO TestObjectEx();
}
——————————————————————
My Java Server(Tomcat) Servlet Code:
public class BasicService extends HessianServlet implements BasicAPI {
@Override
public TestVO TestObjectEx() {
System.out.println("TestObjectEx Return TestVO");//is ok
TestVO vo = new TestVO();
vo.Id = 1;
vo.Title = "title";
vo.Content = "Content";
return vo;
}
}
——————————————————————
My Android Client:
String url = "http://192.168.1.110:8080/HessianServer/hello.do";
HessianProxyFactory factory = new HessianProxyFactory();
BasicAPI basic = (BasicAPI)factory.create(BasicAPI.class, url,getClassLoader());
TestVO vo = basic.TestObjectEx(vo); //here error
——————————————————————
test client transfer TestVO to server is ok!but server transfer TestVO to
client is error! my email:[email protected]
Thank you very much!
Original issue reported on code.google.com by [email protected]
on 4 Aug 2010 at 4:13
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.