尝试使用远程界面保存搜索结果时出现以下错误SearchFacade.java
"Failed to marshal EJB parameters"
无法在 sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146) 处将 org.apache.commons.collections.FastHashMap 字段 org.apache.commons.validator.Field.hMsgs 设置为 org.apache.commons.collections.FastHashMap
我正在使用 struts 1.1、EJB 2.1 使用 xdoclet 1.2.3 jar 来生成依赖文件。(这是不可避免的使用),其中我的 Local、Home 接口是使用 Xdoclet 生成的。
我还在我的项目中使用 Java 6、Jboss EAP 6.1 Alpha。
注意:相同的代码在 Jboss 4.0 中运行时也能正常工作
所以想知道我的远程呼叫是否正确。
欢迎任何帮助。
错误日志
java.lang.RuntimeException: JBAS014154: 无法在 org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver) 的 org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:270) 上编组 EJB 参数.java:259) 在 org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) 在 org.jboss. ejb.client.EJBHomeCreateInterceptor.handleInvocation(EJBHomeCreateInterceptor.java:79) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java: 42) 在 org.jboss.ejb.client.ReceiverInterceptor 的 org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)。handleInvocation(ReceiverInterceptor.java:125) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:177) at org.jboss .ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:161) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124) at $Proxy25.saveSearch(Unknown Source) at com.web.history。 SearchFormDelegate.saveSearch(SearchFormDelegate.java:177) at com.history.SaveSearchAction.createNewSavedSearch(SaveSearchAction.java:109) at com.history.SaveSearchAction.executeSynchronized(SaveSearchAction.java:296) at com.dispatch.SynchronizedAction.execute(SynchronizedAction .java:206) 在 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) 在 org.apache。struts.action.RequestProcessor.process(RequestProcessor.java:236) 在 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) 在 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java: 432)在 javax.servlet.http.HttpServlet.service(HttpServlet.java:754) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain .java:295) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 在 com.security.AuthenticationFilter.doFilter(AuthenticationFilter.java:672) 在 org.apache.catalina.core.ApplicationFilterChain。 internalDoFilter(ApplicationFilterChain.java:246) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 在 com.planetj.servlet.filter.compression。CompressingFilter.doFilter(CompressingFilter.java:270) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org .apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke (SecurityContextAssociationValve.java:169) 在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) 在 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) 在 org.apache。 catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) 在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) 在 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) 在 org.apache.tomcat.util 的 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) .net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) at java.lang.Thread.run(Thread.java:662) 原因:java.lang.IllegalArgumentException:无法设置 org.apache.commons.collections。 FastHashMap 字段 org.apache.commons.validator.Field.hMsgs 到 sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146) 处 sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java) 处的 org.apache.commons.collections.FastHashMap :150) 在 sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63) 在 java.lang.reflect.Field.set(Field.java:657) 在 org.jboss。marshalling.cloner.SerializingCloner.storeFields(SerializingCloner.java:368) at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:313) at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:第253章.initSerializableClone(SerializingCloner.java:309) 在 org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:253) 在 org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134) 在 org. jboss.marshalling.cloner.SerializingCloner$StepObjectInput.doReadObject(SerializingCloner.java:836) 在 org.jboss.marshalling.AbstractObjectInput。readObject(AbstractObjectInput.java:37) at org.jboss.marshalling.MarshallerObjectInputStream.readObjectOverride(MarshallerObjectInputStream.java:57) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:344) at java.util.HashMap.readObject(HashMap .java:1030) 在 sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java.lang.reflect.Method.invoke(Method.java:597) 在org.jboss.marshalling.reflect.SerializableClass.callReadObject(SerializableClass.java:218) at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:302) at org.jboss.marshalling.cloner.SerializingCloner.clone( SerializingCloner.java:253) 在 org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134) 在 org.jboss。marshalling.cloner.SerializingCloner.cloneFields(SerializingCloner.java:348) at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:309) at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:第253章.initSerializableClone(SerializingCloner.java:309) at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:285) at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:253) at org. jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134) 在 org.jboss.marshalling.cloner.SerializingCloner。cloneFields(SerializingCloner.java:348) at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:309) at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:253) at org.jboss .marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134) at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:268) ... 42 更多
代码:
saveAction.java
protected void newSavedSearch(final SrchFrmDelegate sfd,
final String userId, final HttpServletRequest request,
final SaveSearchForm form) throws RemoteException,
UsrNotFoundException {
BseSrchValue srchValue = SrchResultsAction.retrieveSrchCriteria(request);
FrmLayout frmLayout = (FrmLayout) request.getSession().getAttribute(
FrmBuilderAction.FRM_LAYOUT_KEY);
Integer resultCount = null;
SrchResultValue srchResult = SearchResultsAction.retrieveSearchResults(request);
if (srchResult != null) {
resultCount = new Integer(srchResult.getTotal());
}
sfd.saveSearch(userGuid,
form.getTitle(),
form.getDesc(),
form.getNewTtle(),
srchValue,
frmLayout,
resultCount,
form.getSearches());
}
SrchFrmDelegate.java
/**
* Reference to the remote interface.
*/
private SrhFrmFacadeRemote srhFacadeRemote;
public String saveSearch(final String userId, final String srchTtle,
final String srchDesc, final Boolean newTtle,
final BsSearchValue srchValue, final FrmLay frmLay,
final Integer resultCount, final List alerts)
throws UsrNotFoundException,
RemoteException {
return srhFacadeRemote.saveSearch(userId, srchTtle,
srchDesc, newTtle, srchValue, frmLay,
resultCount, alerts);
}
SrchFrmFacadeRemote.java
/**
* Remote interface for SrchFrmFacade.
*/
public java.lang.String saveSearch( java.lang.String userId,java.lang.String srchTtle,java.lang.String srchDesc,java.lang.Boolean newTtle,com.common.search.BsSearchValue srchValue,com.common.search.advanced.FrmLay frmLay,java.lang.Integer resultCount,java.util.List alerts ) throws com.common.admin.UserNotFoundException, java.rmi.RemoteException;