-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Remote invocation of Command pattern produces exception
PostPosted: Tue Dec 12, 2006 3:15 pm 
Newbie

Joined: Tue Dec 12, 2006 3:11 pm
Posts: 1
Never mind. I failed to read the DataAccessCommand inline comments regarding server-side only use.

Hi,

An excute() from a remote j2se client produces the following exception:

What's going on here. Does DAOFactory need to extend Serializable?

Client code in the text (assume handler produced by Initialcontext() and lookup)

pg 721 of textbook

BidForItemCommand bidForItem =
new BidForItemCommand(userId, itemId, bidAmount);

try {

CommandHandler handler = getCommandHandler();
bidForItem = (BidForItemCommand)handler.execute(bidForItem);
// Extract new bid for rendering
newBid = bidForItem.getNewBid();
// Forward to success page

} catch (CommandException ex)
{
// Forward to error page
// ex.getCause();
}


Command interface ok. DataAccessCommand causes the problem due to DAOFactory. BidForItemCommand is a DataAccessCommand.

IOP00100006: (BAD_PARAM) Class persistence.dao.hibernate.HibernateDAOFactory is not Serializable"
org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 6 completed: Maybe
at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:996)
at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:1011)
at com.sun.corba.ee.impl.util.Utility.throwNotSerializableForCorba(Utility.java:952)
at com.sun.corba.ee.impl.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:731)
at com.sun.corba.ee.impl.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:787)
at com.sun.corba.ee.impl.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:201)
at com.sun.corba.ee.impl.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:570)
at com.sun.corba.ee.impl.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:156)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:224)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueWithVersion(ValueHandlerImpl.java:206)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:146)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.writeRMIIIOPValueType(CDROutputStream_1_0.java:787)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:836)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:850)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:643)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_value(CDROutputStream.java:247)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(DynamicMethodMarshallerImpl.java:338)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeResult(DynamicMethodMarshallerImpl.java:430)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:125)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 13, 2006 6:54 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I guess it needs to be Serializable. The DAO and the Command pattern were not fully tested together. I'll probably add a few more tests in a future release of CaveatEmptor. I don't think this should be an errata in the book; the Command pattern code is not really usable anyway, it's supposed to be illustrative.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.