Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RPCManager error

    What can cause this java error? I don't have the source code so I cannot debug

    java.lang.ClassCastException: com.isomorphic.js.JSExpression cannot be cast to java.lang.Long
    at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:1704)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:323)
    Last edited by acarur01; 10 Aug 2011, 07:58.

    #2
    It suggests that client-side code has somehow submitted a corrupt request. Can you grab the request from the RPC tab? We need both the RPCRequest and the "Raw Request" tab contents.

    Comment


      #3
      Another possibility would be that isomorphic/system/schema/*.ds.xml files are missing or not being found due to bad settings.

      Comment


        #4
        I will try and reproduce and let you know. I believe it only happens in https session.

        Comment


          #5
          I have exactly the same error in my server JBoss.
          Would you please have a look at my outputs?
          The RPCRequest is:
          "{
          "actionURL":"http://xxxx:8080/xxx/gwt-rpc/dispatch.htm",
          "showPrompt":true,
          "prompt":"Recherche des enregistrements correspondant à vos critères...",
          "transport":"xmlHttpRequest",
          "promptStyle":"cursor",
          "bypassCache":true,
          "data":{
          "criteria":{
          },
          "operationConfig":{
          "dataSource":"supplyItem",
          "repo":null,
          "operationType":"fetch",
          "textMatchStyle":"exact"
          },
          "startRow":0,
          "endRow":75,
          "componentId":"isc_ListGrid_0",
          "appID":"builtinApplication",
          "operation":"supplyItemdfdfdfhuu_fetch",
          "oldValues":{
          }
          }
          }

          And the Raw request is:
          _transaction=%3Ctransaction%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum%20xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FtransactionNum%3E%3Coperations%20xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3Ccriteria%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2Fcriteria%3E%3CoperationConfig%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CdataSource%3EsupplyItemdfdfdfhuu%3C%2FdataSource%3E%3CoperationType%3Efetch%3C%2FoperationType%3E%3CtextMatchStyle%3Eexact%3C%2FtextMatchStyle%3E%3C%2FoperationConfig%3E%3CstartRow%20xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FstartRow%3E%3CendRow%20xsi%3Atype%3D%22xsd%3Along%22%3E75%3C%2FendRow%3E%3CcomponentId%3Eisc_ListGrid_0%3C%2FcomponentId%3E%3CappID%3EbuiltinApplication%3C%2FappID%3E%3Coperation%3EsupplyItemdfdfdfhuu_fetch%3C%2Foperation%3E%3ColdValues%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2FoldValues%3E%3C%2Felem%3E%3C%2Foperations%3E%3C%2Ftransaction%3E&protocolVersion=1.0

          The DSRequest is: {
          "dataSource":"supplyItem",
          "operationType":"fetch",
          "componentId":"isc_ListGrid_0",
          "data":{
          },
          "startRow":0,
          "endRow":75,
          "textMatchStyle":"exact",
          "resultSet":[ResultSet ID:isc_ResultSet_0 (created by: isc_ListGrid_0)],
          "callback":{
          "caller":[ResultSet ID:isc_ResultSet_0 (created by: isc_ListGrid_0)],
          "methodName":"fetchRemoteDataReply"
          },
          "willHandleError":true,
          "showPrompt":true,
          "prompt":"Recherche des enregistrements correspondant à vos critères...",
          "oldValues":{
          },
          "clientContext":{
          "requestIndex":1
          },
          "requestId":"supplyItem$6270"
          }

          Comment


            #6
            Check the possible causes above. If those aren't the problem, post more details.

            Comment


              #7
              I try to start with the sample HibernateDS which instantiate DataSource on the client only (the example explicitly bypasses ISC server-side DataSource management). So there is no file xxx.ds.xml in the server.
              I use the RPCManager.setActionURL() in the client;
              and then in the server, I use a GwtRpcController which extends the gwt RemoteServiceServlet and implements the spring controller, the code is
              Code:
              public class GwtRpcController extends RemoteServiceServlet implements Controller, ServletContextAware, BeanNameAware {
                 
                  @Override
                  public ModelAndView handleRequest(final HttpServletRequest request, final HttpServletResponse response)
                          throws Exception {
                      RPCManager rpc;
                      try {
                          rpc = new RPCManager(request, response);//which throws the class cast exception
                      } catch (ClientMustResubmitException e) {
                          return null;
                      }
              Thanks for any help please.

              Comment


                #8
                This is completely wrong - do not try to combine GWT-RPC and RPCManager together. We don't recommend using GWT-RPC at all (see FAQ in SmartGWT forum for why). If you try to use RPCManager in server-side code then you are using the SmartGWT Server code, and if so, then follow the approaches in the QuickStart Guide and ignore GWT-RPC.

                Comment


                  #9
                  Thank you for the reply.
                  Unfortunately, after I remove the Gwt rpc, there is always the same exception. Now I use the code:
                  Code:
                  class SupplyItemController implements Controller {
                        @Override
                      public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
                          
                          RPCManager rpc;
                          try {
                              rpc = new RPCManager(request, response); 
                          } catch (ClientMustResubmitException e) {
                               return null;
                          }
                      
                          return null;
                      }
                  
                  }
                  It throws
                  java.lang.ClassCastException: com.isomorphic.js.JSExpression cannot be cast to java.lang.Long
                  at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:1716)
                  at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:323)
                  Would you like me to post the smart RPC request et DS request?

                  Comment


                    #10
                    The request I reveive in the controller is a SecurityContextHolderAwareRequestWrapper; is it possible that the error is due to the spring security?

                    Comment


                      #11
                      You should not be putting the RPCManager behind a Spring Controller unless you have no choice. This is more complicated and breaks certain functionality. Look at the Spring Integration overview for more context.

                      Comment


                        #12
                        Hi,

                        After I updated from smartgwt 4.1 to 6.1p enterprise I get the same error. When I check source of RPCManager.class it try to cast transactionNumber to Long but value in map is JSExpression. Given bellow is my stack trace, and a sample request get from (context.request.getParameter("_transaction"). My server is Wildfly 10 final. Please help to resolve this issue.

                        Thanks

                        -------------------------------------------------------------------
                        org.apache.jasper.JasperException: java.lang.ClassCastException: com.isomorphic.js.JSExpression cannot be cast to java.lang.Long
                        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:473)
                        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402)
                        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346)
                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
                        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
                        at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:130)
                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                        at com.crimsonlogic.tfb.core.server.filter.CrimsonWebSecurityResponseFilter.doFilter(CrimsonWebSecurityResponseFilter.java:31)
                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
                        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
                        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
                        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
                        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
                        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
                        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
                        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
                        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.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
                        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
                        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
                        at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
                        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
                        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
                        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
                        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
                        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
                        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
                        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
                        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
                        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
                        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
                        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
                        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
                        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
                        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
                        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
                        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
                        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
                        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
                        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
                        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
                        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
                        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
                        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                        at java.lang.Thread.run(Thread.java:748)
                        Caused by: java.lang.ClassCastException: com.isomorphic.js.JSExpression cannot be cast to java.lang.Long
                        at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2396)
                        at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:439)
                        at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:473)
                        at org.apache.jsp.tfb.tools.developerConsoleOperations_jsp._jspService(developerConsoleOperations_jsp.java:119)
                        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
                        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
                        ... 91 more

                        -----------------------------------------------------------------------
                        <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object">
                        <transactionNum xsi:type="xsd:long">2</transactionNum>
                        <operations xsi:type="xsd:List">
                        <elem xsi:type="xsd:Object">
                        <values xsi:type="xsd:Object"/>
                        <operationConfig xsi:type="xsd:Object">
                        <dataSource>login</dataSource>
                        <repo xsi:nil="true"/>
                        <operationType>custom</operationType>
                        <textMatchStyle>exact</textMatchStyle>
                        </operationConfig>
                        <appID>builtinApplication</appID>
                        <operation>signout</operation>
                        <oldValues xsi:type="xsd:Object"/>
                        </elem>
                        </operations>
                        </transaction>

                        Comment


                          #13
                          Please read (or re-read) the thread above. Best guess as to how this can happen is invalid use of RPCManager, or incorrectly putting RPCManager behind a Spring controller. This problem has never been reproduced by Isomorphic.

                          Comment

                          Working...
                          X