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. Removing labels on the MapView

Hi,

I was wondering if anyone would know a way to remove labels on the
MapView?

The documentation displays the following statement about the
"satellite" mode:

"Sets the map mode to "satellite" mode, loading tiles of aerial
imagery with roads and names superimposed."

Would anyone know if it's possible to work around it (I don't think
sources are available to take a look at it) or maybe if they intend to
do it later.

I don't get why they wouldn't provide us the choice to do so with the
MapView since it's already possible with the "regular" Google Maps.

I would appreciate any information about it.

Regards,

Issa Fortin

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

2. Android Market rejecting icons

I have finished the first version of my app and I am trying to upload
it to the market.  But every time I select my apk file for upload, the
market upload website says: The icon for your application is not
valid. Please use a 48x48 PNG.  I have checked my image and resaved it
in gimp at various dpi.  I have rebuilt several times.  I keep
gettin the same error. what gives?  Is there a fix?

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

3. Exit SMS-app after sending SMS

4. finishing subactivity after some perticular time

5. Upgrading android Application

6. adb push wtf

7. Problem with multi select listview with default selected List Items.