Announcement

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

    Cannot find cause of "java.lang.ClassCastException: java.lang.String cannot be cast

    Hello there,

    I am working with version SmartClient Version: v10.0p_2015-01-23/PowerEdition Deployment (built 2015-01-23) on Firefox browser.

    I am trying to open a frame which has a listgrid with some cols. one of the column is a ValueMap. i.e. it contains a ComboBox widget. For some reason when i try to open this frame i get this error. CAn somebody please help me to the correct path.

    Code:
    === 2015-03-10 08:57:15,468 [3-26] DEBUG SQLConnectionManager - About to close  with hashcode "11519858"
    === 2015-03-10 08:57:15,468 [3-26] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 11 of type 'productDS'
    === 2015-03-10 08:57:15,468 [3-26] ERROR IDACall - com.isomorphic.servlet.IDACall top-level exception
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    	at com.isomorphic.datasource.DataSource.dropExtraFields(DataSource.java:1156)
    	at com.isomorphic.rpc.RPCManager.filterDSResponseData(RPCManager.java:816)
    	at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:1325)
    	at com.isomorphic.rpc.RPCManager.send(RPCManager.java:648)
    	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:178)
    	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:142)
    	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    	at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
    	at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    	at org.eclipse.jetty.server.Server.handle(Server.java:370)
    	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    	at java.lang.Thread.run(Thread.java:745)
    === 2015-03-10 08:57:15,468 [3-26] DEBUG ConfigParser - Matched var name: debug
    === 2015-03-10 08:57:15,468 [3-26] DEBUG ConfigParser - value after substitution: true
    and my datasource looks like so

    Code:
    <DataSource ID="productDS" serverType="sql" tableName="product">
    	<fields>
    		<field name="productID" type="int" hidden="true" primaryKey="true" />
    		<field name="productCode" type="int" title="Code" />
    		<field name="productName" type="String" title="Product Name" />
    		<field name="category" type="text" length="15" title="Category">
    			<valueMap>
    				<value>XXXX</value>
    				<value>YYYYY</value>
    				<value>NA</value>
    			</valueMap>
    		</field>
    		<field name="price" type="float" title="Price" />
    	</fields>
    	<dropExtraFields></dropExtraFields>
    </DataSource>

    and i create my listgrid like so,

    Code:
    private void initialise()
    	{
    		DataSource ds = DataSource.get("productDS");
    
    		productList = new ListGrid();
    		productList.setShowRowNumbers(true);
    		productList.setHeight(425);
    		productList.setDataSource(ds);
    		productList.setEditEvent(ListGridEditEvent.DOUBLECLICK);
    		productList.setAutoSaveEdits(false);
    		productList.setSaveByCell(false);		
    		productList.setAutoFetchData(true);  
    		productList.setCanEdit(true);  
    		productList.setModalEditing(true);   
    		productList.setListEndEditAction(RowEndEditAction.NEXT);

    #2
    Hi zaj,

    my gut feeling says that
    Code:
    <dropExtraFields></dropExtraFields>
    could be causing this. dropExtraFields is a DS-level attribute and should be false or true. This should still apply when written in tag-format. You have given a String of "".

    Try to remove the tag, perhaps it will help.

    Best regards,
    Blama

    Comment


      #3
      Hi Blama,

      cheers! indeed that was the cause.

      Zolf

      Comment

      Working...
      X