Unanswered DBException on creating working item in TFS

  • Thursday, August 30, 2012 11:22 AM
     
     

    getting below error on creating work item using TFS 2010

    com.microsoft.tfs.core.internal.db.DBException: java.sql.SQLException: java.lang.NullPointerException null sql [select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_NAME = ?]

    any pointers?

All Replies

  • Thursday, August 30, 2012 5:25 AM
     
     
     

    getting below error on creating work item using TFS 2010

    com.microsoft.tfs.core.internal.db.DBException: java.sql.SQLException: java.lang.NullPointerException null sql [select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_NAME = ?]

    any pointers?

  • Thursday, August 30, 2012 8:08 PM
     
     

    Hi,

    This looks like a problem with your TFS installation.To confirm this, you can try to create a new work item using the web and it should run into the same problem.

    Please let me know if you have any other questions/issues.

    Thanks

    Mireille

  • Friday, August 31, 2012 3:29 AM
     
     

    Hi Mireille,

    Thanks for your response.

    With web ui I'm able to create work item successfully without any issues. It happens when I'm trying to create workitem via tfs sdk via my java program. I'm able to create connection successfully.With the connection i was able to get the workitemclient from TFSTeamProjectCollection. Passing the below query results in 

    om.microsoft.tfs.core.internal.db.DBException: java.sql.SQLException: java.lang.NullPointerException null sql [select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_NAME = ?]

    The query tries to get the task workitems that are last modified based on date. Iam passing the query to 

    WorkItemCollection tasksQueryResults = workItemClient.query(
    finalQuery, null, false);

    Select [Id] From WorkItems Where [Team Project] = 'myproject' and [Work Item Type] = 'Task' and [Changed Date] >= '2012-08-08T00:00:00.0' Order By [Changed Date] Asc

    Thanks

  • Friday, August 31, 2012 3:43 AM
     
     

    Also found that via my sample TFS connection program.Executing any simple query like "Select ID, Title from WorkItems where (State = 'Active') order by Title" returns below error. Not sure whether hsqldb gets corrupted.

    Exception in thread "main" java.lang.RuntimeException: java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]
    at com.microsoft.tfs.core.internal.db.ConnectionConfiguration.createNewConnection(ConnectionConfiguration.java:233)
    at com.microsoft.tfs.core.internal.db.ConnectionPool.getConnection(ConnectionPool.java:54)
    at com.microsoft.tfs.core.internal.db.ConnectionPool.executeWithPooledConnection(ConnectionPool.java:77)
    at com.microsoft.tfs.core.clients.workitem.internal.metadata.Metadata.<init>(Metadata.java:132)
    at com.microsoft.tfs.core.clients.workitem.internal.WITContext.<init>(WITContext.java:97)
    at com.microsoft.tfs.core.clients.workitem.WorkItemClient.getContext(WorkItemClient.java:382)
    at com.microsoft.tfs.core.clients.workitem.WorkItemClient.getProjects(WorkItemClient.java:318)
    at com.tcs.tfs.TFSConnection.main(TFSConnection.java:25)
    Caused by: java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]
    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 com.microsoft.tfs.core.internal.db.ConnectionConfiguration.createNewConnection(ConnectionConfiguration.java:219)
    ... 7 more

  • Friday, August 31, 2012 8:22 AM
     
     

    Also for my application I have hsqldb20.jar in my classpath, is the below error occurs because of different version of hsqldb used.one in my application classpath and another internal hsqldb in tfs 2010 sdk.?

    com.microsoft.tfs.core.internal.db.DBException: java.sql.SQLException: java.lang.NullPointerException null sql [select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_NAME = ?]

  • Friday, August 31, 2012 12:58 PM
    Owner
     
     

    That will probably be the problem.  The SDK uses hsql as an in memory database as well.  Is the reference to hsqldb20.jar before or after the TFS SDK jar in the classpath?

    Martin.


    http://www.woodwardweb.com

    • Marked As Answer by dashtfs Friday, August 31, 2012 1:35 PM
    • Unmarked As Answer by dashtfs Friday, August 31, 2012 1:35 PM
    •  
  • Friday, August 31, 2012 1:06 PM
     
     

    yes,my application needs hsqldb20.jar to start the database so I'm adding my hsqldb20.jar before the TFS SDK.jar hence the problem. If I added hsqldb ater the tfs sdk.jar db connection not gets created as it refers hsqdb from tfs sdk.jar but it needs hsqdb20.jar ...anyways to resolve this issue.?

    Also What version of hsqldb does tfssdk uses? I guess it uses hsqldb 1.8 am i right?

  • Monday, September 03, 2012 11:46 AM
    Owner
     
     

    Yes - we are using version 1.8.  However it is bundled up inside the TFS SDK jar which I'm guessing is just adding to the problems.

    Let me have a chat with some of the rest of the team when they get back from the Labor day holiday in the states and get back to you with some work-around suggestions.

    Apologies,

    Martin.


    http://www.woodwardweb.com

  • Friday, September 07, 2012 5:00 PM
     
     

    Hi Martin,

    Any updates from tfs sdk team on the above said problem?

    Thanks in advance.

  • Monday, January 28, 2013 9:58 PM
     
     

    Hi Martin,

    I was wondering whether you ever uncovered the source of this error.

    I have been getting a similar error periodically: "com.microsoft.tfs.core.internal.db.DBException: java.sql.SQLException: Table not found: SYSTEM_TABLES in statement [select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_NAME = ?] sql [select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_NAME = ?]"

    Our application uses an H2 database. Could this conflict with the hsqldb TFS SDK uses?

    Thanks.