PDA

View Full Version : Hessian remoting



petr.gola
May 12th, 2006, 01:46 AM
Hi,

I have chosen hessian remoting for my project. I have this interface on the server side (HessianServiceExporter):



...
public abstract StockItem saveNewStockItem(StockItem item);

public abstract StockItem findStockItemById(int id);

public abstract List getStockItemList(String filter);
...


on my client (HessianProxyFactoryBean) a want to connect to my business layer and use this interface:



public static void main(String[] args) {
XmlBeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(args[0]));
IStockItemService service = (IStockItemService) beanFactory.getBean("myservice");

// (1)
service.findStockItemById(1);
// (2)
service.saveNewStockItem(new StockItem("Ahoj",29));
// (3)
List list = service.getStockItemList(null);
}


...but here are some strange behaving.
(1) throws java.lang.ClassNotFoundException: int ... i haven't any idea why...
(2) works correctly... I verified that there is a new record in the database table.
(3) throws java.lang.reflect.InvocationTargetException ...

Have anyone any idea what I'm doing wrong?
Thx. in advance.

hust_need4speed
May 15th, 2006, 04:28 AM
Hi,

I have chosen hessian remoting for my project. I have this interface on the server side (HessianServiceExporter):



on my client (HessianProxyFactoryBean) a want to connect to my business layer and use this interface:



...but here are some strange behaving.
(1) throws java.lang.ClassNotFoundException: int ... i haven't any idea why...
(2) works correctly... I verified that there is a new record in the database table.
(3) throws java.lang.reflect.InvocationTargetException ...

Have anyone any idea what I'm doing wrong?
Thx. in advance.

answer to (1)
U need to make sure that class StockItem is on ur client jvm classpath
hint to (3)
U need to give me the original stack trace using the method e.getCause() on the exception InvocationTargetException