Announcement

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

    Error loading datasources with includeFrom fields in 4.0 beta

    Hi Isomorphic.
    We are trying out the smartgwt 4.0d, and we are experiencing som problems loading the (dmi-) datasources via the datasourceLoader servlet. The datasources contains includefrom-fields
    Code:
    === 2013-04-09 11:27:03,599 [l0-8] INFO  ISCInit - Isomorphic SmartClient/SmartGWT Framework - Initializing
    === 2013-04-09 11:27:03,610 [l0-8] INFO  ConfigLoader - Attempting to load framework.properties from CLASSPATH
    === 2013-04-09 11:27:03,754 [l0-8] INFO  ConfigLoader - Successfully loaded framework.properties from CLASSPATH at location: jar:file:/C:/Users/ESA/.m2/repository/com/isomorphic/smartgwt/isomorphic-core-rpc/4.0-d20130407/isomorphic-core-rpc-4.0-d20130407.jar!/framework.properties
    === 2013-04-09 11:27:03,754 [l0-8] INFO  ConfigLoader - Attempting to load project.properties from CLASSPATH
    === 2013-04-09 11:27:03,756 [l0-8] INFO  ConfigLoader - Unable to locate project.properties in CLASSPATH
    === 2013-04-09 11:27:03,761 [l0-8] INFO  ConfigLoader - Successfully loaded isc_interfaces.properties from CLASSPATH at location: jar:file:/C:/Users/ESA/.m2/repository/com/isomorphic/smartgwt/isomorphic-core-rpc/4.0-d20130407/isomorphic-core-rpc-4.0-d20130407.jar!/isc_interfaces.properties
    === 2013-04-09 11:27:03,761 [l0-8] INFO  ConfigLoader - Attempting to load server.properties from CLASSPATH
    === 2013-04-09 11:27:03,774 [l0-8] INFO  ConfigLoader - Successfully loaded server.properties from CLASSPATH at location: file:/C:/Projects/ESA/workspace/esa-ui/target/esa-ui/WEB-INF/classes/server.properties
    === 2013-04-09 11:27:03,782 [l0-8] INFO  Logger - Logging system started.
    === 2013-04-09 11:27:03,784 [l0-8] INFO  ISCInit - Auto-detected webRoot - using: C:\Projects\ESA\workspace\esa-ui\target\esa-ui
    === 2013-04-09 11:27:03,786 [l0-8] INFO  ISCInit - Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v9.0d_2013-04-07/Pro Deployment 2013-04-07) - Initialization Complete
    === 2013-04-09 11:27:03,894 [0-15] INFO  PoolManager - SmartClient pooling started for 'simpleTypes' objects
    === 2013-04-09 11:27:04,130 [0-15] ERROR DataSourceLoader - Exception while attempting to load a DataSource
    java.lang.NullPointerException
    	at com.isomorphic.datasource.DataSource.getIncludeFromInfo(DataSource.java:4214)
    	at com.isomorphic.datasource.DataSource.getIncludeFromInfo(DataSource.java:4276)
    	at com.isomorphic.datasource.BasicDataSource.init(BasicDataSource.java:511)
    	at com.isomorphic.datasource.DataSource.initialize(DataSource.java:452)
    	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:166)
    	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:437)
    	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:228)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:220)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:209)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:130)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:138)
    	at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:964)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:84)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:95)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:86)
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:128)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:96)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    ...
    The Exception does not list the datasource in question, but it seems to be this definition failing:
    Code:
    <DataSource ID="dokmal" serverType="generic" dataSourceVersion="1" beanClassName="com.edb.esa.dto.dokument.DokmalDto">
        <fields>
            <field name="betegn" type="text"/>
            <field name="state" type="enum">
                <valueMap>
                        <value id="NEW">New</value>
                        <value id="CHANGED">Changed</value>
                        <value id="UNCHANGED">Unchanged</value>
                        <value id="DELETED">Deleted</value>
                </valueMap>
            </field>
            <field name="id" type="integer" hidden="true" primaryKey="true"/>
            <field name="malart" type="text"/>
            <field name="kode" type="text"/>
            <field name="ndoktype" foreignKey="ndoktype.doktype"/>
            <field name="maltype" type="text"/>
            <field name="jpart" foreignKey="ndoktype.art"/>
            <field name="kategori" type="text"/>
            <field name="admid" type="integer"/>
            <field name="ejfid" includeFrom="ndoktype.efjid"/>
        </fields>
    <!--     <serverObject lookupStyle="new" className="com.edb.esa.server.ds.HjelperegisterDMI" />     -->
        <serverObject lookupStyle="spring" bean="hjelperegisterDMI" />    
        <xmlFromConfig>true</xmlFromConfig>
        <generatedBy>SC_SNAPSHOT-2012-03-19_v8.2p/Pro Deployment 2012-03-19</generatedBy>
    </DataSource>
    The ndoktype-datasource is listed below, and I suspect it is the dual primary key which might be causing problems. Note that it works fine in 3.1p.

    Code:
    <DataSource ID="ndoktype" serverType="generic" dataSourceVersion="1" beanClassName="com.edb.esa.dataobjects.journalpost.Noarkdoktype">
        <fields>
            <field name="doktype" type="text" primaryKey="true"/>
            <field name="betegn" type="text"/>
            <field name="fullBetegn" type="text"/>
            <field name="ekstprod" type="text"/>
            <field name="ekstmot" type="text"/>
            <field name="art" type="text" primaryKey="true"/>
            <field name="ejfid" type="integer"/>
        </fields>
    <!--     <serverObject lookupStyle="new" className="com.edb.esa.server.ds.HjelperegisterDMI" />     -->
        <serverObject lookupStyle="spring" bean="hjelperegisterDMI" />    
        <xmlFromConfig>true</xmlFromConfig>
    </DataSource>
    Regards
    Hans Petter Simonsen - EVRY Norway

    #2
    included field name is miss-spelled:
    Code:
    <field name="ejfid" includeFrom="ndoktype.efjid"/>
    Fix:
    Code:
    <field name="ejfid" includeFrom="ndoktype.ejfid"/>

    Comment


      #3
      Very well observed, sabaka!
      Thanks.

      Comment

      Working...
      X