Hi, I have added jdom.jar and it little bit helped but now I have following exception. Can you help. java.lang.IllegalArgumentException: Invalid feed type [rss=2.0] at com.sun.syndication.feed.synd.SyndFeedImpl.createWireFeed(SyndFeedImpl.java:227) at com.sun.syndication.feed.synd.SyndFeedImpl.createWireFeed(SyndFeedImpl.java:211) at com.sun.syndication.io.SyndFeedOutput.output(SyndFeedOutput.java:134) at no.arrive.logic.CreateRSS.main(CreateRSS.java:67) .... Writer writer = new FileWriter(fileName); SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, writer); //67
LINE writer.close();
Dnia 27-01-2011 o godz. 14:35 bambang passion napisał(a):
Hi,
may be you need to check your jdom library i guess.
rgds
b.l
2011/1/27 Rafał Laczek <rafal_lac...@wp.pl>
Hi Colleagues,
Â
I create RSS feed. When I execute the main class I receive following exception:
in thread "main" java.lang.NoClassDefFoundError: org/jdom/JDOMException
   at com.sun.syndication.io.SyndFeedOutput.<init>(SyndFeedOutput.java:44)
   at no.arrive.web.CreateRSSFeed.main(CreateRSSFeed.java:56)
Caused by: java.lang.ClassNotFoundException: org.jdom.JDOMException
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   ... 2 more
Â
Â
Line 56 is SyndFeedOutput output = new SyndFeedOutput(); //line 56
I send also my class. For the project I use Rome library.
Can somebody advise how to resolve it.
Â
Â
Â
Â
public class CreateRSSFeed {
Â
private static final DateFormat DATE_PARSER = new SimpleDateFormat("yyyy-MM-dd");
Â
Â
   public static void main(String[] args) {
  Â
      try{
      System.out.println("Create RSS feed test");  Â
      String feedType ="rss=2.0";
      String fileName = "feed.xml";
     Â
      SyndFeed feed = new SyndFeedImpl();
      feed.setFeedType(feedType);
     Â
      feed.setTitle("ABC");
      feed.setLink("http://www.abc.com.html");
      feed.setDescription("IT ");
      System.out.print("Feed title is: "+feed.getTitle());
     Â
      List entries = new ArrayList();
      SyndEntry entry;
      SyndContent description;
     Â
      entry = new SyndEntryImpl();
      entry.setTitle("About ABC");
      entry.setLink("http://www.abc.com/category.php?categoryID=3681");
      entry.setPublishedDate(DATE_PARSER.parse("2011-01-10"));
      description = new SyndContentImpl();
      description.setType("text/plain");
      description.setValue("ABC is blablabla..");
      entry.setDescription(description);
      System.out.print("Entry title is: "+entry.getTitle());
      entries.add(entry);
     Â
      feed.setEntries(entries);  Â
     Â
      Writer writer = new FileWriter(fileName);
      SyndFeedOutput output = new SyndFeedOutput(); //line 56
      output.output(feed, writer);
      writer.close();
              Â
      System.exit(0);
     Â
      }catch (Exception ex) {
             ex.printStackTrace();
         }  Â
   }
Â
}
Â
Â
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en