GWT错误:"键入' com.extjs.gxt.ui.client.data.BasePagingLoadConfig'不能转让给com.google.gwt.user.client.rpc.IsSerializable"

时间:2017-03-09 13:18:45

标签: java eclipse maven extjs gwt

朋友您好我正在开发GWT应用程序,当我点击我的应用程序中的标签时出现此错误:

 [WARN] deviceGroupServlet: An IncompatibleRemoteServiceException was thrown while processing this call.
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type 'com.extjs.gxt.ui.client.data.BasePagingLoadConfig' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized.
    at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:315)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:78)
    at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:131)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    at org.eclipse.kapua.app.console.filter.KapuaWebFilter.executeChain(KapuaWebFilter.java:44)
    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.extjs.gxt.ui.client.data.BasePagingLoadConfig' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized.
    at com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateDeserialize(LegacySerializationPolicy.java:127)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:550)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8.readValue(ServerSerializationStreamReader.java:138)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:385)
    at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:303)

" deviceGroupServlet"是这堂课:

public class GwtDeviceGroupServiceImpl extends KapuaRemoteServiceServlet implements GwtDeviceGroupService{

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Override
    public GwtDeviceGroup create(GwtDeviceGroupCreator gwtDeviceGroupCreator)
            throws GwtKapuaException {
       GwtDeviceGroup gwtDeviceGroup = null;
       try {
        KapuaLocator locator = KapuaLocator.getInstance();
        DeviceGroupFactory factory = locator.getFactory(DeviceGroupFactory.class);
        KapuaId scopeId = KapuaEid.parseCompactId(gwtDeviceGroupCreator.getScopeId());
        DeviceGroupCreator creator = factory.newCreator(scopeId, gwtDeviceGroupCreator.getDevId());
        DeviceGroupService service = locator.getService(DeviceGroupService.class);
        DeviceGroup deviceGroup = service.create(creator);
        gwtDeviceGroup = KapuaGwtModelConverter.convert(deviceGroup);
    } catch (Exception e) {
       KapuaExceptionHandler.handle(e);
    }
       return gwtDeviceGroup;
    }

    @Override
    public void delete(String id, String deviceGroupId) throws GwtKapuaException {
        try{
            KapuaId scopeId = KapuaEid.parseCompactId(id);
            KapuaId devGroupId2 = KapuaEid.parseCompactId(deviceGroupId);
            KapuaLocator locator = KapuaLocator.getInstance();
            DeviceGroupService service = locator.getService(DeviceGroupService.class);
            service.delete(scopeId, devGroupId2);
        } catch (Exception e) {
           KapuaExceptionHandler.handle(e);
        }


    }

    @Override
    public GwtDeviceGroup find(String id, String devGroupId) throws GwtKapuaException {
        KapuaId scopeId = KapuaEid.parseCompactId(id);
        KapuaId devGroupId1 = KapuaEid.parseCompactId(devGroupId);

        GwtDeviceGroup gwtDeviceGroup = null;
        try {
            KapuaLocator locator = KapuaLocator.getInstance();
            DeviceGroupService service = locator.getService(DeviceGroupService.class);
            DeviceGroup deviceGroup = service.find(scopeId, devGroupId1);
            if (deviceGroup != null) {
                gwtDeviceGroup = KapuaGwtModelConverter.convert(deviceGroup);
            }
        } catch (Exception e) {
            KapuaExceptionHandler.handle(e);
        }
        return gwtDeviceGroup;
    }

    @Override
    public PagingLoadResult<GwtDeviceGroup> query(PagingLoadConfig loadConfig,
            GwtDeviceGroupQuery gwtDeviceGroupQuery) throws GwtKapuaException {
       int totalLength = 0;
       List<GwtDeviceGroup> gwtDeviceGroupList = new ArrayList<GwtDeviceGroup>();
       try {
        KapuaLocator locator = KapuaLocator.getInstance();
        DeviceGroupService service = locator.getService(DeviceGroupService.class);
        DevGroupQuery devGroupQuery = GwtKapuaModelConverter.convertDeviceGroupQuery(loadConfig, gwtDeviceGroupQuery);
        DevGroupListResult devs = service.query(devGroupQuery);
        if (!devs.isEmpty()){
            if (devs.getSize() >= loadConfig.getLimit()) {
                totalLength = devs.getSize();

            }else{
                totalLength = devs.getSize();
            }
            for (DeviceGroup d : devs.getItems()) {
                gwtDeviceGroupList.add(KapuaGwtModelConverter.convert(d));
            }

        }
    } catch (Exception e) {
        KapuaExceptionHandler.handle(e);
    }
       return new BasePagingLoadResult<GwtDeviceGroup>(gwtDeviceGroupList, loadConfig.getOffset(), totalLength);
    }

}

我的朋友有similkar问题,他用mvn clean install和maven update解决了这个问题,但我无法解决这些选项的问题。无论我做什么,这个错误仍然存​​在。 有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

请参阅链接 https://www.sencha.com/forum/showthread.php?90592-Paging-Grid-Serialization-with-BasePagingLoadConfig-object。您可能需要在GwtRpcController中进行更改。