Announcement

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

    Upgrading version to 6.1 JSExpression cannot be cast to java.lang.Long

    Hi Isomorphic,

    While trying to upgrade Smart GWT from 5.0 to 6.1 we got the following error:

    java.lang.ClassCastException: com.isomorphic.js.JSExpression cannot be cast to java.lang.Long
    at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2480)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:435)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:415)
    at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:147)
    at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
    at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:176)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)


    After some debugging, for the same input, snippet:
    <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object">
    <transactionNum xsi:type="xsd:long">0</transactionNum>
    <operations xsi:type="xsd:List">
    ...

    the 5.0 version transforms transactionNum into a Long type, but in 6.1 it is JSExpression.

    Checking the RPCManager class the problematic line is:
    RPCManager.java:1615 Long transactionNum = (Long)this.transaction.get("transactionNum");


    Do you have a recommendation on how to move forward with the issue please?

    Regards,
    Zsolt

    #2
    Hi zsolt.purgel,

    did you double check that your JS code and your Server code use the same framework version, so both 6.1 in your case?
    Also, if I were you, I'd try migrating to current 13.0p or even 13.1d (depending on how long you think your migration will take). Why migrate from one very old version to a slightly less old version?

    Best regards
    Blama

    Comment


      #3
      Hi Blama,

      In the request in the browser I can see:

      ... = I deleted the value here

      http://127.0.0.1:8080/.../sc/IDACall......&isc_rpc=1&isc_v=v11.1p_2024-02-02&isc_xhr=1

      Does this mean that on the client side the version also correct?

      This is the first time for me to upgrading the framework. thought I would have less problems since it is only 1 version jump..
      Last edited by zsolt.purgel; 13 Feb 2024, 06:43.

      Comment


        #4
        Hi zsolt.purgel,

        I'd say your client side is 6.1/11.1, but those have been no longer supported for a long time, see here.
        A big update might be more work, but you'll also get a lot more features (see blog entries for new versions) and more importantly Isomorphic is more likely to address an issue if it happens in a supported version.

        Best regards
        Blama

        Comment


          #5
          As Blama has pointed out, and as we pointed out yesterday, you are currently trying to upgrade to a nearly 7-year-old version that has be de-supported for a year. This does not make sense, is a waste of time, and you will not receive further help from Isomorphic Support if you continue on this path (that's what it means when a version is de-supported).

          As far as the actual problem, likely you would have the same issues upgrading to 13.0 or 13.1, as it looks like you may be replacing random files instead of following the installation instructions. Do not skip steps, and you will not have problems like this, and your other thread today.

          Comment

          Working...
          X