Announcement

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

    DataSourceLoader XML->JSON Issues

    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.

    Any help greatly appreciated.

    -Brian
    Attached Files

    #2
    In addition to builtinTypes.xml, you're missing all the files normally under sc/system/schema, eg, ListGrid.ds.xml.

    Comment


      #3
      How to fix that?

      How should I proceed on something like this?

      My application appears to compile and work properly when deployed, all except for the data source not loading correctly. If I use a client-only datasource, the table shows up nicely, widgets work, etc.

      Do you have any suggestions on ensuring the right files are present in my application?

      Comment


        #4
        You haven't mentioned whether your using an IDE or command line or what, but the sample projects provided with EE correctly copy the files with both command-line and Eclipse.

        Your module includes could also be wrong, compare them to the samples as well.

        Comment


          #5
          Yep, that was it!

          The module includes was not correct:

          this:
          <inherits name="com.smartgwtee.SmartGwtEE"/>

          instead of:
          <inherits name="com.smartgwtee.SmartGwt"/>

          makes a load of difference....

          Thanks again for the hint!

          Comment

          Working...
          X