Error when Tomcat starts: Could not load com.microsoft.sqlserver.jdbc.SQLServerResource

There is no problem when Tomcat does not add a project. There is a problem after adding a project. The error is as follows:

Illegal access: this web application instance has been stopped already.  Could not load com.microsoft.sqlserver.jdbc.SQLServerResource_zh.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1777)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
	at java.util.ResourceBundle$Control.newBundle(Unknown Source)
	at java.util.ResourceBundle.loadBundle(Unknown Source)
	at java.util.ResourceBundle.findBundle(Unknown Source)
	at java.util.ResourceBundle.findBundle(Unknown Source)
	at java.util.ResourceBundle.getBundleImpl(Unknown Source)
	at java.util.ResourceBundle.getBundle(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerException.getErrString(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire (BasicResourcePool.java:1014)
	at com.mchange.v2.resourcepool.BasicResourcePool.access $ 800 (BasicResourcePool.java:32)
	at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
	at com.mchange.v2.async.ThreadPerTaskAsynchronousRunner$TaskThread.run(ThreadPerTaskAsynchronousRunner.java:255)

Looking at the prompt, it seems that the SQLServerResource_zh.properties file is not loaded, but this file is not available in all my projects, and other projects are running fine . It has nothing to do with this file, it should have nothing to do with the SQL Server database.

 

So I opened SQL Server Management Studio, and logged in to the database engine with no problem . Try "127.0.0.1" and the local IP address again, and the same error is reported :

Error connecting to server:
Unable to connect to 127.0.0.1.
Additional information:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or could not be reached. Please verify that the instance name is correct and that SQL Server is configured to allow remote connections. (privider: Named Pipes Provider, error: 40 - Could not open connection to SQL Server) (Microsoft SQL Server, error: 5)

At this point, the previous exception should know the problem (127.0.0.1 for database connection): as long as this problem is solved, the exception problem will be solved.

The solution is simple:

Open SQL Server Configuration Manager, find the configuration manager on the left, and click on it one by one. As long as there is a "protocol" (such as client protocol, MSSQLSERVER protocol), all other attributes are enabled except the VIA attribute is disabled. After that, restart SQL Server services , and then go to Studio to test, you can access. Tomcat restarted and the project was accessible.

 

At this point, the problem is solved.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326448136&siteId=291194637