Announcement

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

    problem importing datasources and saving views with smartgwtee 2.3

    Hi

    I'm trying to display data from my wamp server mysql database in the admin console. it connects to the database and displays the fields. when i try to get in to import the values it brings the error in the eclipse console:

    rebuilding table: tenders
    === 2010-08-08 22:22:35,079 [l0-1] DEBUG PoolableSQLConnectionFactory - Returning pooled Connection
    === 2010-08-08 22:22:35,080 [l0-1] DEBUG SQLImport - Creating constraint of type PRIMARY KEY on fields [refNo., tenderTitle, fileStream, fileName, dateUploaded, tenderID]
    issuing table drop command: DROP TABLE tenders
    === 2010-08-08 22:22:35,099 [l0-1] DEBUG PoolableSQLConnectionFactory - Returning pooled Connection
    === 2010-08-08 22:22:35,100 [l0-1] INFO SQLDriver - Executing SQL update on 'Mysql': DROP TABLE tenders
    === 2010-08-08 22:22:35,121 [l0-1] INFO SQLDriver - Execute of update: DROP TABLE tenders on db: Mysql threw exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'tenders' - assuming stale connection and retrying update.
    === 2010-08-08 22:22:35,134 [l0-1] DEBUG PoolableSQLConnectionFactory - Returning pooled Connection
    issuing table create command: CREATE TABLE tenders (refNo. varchar(50) default '' not null, tenderTitle varchar(60) default '' not null, fileStream varchar(70) default '' not null, fileName varchar(60) default '' not null, dateUploaded datetime not null, tenderID varchar(30) default '' not null, CONSTRAINT tenders_UI PRIMARY KEY (refNo., tenderTitle, fileStream, fileName, dateUploaded, tenderID))ENGINE=InnoDB
    === 2010-08-08 22:22:35,135 [l0-1] INFO SQLDriver - Executing SQL update on 'Mysql': CREATE TABLE tenders (refNo. varchar(50) default '' not null, tenderTitle varchar(60) default '' not null, fileStream varchar(70) default '' not null, fileName varchar(60) default '' not null, dateUploaded datetime not null, tenderID varchar(30) default '' not null, CONSTRAINT tenders_UI PRIMARY KEY (refNo., tenderTitle, fileStream, fileName, dateUploaded, tenderID))ENGINE=InnoDB
    === 2010-08-08 22:22:35,141 [l0-1] INFO SQLDriver - Execute of update: CREATE TABLE tenders (refNo. varchar(50) default '' not null, tenderTitle varchar(60) default '' not null, fileStream varchar(70) default '' not null, fileName varchar(60) default '' not null, dateUploaded datetime not null, tenderID varchar(30) default '' not null, CONSTRAINT tenders_UI PRIMARY KEY (refNo., tenderTitle, fileStream, fileName, dateUploaded, tenderID))ENGINE=InnoDB on db: Mysql threw exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(50) default '' not null, tenderTitle varchar(60) default '' not null, fi' at line 1 - assuming stale connection and retrying update.
    === 2010-08-08 22:22:35,152 [l0-1] DEBUG PoolableSQLConnectionFactory - Returning pooled Connection
    === 2010-08-08 22:22:35,155 [l0-1] ERROR BuiltinRPC - There was a problem importing datasource 'dataSource0'. The error report below may indicate what the problem was.

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(50) default '' not null, tenderTitle varchar(60) default '' not null, fi' at line 1
    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.mysql.jdbc.Util.handleNewInstance(Util.java:409)
    at com.mysql.jdbc.Util.getInstance(Util.java:384)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
    at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:450)
    at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:422)
    at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:503)
    at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:360)
    at com.isomorphic.tools.SQLImport.processSQLDataSource(SQLImport.java:472)
    at com.isomorphic.tools.SQLImport.processDataSource(SQLImport.java:235)
    at com.isomorphic.tools.AdminConsole.importDataSources(AdminConsole.java:293)
    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.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:879)
    at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:734)
    at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:305)
    at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:66)
    at com.isomorphic.rpc.RPCRequest.execute(RPCRequest.java:229)
    at com.isomorphic.servlet.IDACall.handleRPCRequest(IDACall.java:201)
    at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:102)
    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-08 22:22:35,155 [l0-1] DEBUG RPCDMI - rpc returned RPCResponse
    === 2010-08-08 22:22:35,155 [l0-1] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2010-08-08 22:22:35,156 [l0-1] INFO Compression - /builtinds/sc/IDACall: 4861 -> 1270 bytes

    and in the admin console:

    There was a problem importing datasource 'dataSource0'. The error report below may indicate what the problem was.

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(50) default '' not null, tenderTitle varchar(60) default '' not null, fi' at line 1
    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.mysql.jdbc.Util.handleNewInstance(Util.java:409)
    at com.mysql.jdbc.Util.getInstance(Util.java:384)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
    <br><br>...(3673 bytes truncated - set isc.RPCManager.maxErrorMessageLength > 1000 to see more or check the Developer Console for full error).

    I'm not sure where i can change the sql syntax.

    Then with saving a view from visual builder, it brings the error:

    === 2010-08-08 22:36:33,796 [l0-4] ERROR DSRequest - Couldn't fetch app definition
    java.lang.Exception: Unable to instantiate com.isomorphic.tools.AdminConsole - check the appImplementer setting in the app file for appID: adminConsole and ensure that your class has a public zero-argument constructor - actual error was: java.lang.ClassCastException: com.isomorphic.tools.AdminConsole cannot be cast to com.isomorphic.application.AppBase
    at com.isomorphic.application.AppBase.findByAppID(AppBase.java:206)
    at com.isomorphic.datasource.DSRequest.getApp(DSRequest.java:1656)
    at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:236)
    at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:378)
    at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:1464)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:304)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:332)
    at org.apache.jsp.builtinds.tools.visualBuilder.vbOperations_jsp._jspService(vbOperations_jsp.java:87)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    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)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    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)
    [WARN] /builtinds/tools/visualBuilder/vbOperations.jsp
    java.lang.NullPointerException
    at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:247)
    at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:378)
    at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:1464)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:304)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:332)
    at org.apache.jsp.builtinds.tools.visualBuilder.vbOperations_jsp._jspService(vbOperations_jsp.java:87)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    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)

    checked online but wasnt able to find any solutions

    #2
    It's probably that column named "refNo.". Try setting:

    Code:
    sql.mysql.qualityColumnNames:true
    In your server.properties file.

    Comment


      #3
      Hi

      I tried adding that to my server.properties but it didnt work. instead now when i try to import data from my mysql database it still just displays the table fields only and the table itself is deleted from the mysql database and I have to create it over and over with sample data.

      Comment


        #4
        The existing table is deleted if and only if you check the box telling the Admin Console to delete the existing table.

        If you're having trouble importing, post the logs of the problem.

        But overall, you probably want to just remove the trailing "." from the refNo column name in the database. SmartGWT already gives you a way to provide a user-visible title for a DataSource field via field.title. Puting the "." into the actual database column name is just going to make it harder to use several different tools (not just those included with SmartGWT).

        Comment


          #5
          I am seeing he same problem as dahaka when attempting to import a datasource in 2.3. I get the same error message in the admin console as what dahaka posted. When I switch back to EE2.1, I am able to import the same ds.xml file into my mysql database.

          Comment


            #6
            Do you also have a column name with a "." in it?

            Please post the log for your error.

            Comment


              #7
              Here are two very simple ds.xml files that I was using to figure out the problem. Both threw exceptions in Admin in 2.3 and both worked in 2.1. Both were generated using visual builder, though another I hand coded also showed the same pattern.
              Attached Files

              Comment


                #8
                Your problem does not appear to be the same as the other poster - this is why we asked for server logs for the attempt to import them (and still need them).

                Comment


                  #9
                  Sorry, missed the second line.

                  Here are the server logs.
                  Attached Files

                  Comment


                    #10
                    This is a different error - it suggests that you have checked the box in the Admin Console that tells it to drop existing tables, but there was no existing table.

                    Comment


                      #11
                      I do have the box checked that says "Generate(or replace) tables." If I don't the table doesn't get generated. This is the same setup that has worked for me through 2.1 and still works if I revert to 2.1 in my development environment.

                      Comment


                        #12
                        Found the problem - this was fixed 2 weeks ago, you can grab a nightly build from smartclient.com/builds

                        Comment


                          #13
                          Great! I'll give it a try

                          Comment

                          Working...
                          X