Announcement

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

    Problems loading data source

    We currently use GWT and those apps are compiled using gwt-maven plugin and injected into jetty container.

    I solved a lot of my problem by looking at the forums.

    1st one was Mavenization

    For this I have a proxy bound for pulling in dependencies
    For this I followed the instructions on
    http://confluence.bytesource.net/dis...GWT+EE+project

    The following are the dependencies in my eclipse project pom

    Code:
    <dependency>
    	<groupId>com.smartgwt</groupId>
    	<artifactId>smartgwt</artifactId>
    </dependency>
    
    
    <dependency>
    	<groupId>com.isomorphic</groupId>
    	<artifactId>isomorphic.core-rpc</artifactId>
    	<version>3.1</version>
    </dependency>   
    	
    <dependency>
    	<groupId>com.isomorphic</groupId>
    	<artifactId>isomorphic.tools</artifactId>
    	<version>3.1</version>
    </dependency>
    	   
    <dependency>
    	<groupId>commons-jxpath</groupId>
    	<artifactId>commons-jxpath</artifactId>
    	<version>1.3</version>
    </dependency>
       
    <dependency>
    	<groupId>com.smartgwtee</groupId>
    	<artifactId>smartgwtee</artifactId>
    	<version>3.1</version>
    </dependency>
    
    <dependency>
    	<groupId>isc.org.apache</groupId>
    	<artifactId>isc-jakarta-oro</artifactId>
    	<version>2.0.6</version>
    </dependency>
    Now all I am trying to do is recreate this example in our environment to see if the whole framework gels with our maven/build/embedded jetty world.

    http://www.smartclient.com/smartgwte...mple_custom_ds

    The following is my server.properties.
    Code:
    webRoot: adminui/adminui.smartcomponentui  
    
    gwtModuleName: adminui.smartcomponentui
    
    isomorphicPathRootRelative: $gwtModuleName/sc  
    
    sql.defaultDatabase: HSQLDB  
      
    sql.HSQLDB.database.type: hsqldb  
    sql.HSQLDB.interface.type: driverManager  
      
    sql.HSQLDB.driver: org.hsqldb.jdbcDriver  
    sql.HSQLDB.driver.url: jdbc:hsqldb:hsql://localhost/smartgwtee  
      
    project.datasources: $webRoot/ds  
    project.ui: $webRoot/shared/ui  
    project.apps: $webRoot/shared/app
    Notice I removed _AUTODETECT_ for this but it didn't help.

    We use a Java program to launch the GWtDevMode service as means for a custom Dev Mode. When that launches, the deve mode launches fine.

    But on executing the entry page, I see following on the server side

    Code:
    Problem loading builtinTypes.xml
    Exception when loading from __USE_CONTAINER__/isomorphic/system/schema/builtinTypes.xml:
    java.lang.NullPointerException
    	at com.isomorphic.io.ISCFile.lastModified(ISCFile.java:419)
    	at com.isomorphic.store.ProcessedFileCache.getObjectFromFile(ProcessedFileCache.java:140)
    	at com.isomorphic.xml.XML.getXMLDocument(XML.java:286)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:294)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:298)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:301)
    	at com.isomorphic.datasource.DataSource.<clinit>(DataSource.java:581)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:119)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:127)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:94)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:89)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:83)
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:126)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:94)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
    	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:326)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    and this on firebug

    Code:
    <BR>BaseServlet Global Exception<BR>
    <PRE>
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to load DataSource for ID: connectords
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:128)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:94)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    
    .....
    I am attaching a pic of the project structure (sideways due to your forum limit). As you can see the server.properties is right where you want it to be. So I believe its finding it but something else is awry.

    Unless I am missing a very subtle detail, I think this now needs your set of eyes to helps me resolve this. We would like to purchase enterprise license if all works out fine. I have not been able to even start with the SmartGWTUI and play with other options, so this is delaying our evaluation window.
    Attached Files
    Last edited by kdsingh; 6 Feb 2013, 12:37. Reason: attaching web.xml

    #2
    The error you're seeing can result from bad .gwt.xml <inherits> tags (see installation instructions) or from failing to run a GWT compile before launching the server.

    However, it also seems that your server.properties file is not being used, because it attempts to define a webroot setting but the setting being used to find builtinTypes.xml is the default setting.

    server.properties needs to be on the classpath in order to be found, and there are logs at startup about whether it was found.

    Note also that your setting for webRoot doesn't make much sense - if you're going to set it manually, it would tend to have to be an absolute path.

    Also just FYI, the Maven approach you're using is in the midst of being superseded by a new approach.

    Comment


      #3
      OK I got it moving ahead while including the resources in classpath in my launcher in eclipse for now.

      Going ahead with evaluating but now stuck on this issue. I am seeing this in the browser

      Code:
      Error :Cannot change configuration property 'clientOnly' to true after the component has been created.
      My entry point code is

      Code:
        public void onModuleLoad() {  
      
            DataSource customDS = DataSource.get("connectorDataSource");  
            customDS.setClientOnly(true);
            
            final ListGrid userList = new ListGrid();  
            userList.setWidth(600);  
            userList.setHeight(224);  
            userList.setDataSource(customDS);  
            userList.setCanEdit(true);  
            userList.setCanRemoveRecords(true);  
            userList.setLeaveScrollbarGap(false);  
            userList.setDataFetchMode(FetchMode.LOCAL);  
            userList.setAutoFetchData(true);  
            
            userList.setFields(  
                    new ListGridField("userName"),  
                    new ListGridField("job"),  
                    new ListGridField("email"),  
                    new ListGridField("employeeType"),  
                    new ListGridField("salary")  
                    );  
      
            IButton addButton = new IButton("Create User");  
            addButton.setWidth(110);  
            addButton.addClickHandler(new ClickHandler() {  
                @Override
                public void onClick(ClickEvent event) {  
                    userList.startEditingNew();  
                }  
            });  
      
            VLayout layout = new VLayout(15);  
            layout.addMember(userList);  
            layout.addMember(addButton);  
      
            layout.draw();  
        }
      I am confused as to why I have to set the clientonly true. I figures this was a 60 day trial full license so we can test your server side features too with out stuff.

      Note that all I am doing right now is using your example from

      http://www.smartclient.com/smartgwte...mple_custom_ds

      and trying to run it our environment.

      if I do not add
      Code:
       customDS.setClientOnly(true);
      above, I get this

      Code:
      DataSource: connectorDataSource: attempt to use DataSource of type iscServer without SmartClient Server option. Please either set clientOnly: true for one-time fetch against dataURL/testFileName or upgrade to SmartClient Pro, Power or Enterprise
      Stack trace:
      
      
          DataSource.sendDSRequest(_1=>Obj)
          DataSource.performDSOperation(_1=>"fetch", _2=>null, _3=>Obj, _4=>Obj)
          DataSource.fetchData(_1=>null, _2=>Obj, _3=>Obj)
          ResultSet.fetchRemoteData(_1=>null, _2=>undef, _3=>undef)
          ResultSet.getRange(_1=>0, _2=>55, _3=>undef, _4=>undef)
          ListGrid.requestVisibleRows()
          Canvas.filterWithCriteria(_1=>Obj, _2=>Obj{ID:connectorDataSource_fetch}, _3=>Obj)
          Canvas.$wo(_1=>"fetch", _2=>undef, _3=>null, _4=>Obj)
          [a]MathFunction.invokeSuper(_1=>null, _2=>"$wo", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
          [a]MathFunction.Super(_1=>"$wo", _2=>Array[4], _3=>[object Arguments])
          ListGrid.$wo(_1=>"fetch", _2=>undef, _3=>null, _4=>Obj, _5=>undef)
          Canvas.fetchData(_1=>undef, _2=>null, _3=>Obj)
          Canvas.doInitialFetch()
          Canvas.draw(_1=>undef, undef, undef, undef, undef, undef, undef, undef)
          ** recursed on [a]MathFunction.invokeSu
      and when I click OK on that dialog. Grid does show up but it keeps showing "Loading"
      Last edited by kdsingh; 7 Feb 2013, 07:28.

      Comment


        #4
        Just a guess here, but it looks like you might have both LGPL and EE versions on your classpath. Hard to tell what's going on with that pom.

        For what it's worth, and with all due respect to the author, the approach to Maven outlined in that post you linked to before is really not what you want to do. Take 10 minutes and start over with the plugin Isomorphic pointed you at in their reply: http://forums.smartclient.com/showthread.php?t=24921

        You might also find that this Maven archetype is useful to you, although it was admittedly built around a previous mavenizer - you'll need to change groupIds, etc. but I would expect that to be reasonably painless.

        Comment


          #5
          Thanks bbryuyn,

          I believe that was it as my maven was pulling in LGPL smart GWT as well.

          Comment

          Working...
          X