Announcement

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

    CustomDataSource

    Hi,

    I am a newbie - so hopefully its not a complete failure i have in mind !
    I tried to use the ORM Data Source example as a trial - to see how it works but i always get a
    Code:
    "Transport error - HTTP code 404 for URL: customDataSource_user"
    On the server is see that the datasource is loaded as i see the Parsed XML from .....customDataSource_user.ds.xml

    When i then go to the page which has the implementation:
    Code:
    DataSource dataSource = new DataSource("customDataSource_user");
    i then get the the mentioned error !
    On the server is see that the request is received:
    Code:
    INFO RequestContext - URL: '/customerDataSource_user', .......
    What have i done wrong ??

    Thanks for your help !
    Johannes
    Last edited by jhollerer; 6 Jan 2010, 10:36. Reason: Chaning the Subject

    #2
    A 404 error indicates that you either haven't registered the DataSourceLoader servlet at all (in web.xml) or your <script src=> tag in your host .html file has the wrong URL for it.

    Comment


      #3
      MyConfig

      Thanks for the reply - but the servlet should be active - as its defined in the web.xml and i see in the server logs that the Datasource is parsed :

      Code:
      DEBUG XML - Parsed XML from C:\..........\war\shared\ds\customDataSource_user.ds.xml
      See below my config (except the path name) !

      web.xml
      Code:
          <servlet>
              <servlet-name>DataSourceLoader</servlet-name>
              <servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class>
          </servlet>
      server.properties
      Code:
      project.datasources: $webRoot/shared/ds

      .html
      Code:
      <script src="isomorphic/DataSourceLoader?dataSource=customDataSource_user"></script>

      Comment


        #4
        Corrected Path - still not working

        Hi,

        I corrected the path - but still the server code is not executed !

        I really took the config from the examples and modified only the class to load !

        The DataSource definition:
        Code:
        <DataSource
            ID="customDataSource_user"
            serverConstructor="com.amergy.smartgwt.test.server.UserDataSource"
        >
            <fields>
                <field name="userName"        type="text"           length="128"      required="true"/>
                <field name="employeeId"      type="sequence"       primaryKey="true" hidden="true"/>
                <field name="job"             title="Job 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="salary"          title="Salary"        type="float"/>
            </fields>
            
        </DataSource>

        the only thing i see in the Console is :

        Code:
        21:56:37.036:XRP8:WARN:ResultSet:isc_ResultSet_8 (created by: isc_OID_2):Bad data returned, ignoring: "<DataSource
            ID="customDataSource_user"
            serverConstructor="com.amergy.smartgwt.test.server.UserDataSource"
        >
            <fields>
                <field name="userName"        type="text"           length="128"      required="true"/>
                <field name="employeeId"      type="sequence"       primaryKey="true" hidden="true"/>
                <field name="job"             title="Job 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="salary"          title="Salary"        type="float"/>
            </fields>
            
        </DataSource>
        Out of this two questions:

        1) Why doesnt he execute my class (which has the functions defined)
        2) Why is the client downloading the datasource definition - as the server should process the request !!

        thanks
        johannes

        Comment


          #5
          OK, you're providing us incorrect diagnostic information then, as this will never lead to a 404.

          Your new report is even stranger. It could seemingly only result from setting the dataURL of one DataSource to point to the actual file location of a DataSource (without going through the DataSourceLoader).

          You may think you've just copied the sample correctly but it's clear you have not. We'd suggest starting over and noting down each change you're making.

          Comment


            #6
            Incorrect Information ??

            Why should i supply incorrect information ??

            The error was 404 - then i corrected the path - as described - thats working now !

            Still having the problem that the server side code is not involved !!

            I already started 3 times - but i cannot figure out what i do wrong !

            br
            johannes

            Comment


              #7
              Running

              Hi,

              I got it running - dont know why - but i wil try to summarize my steps - and the steps leading me to the success!!

              thanks for the fast help !

              br
              johannes

              Comment

              Working...
              X