Android application trying out rss feed read using Rome. Getting exception ExceptionInInitializerError

by MCON Dev » Sun, 12 Jul 2009 20:04:58 GMT


Sponsored Links
 Hello All,
I am trying to write some test code to receive RSS feeds. I am using the
ROME api's. But I am getting a exception when executing the following line
of code
  SyndFeed feed = new SyndFeedInput().build(reader);
I googled this exception and found the following. I dont know if thats
helpful or not. Please advice me on my next steps.
"Ok, I figured it out after traversing through the Rome code.
ClassLoader isn't supported by Android's DalvikVM. Is there an
implementation of this project that doesn't use ClassLoader?"
*Exception Stack*
Thread [<3> main] (Suspended (exception ExceptionInInitializerError))
 SyndFeedInput.build(Reader) line: 123
 MainActivity.onCreate(Bundle) line: 42
 Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1123
 ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord) line:
2231
 ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord) line:
2284
 ActivityThread.access$1800(ActivityThread, ActivityThread$ActivityRecord)
line: 112
 ActivityThread$H.handleMessage(Message) line: 1692
 ActivityThread$H(Handler).dispatchMessage(Message) line: 99
 Looper.loop() line: 123
 ActivityThread.main(String[]) line: 3948
 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean)
line: not available [native method]
 Method.invoke(Object, Object...) line: 521
 ZygoteInit$MethodAndArgsCaller.run() line: 782
 ZygoteInit.main(String[]) line: 540
 NativeStart.main(String[]) line: not available [native method]


*Code*

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

import android.app.Activity;
import android.os.Bundle;
import com.sun.syndication.*;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;

public class MainActivity extends Activity
{
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  URL url;
  try
  {
  url = new URL(" http://viralpatel.net/blogs/feed" ;);
  }
  catch (MalformedURLException e1)
  {
  // TODO Auto-generated catch block
  e1.printStackTrace();
  return ;
  }
  XmlReader reader = null;

  try
  {
  reader = new XmlReader(url);
  SyndFeed feed = new SyndFeedInput().build(reader);
  System.out.println("Feed Title: "+ feed.getAuthor());
  for (Iterator i = feed.getEntries().iterator(); i.hasNext();)
  {
  SyndEntry entry = (SyndEntry) i.next();
  System.out.println(entry.getTitle());
  }
  }
  catch (IllegalArgumentException e)
  {
  e.printStackTrace();
  }
  catch (FeedException e)
  {
  e.printStackTrace() ;
  }
  catch (IOException e)
  {
  // TODO Auto-generated catch block
  e.printStackTrace();
  }
  /*finally
  {
  if (reader != null)
  try
  {
  reader.close();
  } catch (IOException e)
  {
  // TODO Auto-generated catch block
  e.printStackTrace();
  }
  } */
  }
}

--~--~---------~--~----~------------~-------~--~----~



Android application trying out rss feed read using Rome. Getting exception ExceptionInInitializerError

by android_dev » Thu, 30 Jul 2009 01:26:47 GMT


 i,

I'm having the same error when using ROME api on Android. Were you
able to figure out the issue? Please let me know the details if
resolved.

-Thanks.

On Jul 12, 5:04am, MCON Dev <mcon...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Android application trying out rss feed read using Rome. Getting exception ExceptionInInitializerError

by Tomas » Fri, 31 Jul 2009 02:57:46 GMT


 've been digging into this, as I was hoping to use ROME for a project
on Android. So far I've had little luck.

The problem lies in ROME's use of the java.beans package, which is
part of the dependencies mentioned on
http://wiki.java.net/bin/view/Javawsxml/Rome
(in particular the point "J2SE 1.4+"). If you go to Ed Burnette's blog
you can find a listing of what IS and ISN'T in the Android runtime
(http://blogs.zdnet.com/Burnette/?p=504) and on the no-go list you
find java.beans.

I've been digging through the ROME source-code to see if the
java.beans packages usage was something easily removed, but it seems
quite central to how ROME works. I am still digging, and if I find a
way I will release a fork of ROME without java.beans usage for Android
use (but don't hold your breath, it might be a while).

For now I suggest you have a look at other RSS libraries in Java. I'm
a bit new to RSS's so I don't know any off the top of my head - a
google tells me that Informa (http://informa.sourceforge.net/) and
the apache commons feedparser (http://commons.apache.org/sandbox/
feedparser/) might be alternatives. These may have similar problems, I
just don't know yet.

I hope this helps!
-Tomas Ekeli

On Jul 29, 5:14am, android_dev <getvi...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~



Android application trying out rss feed read using Rome. Getting exception ExceptionInInitializerError

by Tomas » Fri, 31 Jul 2009 02:57:57 GMT


 've been digging into this, as I was hoping to use ROME for a project
on Android. So far I've had little luck.

The problem lies in ROME's use of the java.beans package, which is
part of the dependencies mentioned on
http://wiki.java.net/bin/view/Javawsxml/Rome
(in particular the point "J2SE 1.4+"). If you go to Ed Burnette's blog
you can find a listing of what IS and ISN'T in the Android runtime
(http://blogs.zdnet.com/Burnette/?p=504) and on the no-go list you
find java.beans.

I've been digging through the ROME source-code to see if the
java.beans packages usage was something easily removed, but it seems
quite central to how ROME works. I am still digging, and if I find a
way I will release a fork of ROME without java.beans usage for Android
use (but don't hold your breath, it might be a while).

For now I suggest you have a look at other RSS libraries in Java. I'm
a bit new to RSS's so I don't know any off the top of my head - a
google tells me that Informa (http://informa.sourceforge.net/) and
the apache commons feedparser (http://commons.apache.org/sandbox/
feedparser/) might be alternatives. These may have similar problems, I
just don't know yet.

I hope this helps!

On Jul 29, 5:14am, android_dev <getvi...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~



Android application trying out rss feed read using Rome. Getting exception ExceptionInInitializerError

by Tomas » Fri, 31 Jul 2009 02:57:57 GMT


 've been digging into this, and the problem seems to stem from the
fact that ROME uses the java.beans package, which is not included in
the Android runtime.

The java.beans package is central to how ROME works, and not easily
removed. It seems ROME is not coming to Android in the short term.

On Jul 29, 5:14am, android_dev <getvi...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Why this http url could not be played,but the video that is downloaded could be played?

urla  rel="nofollow" href="http://61.135.181.186/wwwdl/outPutFileName.mp4">http://61.135.181.186/wwwdl/outPutFileName.mp4
I use the mediaplayer to play this url.
It shows that this streaming is not supported.
But when I download the video,it plays okCould somebody give me an explaination why this could be happened?

--~--~---------~--~----~------------~-------~--~----~

2. stable branch

Hello,
I would like to know if a stable android branch exists. I've tried to
compile master branch, but it does not work for me! It loops on the
android shining logo... I'm working on a rooted g1 and I've extracted
propretary files from a 1.6 image from htc.
I've also tried cupcake branch, with proprietary files from htc 1.5
images, but when I try to compile it, I got stuck on some opencore
libraries missing in the prelink map. I tried to add manually the
libraries in the map file, and the make process ended fine, but the
system does not even boot. It remains on the g1 logo. Is there a way
to fix opencore issue with some patches?
I need a stable version working on the dream phone.

Thanks

Valerio
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. listview disable items

4. error creating avd with --force

5. Adding Undo feature in FingerPaint app bundled with APIdemos.

6. How to create a Icon on Home screen through Activity

7. How to create a Icon on Home screen through Activity