[sip-comm-dev] rss4sc: about ROME library...


#1

Indeed, I'm agree with Emil, using ROME could reduce the plugin's weight enormously...

But according to my previous work, the problem with ROME is very odd (perhaps I don't
do something correctly).
When I try to parse a feed with this library:

- directly from a simple prog, I need just to insert jdom.jar and rome-0.9.jar into classpath
  to compile, run and retrieve successfully a RSS flow. No problem.

- under SC (with Netbeans), with these 2 libraries, I can build the project, and launch SC, but
  when I make an attempt to retrieve a feed, I have the error:

  "Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
    org/xml/sax/EntityResolver"

  So I insert sax2.jar moreover, and then I get the error:

  "java.lang.IllegalStateException: JDOM could not create a SAX parser
        at com.sun.syndication.io.WireFeedInput.createSAXBuilder(WireFeedInput.java:303)
        at com.sun.syndication.io.WireFeedInput.build(WireFeedInput.java:173)
        at com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:122)
  ...
  ERROR: JDOM could not create a SAX parser
  ..."

I was unable to resolve this problem, so I chose to switch to INFORMA...

Any idea ?

Ciao.
J-A.

Hello Jean-Albert,

···

Emil Ivov <emcho@emcho.com> wrote:

I was actually looking at your implementation yesterday. You only seem to be accessing the RSS lib from RssFeedReaderInforma. I've also been looking at rome (rome.dev.java.net) and they seem to be around 300K (dependencies included).

I was therefore wondering whether it wouldn't be a better option to simply replace informa with rome. I remember you were looking at rome at one point and then decided to finally go for informa but I don't remember the reason. Was it something very important or maybe just a matter of personal preference? Do you think you could easily switch?

Cheers
Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hello Jean-Albert,

org.xml.sax is a package provided by the JRE and exported as one of the system packages defined in felix.client.run.properties. The exception you were getting was therefore most probably due to the fact that it was not included in the "Import-Package:" clause of your manifest file.

Can you try to include it and let me know if it works this way?

Emil

Jean-Albert Vescovo wrote:

···

Indeed, I'm agree with Emil, using ROME could reduce the plugin's weight enormously...

But according to my previous work, the problem with ROME is very odd (perhaps I don't
do something correctly).
When I try to parse a feed with this library:

- directly from a simple prog, I need just to insert jdom.jar and rome-0.9.jar into classpath
  to compile, run and retrieve successfully a RSS flow. No problem.

- under SC (with Netbeans), with these 2 libraries, I can build the project, and launch SC, but
  when I make an attempt to retrieve a feed, I have the error:

  "Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
    org/xml/sax/EntityResolver"

  So I insert sax2.jar moreover, and then I get the error:

  "java.lang.IllegalStateException: JDOM could not create a SAX parser
        at com.sun.syndication.io.WireFeedInput.createSAXBuilder(WireFeedInput.java:303)
        at com.sun.syndication.io.WireFeedInput.build(WireFeedInput.java:173)
        at com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:122)
  ...
  ERROR: JDOM could not create a SAX parser
  ..."

I was unable to resolve this problem, so I chose to switch to INFORMA...

Any idea ?

Ciao.
J-A.

Emil Ivov <emcho@emcho.com> wrote:

Hello Jean-Albert,

I was actually looking at your implementation yesterday. You only seem to be accessing the RSS lib from RssFeedReaderInforma. I've also been looking at rome (rome.dev.java.net) and they seem to be around 300K (dependencies included).

I was therefore wondering whether it wouldn't be a better option to simply replace informa with rome. I remember you were looking at rome at one point and then decided to finally go for informa but I don't remember the reason. Was it something very important or maybe just a matter of personal preference? Do you think you could easily switch?

Cheers
Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hello,

I've included "org.xml.sax" into the "Import-Package" clause of my rss.provider.manifest.mf file (without including sax2.jar
in build.xml), and now the error is:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/xml/sax/helpers/XMLReaderFactory

This class isn't included in this package ?
I still don't understand why it works perfectly outwards SC's project...

J.-A.

Emil Ivov wrote :

···

Hello Jean-Albert,

org.xml.sax is a package provided by the JRE and exported as one of the system packages defined in felix.client.run.properties. The exception you were getting was therefore most probably due to the fact that it was not included in the "Import-Package:" clause of your manifest file.

Can you try to include it and let me know if it works this way?

Emil


#4

Hello Jean-Albert,

(inline)

Jean-Albert Vescovo wrote:

Hello,

I've included "org.xml.sax" into the "Import-Package" clause of my rss.provider.manifest.mf file (without including sax2.jar
in build.xml), and now the error is:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/xml/sax/helpers/XMLReaderFactory

This class isn't included in this package ?

You'd then need to also add the helpers package to your manifets:

Import-Package: ...
org.xml.sax.helpers,
...

However, since the package is not currently enumerated among the system packages in felix.client.run.properties you'd also need to add it there:

org.osgi.framework.system.packages= org.osgi.framework; \
  javax.swing; \
  ...
  org.xml.sax; \
+ org.xml.sax.helpers; \
  javax.xml.parsers;\
  ...

I still don't understand why it works perfectly outwards SC's project...

Well that's the whole idea about OSGi. A bundle cannot ClassLoad a package unless it declares it in its imports clause and either someone else exports it or the package is among the system packages decalred (in the case of SIP Communicator) in felix.client.run.properties.

Don't hesitate to ask in case you have other questions.

Cheers
Emil

···

J.-A.

Emil Ivov wrote :

Hello Jean-Albert,

org.xml.sax is a package provided by the JRE and exported as one of the system packages defined in felix.client.run.properties. The exception you were getting was therefore most probably due to the fact that it was not included in the "Import-Package:" clause of your manifest file.

Can you try to include it and let me know if it works this way?

Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Ok, now it's work...I need just to include the rome.jar (just about 200Ko !!!) into the build.xml, because jdom is already in the JRE.
I've made more test with Informa, and it looks that this library definitively needs Xerces 1.4.4 to work (not into the JRE)...

I'm looking now to translate quickly the code for the ROME library...
Don't be impatient, because I've exams to study these next days !!!

J.-A.

Emil Ivov wrote:

···

Hello Jean-Albert,

(inline)

Jean-Albert Vescovo wrote:

Hello,

I've included "org.xml.sax" into the "Import-Package" clause of my rss.provider.manifest.mf file (without including sax2.jar
in build.xml), and now the error is:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/xml/sax/helpers/XMLReaderFactory

This class isn't included in this package ?

You'd then need to also add the helpers package to your manifets:

Import-Package: ...
org.xml.sax.helpers,
...

However, since the package is not currently enumerated among the system packages in felix.client.run.properties you'd also need to add it there:

org.osgi.framework.system.packages= org.osgi.framework; \
  javax.swing; \
  ...
  org.xml.sax; \
+ org.xml.sax.helpers; \
  javax.xml.parsers;\
  ...

I still don't understand why it works perfectly outwards SC's project...

Well that's the whole idea about OSGi. A bundle cannot ClassLoad a package unless it declares it in its imports clause and either someone else exports it or the package is among the system packages decalred (in the case of SIP Communicator) in felix.client.run.properties.

Don't hesitate to ask in case you have other questions.

Cheers
Emil


#6

Hello again Jean-Albert,

Jean-Albert Vescovo wrote:

Ok, now it's work...

Great news!

I need just to include the rome.jar (just about 200Ko !!!) into the build.xml, because jdom is already in the JRE.

Unfortunately, I don't think this is the case. JDOM is not in the JRE so you'd have to include it in the bundle ... If you say it worked in your tests then you probably had it somewhere on your classpath ... or maybe rome doesn't really depend on it and can also use the utilities provided in the JRE.

I've made more test with Informa, and it looks that this library definitively needs Xerces 1.4.4 to work (not into the JRE)...

I'm looking now to translate quickly the code for the ROME library...
Don't be impatient, because I've exams to study these next days !!!

OK. No problem! Good luck with your exams!

Emil

···

J.-A.

Emil Ivov wrote:

Hello Jean-Albert,

(inline)

Jean-Albert Vescovo wrote:

Hello,

I've included "org.xml.sax" into the "Import-Package" clause of my rss.provider.manifest.mf file (without including sax2.jar
in build.xml), and now the error is:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/xml/sax/helpers/XMLReaderFactory

This class isn't included in this package ?
You'd then need to also add the helpers package to your manifets:

Import-Package: ...
org.xml.sax.helpers,
...

However, since the package is not currently enumerated among the system packages in felix.client.run.properties you'd also need to add it there:

org.osgi.framework.system.packages= org.osgi.framework; \
  javax.swing; \
  ...
  org.xml.sax; \
+ org.xml.sax.helpers; \
  javax.xml.parsers;\
  ... I still don't understand why it works perfectly outwards SC's project...

Well that's the whole idea about OSGi. A bundle cannot ClassLoad a package unless it declares it in its imports clause and either someone else exports it or the package is among the system packages decalred (in the case of SIP Communicator) in felix.client.run.properties.

Don't hesitate to ask in case you have other questions.

Cheers
Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#7

In fact, just some minor modifications (it's better if you can try it and find bugs...), and you can find here the archive for rss4sc
containing the code and the instructions in order to install it...same things than for the Informa library, but lighter !
Download this archive into your main SC folder, extract it in this folder, modify some files (see modif.txt for this), that's all !

Bye,

Jean-Albert.

Emil Ivov wrote :

rss4sc_ROME.tar.gz (718 KB)

···

Hello again Jean-Albert,

Jean-Albert Vescovo wrote:

Ok, now it's work...

Great news!

I need just to include the rome.jar (just about 200Ko !!!) into the build.xml, because jdom is already in the JRE.

Unfortunately, I don't think this is the case. JDOM is not in the JRE so you'd have to include it in the bundle ... If you say it worked in your tests then you probably had it somewhere on your classpath ... or maybe rome doesn't really depend on it and can also use the utilities provided in the JRE.

I've made more test with Informa, and it looks that this library definitively needs Xerces 1.4.4 to work (not into the JRE)...

I'm looking now to translate quickly the code for the ROME library...
Don't be impatient, because I've exams to study these next days !!!

OK. No problem! Good luck with your exams!

Emil


#8

Hey, that was quick!

I'll test it in an hour or so and get back to you right after that!

Thanks Jean-Albert!

Emil

Jean-Albert Vescovo wrote:

···

In fact, just some minor modifications (it's better if you can try it and find bugs...), and you can find here the archive for rss4sc
containing the code and the instructions in order to install it...same things than for the Informa library, but lighter !
Download this archive into your main SC folder, extract it in this folder, modify some files (see modif.txt for this), that's all !

Bye,

Jean-Albert.

Emil Ivov wrote :

Hello again Jean-Albert,

Jean-Albert Vescovo wrote:

Ok, now it's work...

Great news!

I need just to include the rome.jar (just about 200Ko !!!) into the build.xml, because jdom is already in the JRE.

Unfortunately, I don't think this is the case. JDOM is not in the JRE so you'd have to include it in the bundle ... If you say it worked in your tests then you probably had it somewhere on your classpath ... or maybe rome doesn't really depend on it and can also use the utilities provided in the JRE.

I've made more test with Informa, and it looks that this library definitively needs Xerces 1.4.4 to work (not into the JRE)...

I'm looking now to translate quickly the code for the ROME library...
Don't be impatient, because I've exams to study these next days !!!

OK. No problem! Good luck with your exams!

Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#9

Hi Jean-Albert,

Just a little tip about the distribution you have provided. Please provide and properties with comments for accounts.properties.template - used for tests. Everything else seems ok.
I'm testing it now :slight_smile:

Cheers
damencho

Jean-Albert Vescovo wrote:

···

In fact, just some minor modifications (it's better if you can try it and find bugs...), and you can find here the archive for rss4sc
containing the code and the instructions in order to install it...same things than for the Informa library, but lighter !
Download this archive into your main SC folder, extract it in this folder, modify some files (see modif.txt for this), that's all !

Bye,

Jean-Albert.

Emil Ivov wrote :

Hello again Jean-Albert,

Jean-Albert Vescovo wrote:

Ok, now it's work...

Great news!

I need just to include the rome.jar (just about 200Ko !!!) into the build.xml, because jdom is already in the JRE.

Unfortunately, I don't think this is the case. JDOM is not in the JRE so you'd have to include it in the bundle ... If you say it worked in your tests then you probably had it somewhere on your classpath ... or maybe rome doesn't really depend on it and can also use the utilities provided in the JRE.

I've made more test with Informa, and it looks that this library definitively needs Xerces 1.4.4 to work (not into the JRE)...

I'm looking now to translate quickly the code for the ROME library...
Don't be impatient, because I've exams to study these next days !!!

OK. No problem! Good luck with your exams!

Emil

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#10

While testing RSS feature under MS Windows, I've found a bug with SC's message history (but perhaps it's not considered like a bug...): when you insert a contact with ":" in its address, Windows is not able to create the file/folder to save the history...
And under RSS, all contacts have an address' format like an URL with ":".
Obviously, no problem with Linux.

An idea to circumvent simply the problem ?

···

++
Jean-Albert.


#11

Hi,

I've just committed RSS protocol provider with some minor changes like : code formating, fix some javadoc conflicts
and in ContactRssImpl changed converting Dates to String and String to Dates - now using SimpleDateFormat.
Thats it for now :slight_smile: I've already started to use it. Great :slight_smile:

damencho

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#12

Hello Jean-Albert,

Nice catch! We'll definitely have to fix this in the message history.

I am wondering though, whether it wouldn't be a better idea to simply remove the "http://" from the address of RSS contacts.

But then again, we could still have colons if a port number is specified so we'd still have to take care of this at the history level.

Cheers
Emil

Jean-Albert Vescovo wrote:

···

While testing RSS feature under MS Windows, I've found a bug with SC's message history (but perhaps it's not considered like a bug...): when you insert a contact with ":" in its address, Windows is not able to create the file/folder to save the history...
And under RSS, all contacts have an address' format like an URL with ":".
Obviously, no problem with Linux.

An idea to circumvent simply the problem ?

++
Jean-Albert.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#13

Hi Jean-Albert,

Good catch :slight_smile: I fixed this and just committed it. You can test it now.

damencho

Emil Ivov wrote:

···

Hello Jean-Albert,

Nice catch! We'll definitely have to fix this in the message history.

I am wondering though, whether it wouldn't be a better idea to simply remove the "http://" from the address of RSS contacts.

But then again, we could still have colons if a port number is specified so we'd still have to take care of this at the history level.

Cheers
Emil

Jean-Albert Vescovo wrote:

While testing RSS feature under MS Windows, I've found a bug with SC's message history (but perhaps it's not considered like a bug...): when you insert a contact with ":" in its address, Windows is not able to create the file/folder to save the history...
And under RSS, all contacts have an address' format like an URL with ":".
Obviously, no problem with Linux.

An idea to circumvent simply the problem ?

++
Jean-Albert.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#14

Well done, Damian, good job: it's a success :slight_smile:

So, rss4sc seems to be functional with a light library...until we find the next bug :wink:

Jean-Albert

···

Damian Minkov <damencho@damencho.com> wrote:

Hi Jean-Albert,

Good catch :slight_smile: I fixed this and just committed it. You can test it now.

damencho