0
votes

I'm unable to connect/integrate Orbeon Froms with MS SQL Server.

Does anyone have a step-by-step guide to configuring Orbeon Forms with SQL Server?

My current environment:

  • Orbeon 2016.2.1
  • Tomcat 8.5.6
  • jdk 1.8.0_112
  • The above applications are installed on a server running Windows Server 2012 R2 Standard.

I have MS SQL Server 2014 installed on a separate server running Windows Server 2012 R2 Standard

I have extracted the orbeon war file into D:\apache-tomcat-8.5.6\webapps\orbeon

Tomcat is running successfully. I can access the apache Tomcat/8.5.6 home page.

Orbeon is running successfully. I can access the orbeon (Forms builder) home page. I am able to build a form (which does not integrate with SQL Server).

I'm attempting to use: sqljdbc42.jar This has been copied into "D:\apache-tomcat-8.5.6\lib" and also "D:\apache-tomcat-8.5.6\webapps\orbeon\WEB-INF\lib"

I've updated "D:\apache-tomcat-8.5.6\conf\server.xml" with the following:

<Resource
     name="jdbc/sqlserver"
     driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
     auth="Container"
     type="javax.sql.DataSource"
     initialSize="3"
     maxIdle="20"
     poolPreparedStatements="true"
     validationQuery="select 1"
     testOnBorrow="true"
     username="xxxxxxxx"
     password="xxxxxxxx"
     url="jdbc:sqlserver://<IP Address>:1433;database=OrbeonForms"/>

I've run the ddl to create the Orbeon Forms tables, etc in my database: https://github.com/orbeon/orbeon-forms/blob/master/form-runner/src/main/resources/apps/fr/persistence/relational/ddl/sqlserver-2016_2.sql

I've attempted to implement the following example, but cannot get it to work. https://doc.orbeon.com/form-builder/database-services.html

The drop down box appears in the form, but does not list any of the content from the database.

Have I missed some configuration steps in the above setup?

Thanks

1
The <--Resource means that it is commented, which would explain the problem you are seeing, if this is indeed what you have in your server.xml. Could you double check that? If this doesn't help could you put your full server.xml somewhere, like in a Gist and include a link, so we can check if we can spot an error? Finally, you might also want to check if you have any errors in your orbeon.log that can put you on the path to a solution. - avernet
Thanks for the reply. The comments are not in the server.xml file. I added the comment for the above post, as it seemed to help with formating. The server.xml code can be found at the following link. gist.github.com/SM777/4105e567287af7e6e65f7ef57e50416f - SM7
Here is the orbeon log. I stopped the tomcat service, deleted the orbeon log. Restarted tomcat, opened orbeon forms, and published tested my 'test form' with the non-working drop-down list. Thanks,,, gist.github.com/SM777/e638e1c2c901786bc95c84e44886a735 - SM7
Got it about the comment. (I've edited your question to remove the comment, to remove a possible confusion.) - avernet

1 Answers

2
votes

Try to add in the context.xml the ResourceLink for the datasource:

<ResourceLink global="jdbc/sqlserver" name="jdbc/sqlserver" type="javax.sql.DataSource"/>

In analogy to the postgres example which was working in my tests.