[android-developers] Re: Unserializing objects via the Hessian web protocol leads to ClassNotFoundException

2010-09-04 Thread Kevin Read

On Aug 26, 6:10 pm, Kostya Vasilyev kmans...@gmail.com wrote:
   26.08.2010 14:24, Kevin Read ?: I'll try to shoehorn the PHP class 
 names into the fully qualified Java
  class name. The issue here is that the web service is also used by the
  iPhone client, where the deserialization is completely custom-built,
  so I'll have to tread lightly*sighs*

 I think it's easier to fix it on the client (Android) side.

 Put all Hessian-izable objects in one package, and make a change in the
 piece of code you posted earlier to always add the package name.

 No changes to the PHP side - no worries about breaking the iPhone client.

Thanks Kostya, this is indeed the best approach and works very well.

Best regards,

Kevin

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Unserializing objects via the Hessian web protocol leads to ClassNotFoundException

2010-08-26 Thread Kevin Read


On Aug 25, 6:19 pm, DanH danhi...@ieee.org wrote:
 You can never load a class without its package name.

 The message is saying that a class in the null package named
 NewsSetCategory cannot be found.  Since classes in the null package
 are characteristic of toy applications, NewsSetCategory is probably
 a toy application on the source platform and is missing on the
 phone.

Well, the objects are created and serialized by a PHP script, so toy
is a fairly accurate description ;)
I'll try to shoehorn the PHP class names into the fully qualified Java
class name. The issue here is that the web service is also used by the
iPhone client, where the deserialization is completely custom-built,
so I'll have to tread lightly *sighs*

Thanks for the answers.

Regards,

Kevin


 On Aug 24, 3:39 pm, kr...@boerse-go.de obsidia...@googlemail.com
 wrote:



  Hi all,

  I am using the Hessian web protocol[1] or rather more the Android port
  Hessdroid[2] to fetch and unserialize objects from a web server. It
  works quite well but unfortunately I get this message:

  W/SerializerFactory( 1071): Hessian/Burlap: 'NewsSetCategory' is an
  unknown class in dalvik.system.pathclassloa...@43227dd0:
  W/SerializerFactory( 1071): java.lang.ClassNotFoundException:
  NewsSetCategory

  when actually unserializing an object. The code within the library
  that throws the warning is:

        try {
          Class cl = Class.forName(type, false,
  getClass().getClassLoader());
          deserializer = getDeserializer(cl);
        } catch (Exception e) {
          log.warning(Hessian/Burlap: ' + type + ' is an unknown
  class in  + getClass().getClassLoader() + :\n + e);

          log.log(Level.FINER, e.toString(), e);
        }

  I guess the problem is that the class NewsSetCategory resides in a
  package and so cannot be loaded without the whole package name by the
  ClassLoader but this is a bling guess.

  Is there a way to adapt the class path or to easily create a new
  PathClassLoader that will load classes directly from the package? Or
  does anybody else have any experience with Hessian on Android?

  Thanks a lot,

  Kevin

  [1]http://hessian.caucho.com/
  [2]http://code.google.com/p/hessdroid/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Unserializing objects via the Hessian web protocol leads to ClassNotFoundException

2010-08-26 Thread Kostya Vasilyev

 26.08.2010 14:24, Kevin Read ?:

I'll try to shoehorn the PHP class names into the fully qualified Java
class name. The issue here is that the web service is also used by the
iPhone client, where the deserialization is completely custom-built,
so I'll have to tread lightly*sighs*

I think it's easier to fix it on the client (Android) side.

Put all Hessian-izable objects in one package, and make a change in the 
piece of code you posted earlier to always add the package name.


No changes to the PHP side - no worries about breaking the iPhone client.

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Unserializing objects via the Hessian web protocol leads to ClassNotFoundException

2010-08-25 Thread DanH
You can never load a class without its package name.

The message is saying that a class in the null package named
NewsSetCategory cannot be found.  Since classes in the null package
are characteristic of toy applications, NewsSetCategory is probably
a toy application on the source platform and is missing on the
phone.

On Aug 24, 3:39 pm, kr...@boerse-go.de obsidia...@googlemail.com
wrote:
 Hi all,

 I am using the Hessian web protocol[1] or rather more the Android port
 Hessdroid[2] to fetch and unserialize objects from a web server. It
 works quite well but unfortunately I get this message:

 W/SerializerFactory( 1071): Hessian/Burlap: 'NewsSetCategory' is an
 unknown class in dalvik.system.pathclassloa...@43227dd0:
 W/SerializerFactory( 1071): java.lang.ClassNotFoundException:
 NewsSetCategory

 when actually unserializing an object. The code within the library
 that throws the warning is:

       try {
         Class cl = Class.forName(type, false,
 getClass().getClassLoader());
         deserializer = getDeserializer(cl);
       } catch (Exception e) {
         log.warning(Hessian/Burlap: ' + type + ' is an unknown
 class in  + getClass().getClassLoader() + :\n + e);

         log.log(Level.FINER, e.toString(), e);
       }

 I guess the problem is that the class NewsSetCategory resides in a
 package and so cannot be loaded without the whole package name by the
 ClassLoader but this is a bling guess.

 Is there a way to adapt the class path or to easily create a new
 PathClassLoader that will load classes directly from the package? Or
 does anybody else have any experience with Hessian on Android?

 Thanks a lot,

 Kevin

 [1]http://hessian.caucho.com/
 [2]http://code.google.com/p/hessdroid/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Unserializing objects via the Hessian web protocol leads to ClassNotFoundException

2010-08-24 Thread kr...@boerse-go.de
No, it is in a related project, as in Eclipse required projects on
the build path.

On Aug 24, 10:51 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Do you have this class defined in the Android application?

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 25.08.2010 0:39 пользователь kr...@boerse-go.de obsidia...@googlemail.com
 написал:


Regards,

Kevin

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Unserializing objects via the Hessian web protocol leads to ClassNotFoundException

2010-08-24 Thread Kostya Vasilyev
Um, what I really meant to say is, is this class available at runtime in the
application? Sounds like it's not, and that's causing the error.

You need to make sure this class is available for instantiation when the
server response is deserialized, under the same name as in the response.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

25.08.2010 0:58 пользователь kr...@boerse-go.de obsidia...@googlemail.com
написал:

No, it is in a related project, as in Eclipse required projects on
the build path.


On Aug 24, 10:51 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Do you have this class defined i...
 25.08.2010 0:39 пользователь kr...@boerse-go.de 
obsidia...@googlemail.com
 написал:


Regards,

Kevin

--

You received this message because you are subscribed to the Google
Groups Android Developers group...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en