Using encryption with SQL Server connections

If you are using SQL Server with an encrypted connection from the Asset Bank database to SQL Server there is an issue to be aware of. There is a bug in Java from Java 6 update 29 onwards affecting encrypted connections, please see this link for more information:

So if you are using an affected Java version, and can't connect to the database with the following error appearing in the Tomcat logs:

2014/07/30 11:33:37:565 EDT [ERROR] - Error trying update Job com.bn2web.common.exception.Bn2Exception: Could not get connection from pool in DBTransaction.getNewTransaction 	at com.bright.framework.database.service.DBTransactionManager.getNewTransaction( 	at com.bright.framework.database.service.DBTransactionManager.getCurrentOrNewTransaction( 	at com.bright.framework.database.service.DBTransactionManager.execute( 	at com.bright.framework.database.service.DBTransactionManager.execute( 	at com.bright.assetbank.job.service.JobManagerImpl.claimNextPendingJob( 	at com.bright.assetbank.job.service.JobManagerImpl.access$0( 	at com.bright.assetbank.job.service.JobManagerImpl$ 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 	at java.util.concurrent.ThreadPoolExecutor$ Source) 	at Source) Caused by: java.sql.SQLException: I/O Error: DB server closed connection. 	at net.sourceforge.jtds.jdbc.TdsCore.nextToken( 	at net.sourceforge.jtds.jdbc.TdsCore.login( 	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.( 	at net.sourceforge.jtds.jdbc.ConnectionJDBC3.( 	at net.sourceforge.jtds.jdbc.Driver.connect( 	at java.sql.DriverManager.getConnection(Unknown Source) 	at java.sql.DriverManager.getConnection(Unknown Source) 	at org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.getConnection( 	at org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance( 	at org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingPool.newPoolable( 	at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable( 	at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.newPoolable( 	at org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingPool.get( 	at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get( 	at com.bn2web.common.database.ResourceLimitingJdbcDataSource.getConnection( 	at com.bright.framework.database.service.DBTransactionManager.getNewTransaction( 	... 9 more Caused by: DB server closed connection. 	at net.sourceforge.jtds.jdbc.SharedSocket.readPacket( 	at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket( 	at net.sourceforge.jtds.jdbc.ResponseStream.getPacket( 	at 	at net.sourceforge.jtds.jdbc.TdsCore.nextToken( 	... 24 more

then there are two possible solutions. Apply SQL Server updates as per this article:

Or add a line to Tomcat's Java options by doing the following:

First, ensure that you have the SSL parameter in the database URL in or components.xconf. So the database URL should have a format similar to the following:


Then you need to add a line to Tomcat's Java options. You can load the Tomcat configuration applet by navigating to the \*Tomcat*\bin directory and then double clicking on Tomcat(*version number*)w.exe - on the 'Java' tab add in the following option:


Then apply the change, restart Tomcat and try browsing to Asset Bank to test if the application is now connecting to the database.

IMPORTANT: If you needed to use the above method to overcome SQL Server connection issues with encryption then when upgrading Asset Bank you will need to add the option above into the batch file used to start the upgrade process. To do this:

After downloading and unpacking the file browse to the startUpdate.bat file and edit it in a text editor. You will need to add the option to the last line in the file, as follows:

java -Djsse.enableCBCProtection=false -jar %APPNAME% %ASSET_BANK% %2 %3 %4 %5

Then save and after performing any other necessary upgrade preparation run the upgrade.

Was this article helpful?

Yes No

Thanks for your feedback!