You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Richa <rs...@gmail.com> on 2015/06/16 09:00:31 UTC

Error while polling an Atom Feed

Hello,

I have an AtomEnpoint in my camel route with the following configuration : 

AtomEndpoint atomEndpoint = new AtomEndpoint();
		String inputEndPoint = "http://macstrac.blogspot.com/feeds/posts/default";
		//Set the endpoint and feed URI.
		atomEndpoint.setFeedUri(inputEndPoint );
		atomEndpoint.setEndpointUriIfNotSpecified(inputEndPoint );
		//Set split entries to false, so that all entries are splitted in all the
polls.
		atomEndpoint.setSplitEntries(false);
		atomEndpoint.setCamelContext(routeDetails.getContext());

And my route looks like this:

from(atomEndpoint)
			.autoStartup(true)
			.process(new Processor() {
				
				public void process(Exchange exchange) throws Exception {
					List<Entry> list = ExchangeHelper.getMandatoryInBody(exchange,
List.class);
					StringBuffer content = new StringBuffer();
					for(Entry entry : list){
						content = content.append(entry.getContent());
					}
					exchange.getIn().setBody(content.toString(), String.class);
				}
			})
			.to(toLocation);

But whenever I run this route, I get the following exception : 

Consumer Consumer[http://macstrac.blogspot.com/feeds/posts/default] failed
polling endpoint:
Endpoint[http://macstrac.blogspot.com/feeds/posts/default]. Will try again
at next poll. Caused by: [java.lang.ClassCastException -
org.apache.abdera.protocol.error.ErrorExtensionFactory cannot be cast to
org.apache.abdera.factory.ExtensionFactory]: java.lang.ClassCastException:
org.apache.abdera.protocol.error.ErrorExtensionFactory cannot be cast to
org.apache.abdera.factory.ExtensionFactory
  at
org.apache.abdera.util.AbderaConfiguration.loadExtensionFactories(AbderaConfiguration.java:101)
  at
org.apache.abdera.util.AbderaConfiguration.<init>(AbderaConfiguration.java:92)
  at
org.apache.abdera.util.AbderaConfiguration.<init>(AbderaConfiguration.java:87)
  at
org.apache.abdera.util.AbderaConfiguration.getDefault(AbderaConfiguration.java:65)
  at org.apache.abdera.Abdera.<init>(Abdera.java:73)
  at org.apache.abdera.Abdera.getInstance(Abdera.java:57)
  at
org.apache.camel.component.atom.AtomUtils.getAtomParser(AtomUtils.java:42)
  at
org.apache.camel.component.atom.AtomUtils.parseDocument(AtomUtils.java:55)
  at
org.apache.camel.component.atom.AtomPollingConsumer.createFeed(AtomPollingConsumer.java:40)
  at
org.apache.camel.component.feed.FeedPollingConsumer.poll(FeedPollingConsumer.java:36)
  at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)
  at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
  at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
  at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
  at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:745)

JBoss 7.1.3.Final-redhat-4 is stopping...

At times, this work, at times, it doesn't. Can someone please let me know,
what I am doing wrong here.

Thanks,
Richa




--
View this message in context: http://camel.465427.n5.nabble.com/Error-while-polling-an-Atom-Feed-tp5768296.html
Sent from the Camel - Users mailing list archive at Nabble.com.