Announcement

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

    nativeName: java.util.ArrayList cannot be cast to java.lang.String

    The same nativeNames for different dataSourceFields are causing class cast exception during loading of dataSources.

    Reproduced in Smargwt 3.1p EE showcase (build 2015_05_26)
    NOT reproduced in Smartgwt 5.0p EE showcase (build 2015_08_30)

    How to reproduce:
    In EE showcase, e.g. employees.ds.xml:
    Code:
    <DataSource
        ID="employees"
        serverType="sql"
        tableName="employeeTable"
        recordName="employee"
        testFileName="/ds/test_data/employees.data.xml"
        titleField="Name"
    >
        <fields>
            <field name="userOrder"       title="userOrder"       type="integer"  canEdit="false"    hidden="true" nativeName="USER_ORDER"/>
            <field name="Name"            title="Name"            type="text"     length="128"/>
            <field name="EmployeeId"      title="Employee ID"     type="integer"  primaryKey="true"  required="true" nativeName="USER_ORDER"/>
            <field name="ReportsTo"       title="Manager"         type="integer"  required="true" 
                   foreignKey="employees.EmployeeId"  rootValue="1" detail="true"/>
            <field name="Job"             title="Title"           type="text"     length="128"/> 
            <field name="Email"           title="Email"           type="text"     length="128"/>
            <field name="EmployeeType"    title="Employee Type"   type="text"     length="40"/>
            <field name="EmployeeStatus"  title="Status"          type="text"     length="40"/>
            <field name="Salary"          title="Salary"          type="float"/>
            <field name="OrgUnit"         title="Org Unit"        type="text"     length="128"/>
            <field name="Gender"          title="Gender"          type="text"     length="7">
                <valueMap>
                    <value>male</value>
                    <value>female</value>
                </valueMap>
            </field>
            <field name="MaritalStatus"   title="Marital Status"  type="text"     length="10">
                <valueMap>
                    <value>married</value>
                    <value>single</value>
                </valueMap>
            </field>
        </fields>
    
        <operationBindings>
            <operationBinding operationType="fetch" operationId="fetchEmployeesNotInTeam">
                <whereClause>EmployeeId NOT IN (SELECT p.EmployeeId FROM teamMembers2 AS p WHERE p.TeamId = $criteria.TeamId AND p.EmployeeId IS NOT NULL) AND $defaultWhereClause</whereClause>
            </operationBinding>
        </operationBindings>
    </DataSource>
    Loading the showcase in browser will cause following exception:
    Code:
         [java] === 2015-09-04 08:12:29,162 [9-37] ERROR DataSourceLoader - Exception while attempting to load a DataSource
         [java] java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
         [java] 	at com.isomorphic.sql.SQLDataSource.buildSQLTable(SQLDataSource.java:206)
         [java] 	at com.isomorphic.sql.SQLDataSource.init(SQLDataSource.java:176)
         [java] 	at com.isomorphic.datasource.DataSource.initialize(DataSource.java:400)
         [java] 	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:163)
         [java] 	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:385)
         [java] 	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
         [java] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:204)
         [java] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:195)
         [java] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:184)
         [java] 	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:119)
         [java] 	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:127)
         [java] 	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:94)
         [java] 	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:89)
         [java] 	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:83)
         [java] 	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:126)
         [java] 	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:94)
         [java] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
         [java] 	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
         [java] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
         [java] 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
         [java] 	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:260)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
         [java] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
         [java] 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
         [java] 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
         [java] 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
         [java] 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
         [java] 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
         [java] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
         [java] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
         [java] 	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
         [java] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
         [java] 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
         [java] 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
         [java] 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
         [java] 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
         [java] 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
         [java] 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
         [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
         [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
         [java] 	at java.lang.Thread.run(Thread.java:662)
         [java] === 2015-09-04 08:12:29,218 [9-37] ERROR DataSourceLoader - Top-level servlet error: 
         [java] javax.servlet.ServletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
         [java] 	at com.isomorphic.sql.SQLDataSource.buildSQLTable(SQLDataSource.java:206)
         [java] 	at com.isomorphic.sql.SQLDataSource.init(SQLDataSource.java:176)
         [java] 	at com.isomorphic.datasource.DataSource.initialize(DataSource.java:400)
         [java] 	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:163)
         [java] 	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:385)
         [java] 	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
         [java] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:204)
         [java] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:195)
         [java] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:184)
         [java] 	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:119)
         [java] 	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:127)
         [java] 	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:94)
         [java] 	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:89)
         [java] 	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:83)
         [java] 	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:126)
         [java] 	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:94)
         [java] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
         [java] 	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
         [java] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
         [java] 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
         [java] 	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:260)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
         [java] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
         [java] 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
         [java] 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
         [java] 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
         [java] 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
         [java] 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
         [java] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
         [java] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
         [java] 	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
         [java] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
         [java] 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
         [java] 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
         [java] 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
         [java] 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
         [java] 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
         [java] 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
         [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
         [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
         [java] 	at java.lang.Thread.run(Thread.java:662)
         [java] 
         [java] 	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:185)
         [java] 	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:94)
         [java] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
         [java] 	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
         [java] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
         [java] 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
         [java] 	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:260)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
         [java] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
         [java] 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
         [java] 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
         [java] 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
         [java] 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
         [java] 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
         [java] 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
         [java] 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
         [java] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
         [java] 	at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
         [java] 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
         [java] 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
         [java] 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
         [java] 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
         [java] 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
         [java] 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
         [java] 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
         [java] 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
         [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
         [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
         [java] 	at java.lang.Thread.run(Thread.java:662)

    #2
    Hi matus_b, Hi Isomorphic,

    this is definitly related to this bug.

    Best regards
    Blama

    Comment


      #3
      Hi Blama,
      yes, looks to be the same issue. I didn't find it before.

      I am waiting for Isomorphic call if they will port this fix also to 3.1p version.

      Comment


        #4
        We'll take a look at whether this is practical to port back to 3.1p (aka 8.3p) and let you know.
        Also, you're probably already aware of this, but we don't recommend doing active development against 8.3 - that branch is a couple of iterations behind the latest so in addition to missing out on various features you're likely to occasionally encounter issues like this which have already been addressed in more recent code, problems with some of the newer browsers which were released after 8.3 came out, etc.

        Regards
        Isomorphic Software

        Comment


          #5
          The fix is ported to all branches down to 3.1 (8.3), available for download since today (2015-09-08).

          Comment

          Working...
          X