Hello,
I am developing a rest api extension similar to the rest-api-sql-data-source example ( https://github.com/Bonitasoft-Community/rest-api-sql-data-source)
We use the Jboss bundle.
Due to limitations (sqlserver store procedure calls) I am not using the groovy.sql method, but the classic java approach.
So, in order to create the connection I have:
Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”);
Connection conn = DriverManager.getConnection(“jdbc:sqlserver://serverName:1433;databaseName=dbName”, “sa”, “pswd”);
resulting in NoClassDefFoundError exception
15:09:38,217 WARNING [org.restlet.Component.BonitaSPRestletApplication] (http–0.0.0.0-8086-2) Exception or error caught in server resource: java.lang.NoClassDefFoundError: Could not initialize class com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_67]
at java.lang.Class.forName(Class.java:190) [rt.jar:1.7.0_67]
at com.acs.rest.api.Index.doHandle(Index.groovy:71)
at org.bonitasoft.console.common.server.page.RestApiRendererExt.doHandle(RestApiRendererExt.java:33) [console-server-sp-7.3.2.jar:]
.
.
.
I tried adding a \lib folder with the sqljdbc.jar inside the spCallerRestAPI-1.0.1-SNAPSHOT.zip, with no success (and restarted the server) .
In JBoss there is no \lib folder as in Tomcat.
Any ideas where should the .jar be put?