NoClassDefFoundError MSSQL Server 2008

1
Hi there, We are trying to sync tables from an MSSQL database using database replication. When trying to sync the database at runtime, it fails with the following error: java.lang.NoClassDefFoundError: Could not initialize class com.microsoft.sqlserver.jdbc.Util We were then given an MSSQL jdbc driver jar file and put it in the userlib directory with no change. Is this extra driver necessary or should we be able to do the replication with standard built-in connectors? If not, how do we use a different one? Thanks, EDIT : Okay so further investigation has brought to light a new anomaly. When I try to synchronize the database the first time I get a different error. Only when I run the Sync microflow the second time do I get the above error. The first error I get is : An unhandled error occurred in the MxRuntime. -------- java.lang.ExceptionInInitializerError at com.microsoft.sqlserver.jdbc.SQLServerDriver.parseAndMergeProperties(SQLServerDriver.java:1026) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1008) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at databasereplication.implementation.DatabaseConnector.connect(DatabaseConnector.java:59) at databasereplication.implementation.DataManager.startSynchronizing(DataManager.java:115) at databasereplication.implementation.SQLServerReader.processTables(SQLServerReader.java:36) at databasereplication.actions.SyncDatabaseInfo.executeAction(SyncDatabaseInfo.java:50) at databasereplication.actions.SyncDatabaseInfo.executeAction(SyncDatabaseInfo.java:27) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:183) at com.mendix.core.Core.execute(SourceFile:219) at lh.a(SourceFile:69) at mg.a(SourceFile:73) at mf.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:183) at com.mendix.core.Core.execute(SourceFile:219) at gm.execute(SourceFile:186) at iW.a(SourceFile:304) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:141) at...
asked
1 answers
3

So we managed to solve the connection problem. Here is what we did:

Inside the stacktrace, it was complaining about Policy not allowing

java.<lots of things>.

So, and thanks to Grant Vine, we edited the .policy file inside the Mendix installation.

C:\Program Files (x86)\Mendix\4.1.0\runtime\.policy

As follows :

Adding

permission java.util.PropertyPermission "java.*", "read";

inside

grant 
{
};

and adding the line

grant {
permission java.net.SocketPermission "domain.com:1433","resolve,connect";
};

The database then connected.

answered