Announcement

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

    DataSourceLoader

    Hi, great Gurus !

    I'm trying to make work in my project the example of SmartGWT's documentation (Part 5. Databinding -> DataSource).

    I'm using:
    - SmartGWT 2.4
    - Firefox 4.01

    I think the main problem comes from the the path of DatsSourceLoader.

    Which servlet-mapping should I put in web.xml ?
    Here is mine:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    
    <web-app>
      
    	<session-config>
    		<session-timeout>1</session-timeout>
    	</session-config>
      
      <!-- Servlets -->
      <servlet>
        <servlet-name>tipiServlet</servlet-name>
        <servlet-class>com.tipi_v1.server.TipiServiceImpl</servlet-class>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>tipiServlet</servlet-name>
        <url-pattern>/tipi_v1/tipi</url-pattern>
      </servlet-mapping>
      
      <!-- Default page to serve -->
      <welcome-file-list>
        <welcome-file>Tipi_v1.html</welcome-file>
      </welcome-file-list>
    
    </web-app>
    or should I add a servlet ? Like this ?

    Code:
     <servlet>
         <servlet-name>DataSourceLoader</servlet-name>
         <servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class>
       </servlet>
    Which is the path of the DatasSourceLoader I should put in the header of Tipi_v1.html :
    I'm trying this but it doesn't work:

    Code:
    <script src="/src/DataSourceLoader?dataSource=contacts"></script>
    When I try this:

    Code:
    DataSource contactsDS = DataSource.get("contacts");
    		ListGrid grid = new ListGrid(); 
    		grid.setDataSource(contactsDS);

    this is the result in "development mode":
    Code:
    18:01:35.830 [ERROR] [tipi_v1] Failed to load module 'tipi_v1' from user agent 'Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1' at 127.0.0.1:63680





    Console Logs:
    Code:
    log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    [WARN] 404 - GET /src/DataSourceLoader?dataSource=contacts (127.0.0.1) 1406 bytes
       Request headers
          Host: 127.0.0.1:8888
          User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
          Accept: */*
          Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
          Accept-Encoding: gzip, deflate
          Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
          Keep-Alive: 115
          Connection: keep-alive
          Referer: http://127.0.0.1:8888/Tipi_v1.html?gwt.codesvr=127.0.0.1:9997
          Cookie: JSESSIONID=slr6zuokurx8
          Cache-Control: max-age=0
       Response headers
          Content-Type: text/html; charset=iso-8859-1
          Content-Length: 1406
    [WARN] 404 - GET /src/DataSourceLoader?dataSource=contacts (127.0.0.1) 1406 bytes
       Request headers
          Host: 127.0.0.1:8888
          User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
          Accept: */*
          Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
          Accept-Encoding: gzip, deflate
          Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
          Keep-Alive: 115
          Connection: keep-alive
          Cookie: JSESSIONID=slr6zuokurx8
          Cache-Control: max-age=0
          Referer: http://127.0.0.1:8888/Tipi_v1.html?gwt.codesvr=127.0.0.1:9997
       Response headers
          Content-Type: text/html; charset=iso-8859-1
          Content-Length: 1406

    Code:
    com.smartgwt.client.core.JsObject$SGWT_WARN: 17:43:17.619:WARN:Log:TypeError: isc.StatefulCanvas.$cc is undefined
        Img.initWidget(=&gt;{Obj}, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef, undefined=&gt;undef)
        Canvas.init(_1=&gt;{Obj},  _2=&gt;undef,  _3=&gt;undef,  _4=&gt;undef,  _5=&gt;undef,  _6=&gt;undef,  _7=&gt;undef,  _8=&gt;undef,  _9=&gt;undef,  _10=&gt;undef,  _11=&gt;undef,  _12=&gt;undef,  _13=&gt;undef)
        Class.completeCreation(_1=&gt;{Obj},  _2=&gt;undef,  _3=&gt;undef,  _4=&gt;undef,  _5=&gt;undef,  _6=&gt;undef,  _7=&gt;undef,  _8=&gt;undef,  _9=&gt;undef,  _10=&gt;undef,  _11=&gt;undef,  _12=&gt;undef,  _13=&gt;undef)
        [c]Class.create(_1=&gt;{Obj})
        unnamed()
        unnamed(null, undef)
        [c]Page.handleEvent(_1=&gt;null,  _2=&gt;&quot;load&quot;)
        [c]EventHandler.handleLoad(_1=&gt;[object Event])
        unnamed()
    
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
        at java.lang.Thread.run(Thread.java:662)

    And this "tipi_v1/war/ds/contact.ds.xml" (the exact copy of the example of the doc):

    Code:
    <DataSource ID="contacts">
    <fields>
    <field primaryKey="true"
    name="id" hidden="true" type="sequence" />
    <field name="salutation" title="Title" type="text" >
    <valueMap>
    <value>Ms</value>
    <value>Mr</value>
    <value>Mrs</value>
    </valueMap>
    </field>
    <field name="firstname" title="First Name" type="text" />
    <field name="lastname" title="Last Name" type="text" />
    <field name="birthday" title="Birthday" type="date" />
    <field name="employment" title="Status" type="text" >
    <valueMap>
    <value>Employed</value>
    <value>Unemployed</value>
    </valueMap>
    </field>
    <field name="bio" title="Bio" type="text"
    length="2000" />
    <field name="followup" title="Follow up" type="boolean" />
    </fields>
    </DataSource>
    I tried to put the same file in : "tipi_v1/src/com/tipi_v1/shared/ds/contact.ds.xml". It doesn't change anything.

    If anyone has got an idea, thanx 1000 times !

    #2
    Here are the correct installation instructions, including troubleshooting steps. However, from the errors you're getting, you skipped a number of these steps, so start over from the top.

    Comment


      #3
      I'm trying to install it but I've got a few questions:

      1. I'm using SmartGWT 2.4 and not SmartGWT Pro/EE.
      Should I still follow the page you advised me ? Or is there another more appropriate page ?

      2. Whre can I find (or create myself) these 2 files: server.properties, log4j.config.xml ?

      3. Am I obliged to put in the build path every file I see on this linked page ?

      "For server-side .jars, dependencies are documented here."
      http://www.smartclient.com/smartgwte...endencies.html

      And on that page, some libs are unfindable. Can't they put links ?

      Thanx a lot !
      Last edited by Manu549651; 27 May 2011, 02:03.

      Comment


        #4
        If you're doing something with the DataSourceLoader, then yes, you're using Pro/EE.

        Everything the instructions refer to are in the package you downloaded, and the instructions tell you exactly where. Slow down, and read carefully.

        Comment


          #5
          As I can see in SmartGWT Overview, it is possible to use databinding with SmartGWT LGPL. But can I use Hibernate (to get datas from MySQL server) with this kind of databinding ?
          And how can I do this without using a DataSourceLoader ?
          Thanx !

          Comment


            #6
            Hmm. The QuickStart Guide also explains how to integrate with the server if you aren't using our server software, but that's more challenging. You probably want to continue with Pro+.

            Again these install instructions are used every day, are complete, and work. Just be sure to follow them very carefully.

            Comment


              #7
              What is Pro+ ? I want to do it with SmartGWT LGPL, not with any other.
              And for which reasons is it gonna be "more challenging" ?
              Thanx !

              Comment

              Working...
              X