Announcement

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

    [bug ?] operationBinding criteria and fmt:message tag

    SmartClient Power 8.2p

    I'm trying to use an operation binding like this:
    Code:
        <operationBindings>
            <operationBinding operationType="fetch">
                <criteria fieldName="NOME_GRUPPO">
                    <value><fmt:message key="gruppo" bundle="${ambiente}"/></value>
                </criteria>
            </operationBinding>
        </operationBindings>
    but I got this server side exception:
    Code:
    === 2011-12-30 17:10:34,016 [c-13] INFO  RequestContext - URL: '/Eleven/isomorphic/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7': Safari with Accept-Encoding header
    === 2011-12-30 17:10:34,016 [c-13] DEBUG XML - Parsed XML from (in memory stream): 0ms
    === 2011-12-30 17:10:34,016 [c-13] DEBUG RPCManager - Processing 1 requests.
    === 2011-12-30 17:10:34,016 [c-13] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"GRUPPI",
            operationType:"fetch",
            textMatchStyle:"startsWith"
        },
        startRow:0,
        endRow:75,
        componentId:"isc_PickListMenu_0",
        appID:"builtinApplication",
        operation:"GRUPPI_fetch",
        oldValues:{
        }
    }
    === 2011-12-30 17:10:34,016 [c-13] INFO  IDACall - Performing 1 operation(s)
    === 2011-12-30 17:10:34,016 [c-13] WARN  RequestContext - dsRequest.execute() failed: 
    java.lang.ClassCastException: org.apache.commons.collections.map.LinkedMap
    	at com.isomorphic.rpc.RPCManager.applyEarlierResponseValues(RPCManager.java:2169)
    	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1909)
    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
    	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
    	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
    	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:74)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:55)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:36)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:178)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:92)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:189)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:189)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:110)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:110)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:170)
    	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:238)
    	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:168)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:77)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:120)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:909)
    	at java.lang.Thread.run(Thread.java:662)
    === 2011-12-30 17:10:34,016 [c-13] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2011-12-30 17:10:34,047 [c-13] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    the operation binding criteria value for the field in the client side code is correct:
    Code:
    operationBindings:[
            {
                operationType:"fetch",
                criteria:{
                    fieldName:"NOME_GRUPPO",
                    value:"ROLE_ADMIN"
                }
            }
        ]
    if I try to hardcode the value:
    Code:
        <operationBindings>
            <operationBinding operationType="fetch">
                <criteria fieldName="NOME_GRUPPO">
                    <value>ROLE_ADMIN</value>
                </criteria>
            </operationBinding>
        </operationBindings>
    then it works.

    is it a bug, or I'm trying to do something not supported?
    Last edited by claudiobosticco; 4 Jan 2012, 03:34. Reason: my fault - not a bug

    #2
    Your <fmt> tag is probably not executing at all because you've done something wrong in implementing DataSource i18n as explained in the docs.

    Comment


      #3
      I think that the <fmt:message> tag is executing correctly, because I'm already using the datasource internationalization with success, so my ds starts with:
      Code:
      <!--
       <%@page pageEncoding="UTF-8" contentType="text/xml; charset=UTF-8"%>
       <%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld" %>
       <fmt:setBundle basename="i18nMessages_${locale}" var="i18n"/>
       -->
      <DataSource xmlns:fmt="urn:jsptld:/WEB-INF/fmt.tld"
      ...
      and like I said in the "view source" of the page I see the js translated datasource code correct:
      Code:
      operationBindings:[
              {
                  operationType:"fetch",
                  criteria:{
                      fieldName:"NOME_GRUPPO",
                      value:"ROLE_ADMIN"
                  }
              }
          ]

      Comment


        #4
        Ah, sorry. Yes it's being processed for delivery to the client, but the server-side definition of the DataSource does not use your i18n strings and in fact gets the raw XML of the <fmt> tag which causes the error you're seeing.

        If you actually have a reason to use i18n strings in server-side logic like you show, you can add a DMI that retrieves the String and adds it to the criteria in the dsRequest.

        Comment


          #5
          thanks, now I see that what I was doing is absurd..clearly the i18n approach works only for client-only datasource attributes.

          Comment

          Working...
          X