ClassCastException in Sample AbderaClient using EmployeeCollectionAdapter

View: New views
3 Messages — Rating Filter:   Alert me  

ClassCastException in Sample AbderaClient using EmployeeCollectionAdapter

by pratimat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


All,

I am newbie here with Abdera.
I am trying to run a sample program downloaded as part of the 0.4.0 source. The server EmployeeCollectionAdapter is running successfully. When we try to run the client, we are able to POST successfully and store in the Hashmap as well. But when the the GET is done, it goes into a class cast exception and we see the following errors: I would appreciate any help from you folks.

CLIENT ERROR:

== The Created Entry ==
<entry xmlns="http://www.w3.org/2005/Atom"><id>tag:acme.com,2007:employee:entry:1001</id><title type="text">This is the title</title><updated>2008-07-10T16:39:32.234Z</updated><author><name>James</name></author><content type="text">This is the content</content><link href="/employee/1001-This_is_the_content" rel="edit" /></entry>

Exception in thread "main" java.lang.ClassCastException: org.apache.abdera.protocol.error.Error
        at Main.main(Main.java:81)

SERVER ERROR:

rg.apache.abdera.protocol.server.impl.AbstractProvider process
SEVERE: java.lang.NullPointerException
Jul 10, 2008 11:39:32 AM org.apache.abdera.protocol.server.ProviderHelper servererror
INFO: Server error
java.lang.NullPointerException
        at java.util.Calendar.setTime(Calendar.java:1032)
        at org.apache.abdera.model.AtomDate.format(AtomDate.java:262)
        at org.apache.abdera.protocol.server.ProviderHelper.calculateEntityTag(ProviderHelper.java:560)
        at org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter.buildGetEntryResponse(AbstractCollectionAdapter.java:175)
        at org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter.getEntry(AbstractEntityCollectionAdapter.java:318)
        at org.apache.abdera.protocol.server.impl.AbstractProvider.process(AbstractProvider.java:155)
        at org.apache.abdera.protocol.server.FilterChain.next(FilterChain.java:42)
        at org.apache.abdera.protocol.server.servlet.AbderaServlet.service(AbderaServlet.java:90)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:227)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)


Thanks for your help in advance.
-Pratima

Parent Message unknown Re: ClassCastException in Sample AbderaClient using EmployeeCollectionAdapter

by Sergio Bossa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pratima,

I think the org.apache.abdera.examples.appserver.employee.EmployeeCollectionAdapter#postEntry(...)
method should set the Employee update date, too.
Give it a try and let us know.
Cheers,

Sergio B.

--
Sergio Bossa
Software Passionate, Java Technologies Specialist and Open Source Enthusiast.
Blog : http://sbtourist.blogspot.com
Sourcesense - making sense of Open Source : http://www.sourcesense.com
Pro-netics s.p.a. : http://www.pronetics.it

Re: ClassCastException in Sample AbderaClient using EmployeeCollectionAdapter

by pratimat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Sergio for your help! That did the magic!

-Pratima



Sergio Bossa-2 wrote:
Hi Pratima,

I think the org.apache.abdera.examples.appserver.employee.EmployeeCollectionAdapter#postEntry(...)
method should set the Employee update date, too.
Give it a try and let us know.
Cheers,

Sergio B.

--
Sergio Bossa
Software Passionate, Java Technologies Specialist and Open Source Enthusiast.
Blog : http://sbtourist.blogspot.com
Sourcesense - making sense of Open Source : http://www.sourcesense.com
Pro-netics s.p.a. : http://www.pronetics.it
LightInTheBox - Buy quality products at wholesale price