struts中的rmi调用
我想在struts的action中使用rmi,已经把rmi的stub和接口文件放在同一目录下.tomcat抛出如下异常:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: 5.5/webapps/rmidb2struts/WEB-INF/classes/
Caused by: java.net.MalformedURLException: no protocol: 5.5/webapps/rmidb2struts/WEB-INF/classes/
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: 5.5/webapps/rmidb2struts/WEB-INF/classes/
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: 5.5/webapps/rmidb2struts/WEB-INF/classes/
Caused by: java.net.MalformedURLException: no protocol: 5.5/webapps/rmidb2struts/WEB-INF/classes/
另外觉得奇怪的是tomcat下在struts的action中使用action出现上述问题,但使用rmi iiop却能正常访问.有没有人碰到过类似的问题
action中rmi的代码
EvaUser ru = new EvaUser();
ru.setName(saveForm.getName());
try
{
saveU obj = (saveU) Naming.lookup("rmi://219.217.52.54:1099/saveU");
obj.saveUser(ru);
}
catch (Exception e)
{
e.printStackTrace();
}