Announcement

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

    #16
    i've the same problem - please help

    Code:
    javax.servlet.ServletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
    	at com.isomorphic.datasource.BasicDataSource.buildFieldData(BasicDataSource.java:303)
    	at com.isomorphic.datasource.BasicDataSource.init(BasicDataSource.java:159)
    	at com.isomorphic.sql.SQLDataSource.init(SQLDataSource.java:115)
    	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:126)
    	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:224)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:198)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:89)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:96)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:76)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:56)
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:80)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:64)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:324)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
    
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:88)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:64)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:324)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

    Comment


      #17
      Can anyone show a DataSource where they are getting this error?

      Comment


        #18
        ClassCastException in DataSourceLoader

        Hi All,

        So I've been banging my head against the proverbial wall for about half a day now and I just can't figure out what's going on here.

        Here's the exception:
        Code:
        Exception when loading from C:/work/iprofile/main/war/iprofile/sc/system/schema/builtinTypes.xml:
        java.io.FileNotFoundException: C:\work\iprofile\main\war\iprofile\sc\system\schema\builtinTypes.xml (The system cannot find the file specified)
        	at java.io.FileInputStream.open(Native Method)
        	at java.io.FileInputStream.<init>(Unknown Source)
        	at com.isomorphic.io.ISCFile.getInputStream(ISCFile.java:346)
        For some reason, it appears that the file "buildinTypes.xml" is not being copied over the the <app>/sc/system/schema directory like it should during the GWT compile phase. This file does appear in the SmartClient main dist directory of "isomorphic/sc/system/schema" directory. However, we've been warned against mixing SmartClient and SmartGWT, so I can't make that file available for my application.

        Now, being somewhat curious, I copied "buildinTypes.xml" to the correct location in my app and then I get this:

        Code:
        === 2010-01-28 13:40:29,349 [l0-3] INFO  RequestContext - URL: '/iprofile/sc/DataSourceLoader', User-Agent: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)': MSIE with Accept-Encoding header, ready for compressed JS
        === 2010-01-28 13:40:29,584 [l0-3] INFO  PoolManager - SmartClient pooling disabled for 'userDataSource' objects
        === 2010-01-28 13:40:29,615 [l0-3] DEBUG XML - Parsed XML from C:\work\iprofile\main\war\ds\userDataSource.ds.xml: 0ms
        === 2010-01-28 13:40:29,630 [l0-3] DEBUG XML - Parsed XML from C:\work\iprofile\main\war\iprofile\sc\system\schema\builtinTypes.xml: 15ms
        === 2010-01-28 13:40:29,662 [l0-3] WARN  BasicDataSource - userDataSource: value of field field is not a Map
        === 2010-01-28 13:40:29,662 [l0-3] ERROR DataSourceLoader - Exception while attempting to load a DataSource
        java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
        	at com.isomorphic.datasource.BasicDataSource.buildFieldData(BasicDataSource.java:303)
        	at com.isomorphic.datasource.BasicDataSource.init(BasicDataSource.java:159)
        	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:126)
        	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:163)
        	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
        	at com.isomorphic.datasource.DataSource.forName(DataSource.java:146)
        And that's about as far as I've been able to get. If I remove all "field" definitions, including the "fields" tag itself from the datasource definition xml, the datasource is properly loaded by the DataSourceLoader (albeit with no fields defined) like this:

        Code:
        {
            ID:"userDataSource",
            fields:[],
            serverType:"generic"
        }
        So from what I can tell, all the plumbing to serve up my data source is in place, it is just that the parsing/conversion step to the datasource json from the ds.xml file is barfing somewhere and with a fairly obtuse exception. Also the buildinType.xml file is not properly copied over requiring manual intervention.

        Since I can't just peruse the source code... I'm close to just hitting the pub for the rest of the day...

        Any help greatly appreciated.

        -Brian
        Attached Files

        Comment


          #19
          First of all I know I'm about to revive an old thread but I thought it might be worth it seeing that I came across this very same thing and I've managed to resolve it.

          As stated in an earlier reply this can happen if the sc/system/schema folder had been deleted for some reason. Taking it from there, this would also mean you would get this error if for some reason the path to that folder was incorrect.

          To provide some context, what I did, was to copy the sample called "built-in-ds" and tried to rename it everywhere to be what I wanted it to be called. I missed one very crucial property in the server.properties file. There is a property called "gwtModuleName", this needs to be setup correctly as I believe the path to sc/system/schema is built using this. Mine was still set to "builtinds" which meant that even though I'd renamed my module the path would still be wrong.

          TL;DR
          Open server.properties and make sure the "gwtModuleName" property is set correctly to the name of the GWT module.

          Comment

          Working...
          X