Announcement

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

    Socket Creation Error

    I'm trying out the EE version of SmartGWT 2.3, and I'm running into a problem fetching a datasource depending on in which file the datasource is being called.

    Setting the datasource of a listgrid in the entrypoint class with onModuleLoad works fine. If I create a new class and try to set the datasource, I get the following error:
    Code:
    RPCManager:socket creation error
    I've tried passing the datasource from the entrypoint class to the new class and I get the same error. The datasource is the example worldDS.ds.xml file, and the data file it points to is the example world.data.xml file.

    I'm testing this on localhost, using Eclipse Galileo, with the same file structure as the examples.

    Any ideas?
    Last edited by bartyhoho; 11 Aug 2010, 09:39.

    #2
    Please show the complete error trace, not just that message, as well as the .ds.xml files involved.

    If you are setting a dataURL somewhere, make sure it *does not* include a hostname, even if the hostname is "localhost".

    Comment


      #3
      I'm not using the dataURL. I'm setting the datasource with:
      Code:
      listGrid.setDataSource(DataSource.get("worldDS"));
      Stacktrace:
      Code:
      com.smartgwt.client.core.JsObject$SGWT_WARN: 11:46:27.185:WARN:SectionStack:isc_SectionStack_0:members array: [ImgSectionHeader ID:isc_ImgSectionHeader_0],[HTMLFlow ID:isc_HTMLFlow_1],[ImgSectionHeader ID:isc_ImgSectionHeader_1],[ImgSectionHeader ID:isc_ImgSectionHeader_2],,[HTMLFlow ID:isc_HTMLFlow_0] includes null entry at position 4. Removing
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          at java.lang.reflect.Constructor.newInstance(Unknown Source)
          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.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
          at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java)
          at com.smartgwt.sample.client.CustomDS.onModuleLoad(CustomDS.java:146)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:369)
          at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
          at java.lang.Thread.run(Unknown Source)
      Attached Files

      Comment


        #4
        Um, that appears to be a completely unrelated trace. This new trace is just a warning, and indicates you're passing null to SectionStackSection.addItem() or similar.

        Let us know if you have details on that other error. This FAQ covers what to check if you're having trouble loading or interacting with a DataSource.

        Comment


          #5
          Sorry about the warning trace. Here's the error:
          Code:
          === 2010-08-11 14:06:18,139 [l0-0] ERROR SQLConnectionManager - [builtinApplication.worldDS_fetch] Caught exception
          java.sql.SQLException: socket creation error
          	at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
          	at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
          	at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
          	at org.hsqldb.jdbcDriver.connect(Unknown Source)
          	at java.sql.DriverManager.getConnection(Unknown Source)
          	at java.sql.DriverManager.getConnection(Unknown Source)
          	at com.isomorphic.sql.PoolableSQLConnectionFactory.makeUnpooledObject(PoolableSQLConnectionFactory.java:218)
          	at com.isomorphic.sql.PoolableSQLConnectionFactory.makeObject(PoolableSQLConnectionFactory.java:297)
          	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:74)
          	at com.isomorphic.sql.SQLConnectionManager.getConnection(SQLConnectionManager.java:150)
          	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:290)
          	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:267)
          	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:261)
          	at com.isomorphic.sql.SQLDriver.getScalarResult(SQLDriver.java:354)
          	at com.isomorphic.sql.SQLDriver.executeScalar(SQLDriver.java:552)
          	at com.isomorphic.sql.SQLDataSource.executeWindowedSelect(SQLDataSource.java:1342)
          	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1158)
          	at com.isomorphic.sql.SQLDataSource.execute(SQLDataSource.java:251)
          	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
          	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
          	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
          	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1382)
          	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155)
          	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106)
          	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
          	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
          	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
          	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
          	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
          	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
          	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
          	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
          	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
          	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
          	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          	at org.mortbay.jetty.Server.handle(Server.java:324)
          	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
          	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
          	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
          	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
          	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
          	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
          	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
          === 2010-08-11 14:06:18,140 [l0-0] WARN  RequestContext - dsRequest.execute() failed: 
          java.sql.SQLException: socket creation error
          	at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
          	at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
          	at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
          	at org.hsqldb.jdbcDriver.connect(Unknown Source)
          	at java.sql.DriverManager.getConnection(Unknown Source)
          	at java.sql.DriverManager.getConnection(Unknown Source)
          	at com.isomorphic.sql.PoolableSQLConnectionFactory.makeUnpooledObject(PoolableSQLConnectionFactory.java:218)
          	at com.isomorphic.sql.PoolableSQLConnectionFactory.makeObject(PoolableSQLConnectionFactory.java:297)
          	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:74)
          	at com.isomorphic.sql.SQLConnectionManager.getConnection(SQLConnectionManager.java:150)
          	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:290)
          	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:267)
          	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:261)
          	at com.isomorphic.sql.SQLDriver.getScalarResult(SQLDriver.java:354)
          	at com.isomorphic.sql.SQLDriver.executeScalar(SQLDriver.java:552)
          	at com.isomorphic.sql.SQLDataSource.executeWindowedSelect(SQLDataSource.java:1342)
          	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1158)
          	at com.isomorphic.sql.SQLDataSource.execute(SQLDataSource.java:251)
          	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
          	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
          	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
          	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1382)
          	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155)
          	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106)
          	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
          	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
          	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
          	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
          	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
          	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
          	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
          	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
          	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
          	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
          	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          	at org.mortbay.jetty.Server.handle(Server.java:324)
          	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
          	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
          	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
          	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
          	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
          	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
          	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
          I looked at the FAQ and verified that the server.properties, web.xml, etc. are correct. I also moved the listGrid from the new class back into the entrypoint, and I get the data.

          Comment


            #6
            First, a sanity check: are you intending to use HSQL? That's what the trace shows.

            If you are, the HSQL database is launched by the HSQLServletContextListener in your web.xml, and this trace suggests it hasn't been started when your code runs. This might be because you've placed the code into a static initializer or in some other way circumvented the servlet lifecycle. Or it might be because you're launching in such a way that a different web.xml is in use.

            If you have any further trouble with this, just connect to the database you really intend to use in your final application. The HSQL database is just there for early prototyping.

            Comment


              #7
              Ahhh, success. But I'm a little troubled by why. I don't want to use HSQL, but I had left the references to it in server.properties. After commenting out the HSQL stuff in server.properties, the data loads normally from the XML file.

              Does this mean that I can't use a mix of data sources?

              Also, even though I commented all of the HSQL stuff in server.properties, I'm still seeing what appears to be database connections in the trace:
              Code:
              === 2010-08-11 14:32:50,641 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] org.hsqldb.jdbcDriver lookup successful
              === 2010-08-11 14:32:50,641 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:file:C:\apache-tomcat-6.0.26\webapps\customds\war/WEB-INF/db/hsqldb/isomorphic
              === 2010-08-11 14:32:50,641 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Passing JDBC URL only to getConnection
              === 2010-08-11 14:32:51,219 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Returning unpooled Connection
              === 2010-08-11 14:32:51,219 [l0-4] INFO  SQLDriver - [builtinApplication.worldDS_fetch] Executing SQL query on 'HSQLDB': SELECT COUNT(*) FROM worldDS WHERE ('1'='1')
              === 2010-08-11 14:32:51,258 [l0-4] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Using SQL Limit query
              === 2010-08-11 14:32:51,258 [l0-4] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT LIMIT 0 75  worldDS.countryName, worldDS.area, worldDS.gdp, worldDS.countryCode, worldDS.continent, worldDS.independence, worldDS.government, worldDS.capital, worldDS.pk, worldDS.population FROM worldDS WHERE ('1'='1')
              === 2010-08-11 14:32:51,259 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:file:C:\apache-tomcat-6.0.26\webapps\customds\war/WEB-INF/db/hsqldb/isomorphic
              === 2010-08-11 14:32:51,259 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Passing JDBC URL only to getConnection
              === 2010-08-11 14:32:51,259 [l0-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Returning unpooled Connection
              === 2010-08-11 14:32:51,265 [l0-4] INFO  DSResponse - [builtinApplication.worldDS_fetch] DSResponse: List with 75 items
              [WARN] Server class 'org.apache.commons.dbcp.PoolableConnection' could not be found in the web app, but was found on the system classpath
              I don't have anything called builtinApplication.

              Comment


                #8
                You're not loading from an XML file, you're still loading from HSQL. The DataSource file says serverType="sql", so that's what's used.

                Whatever you changed probably had no effect except to cause Eclipse to un-wedge itself from a bad state it had gotten into.

                What's your long-term plan here? Presumably it's not using XML flat files. Whether you long term plan involves SQL or custom Java, you should probably continue to prototype against HSQL rather than switch to flat files.

                Comment

                Working...
                X