NL Exception was generated TNS-04603


(Andrew Barrett) #1

I’m not sure if this is a bug or not, but here is the scenario I’m running into:

  1. Oracle DB (
  2. Migrated the DB from Windows to Linux
    a) Database is up and running and can sqlplus into it.
  3. TNSNames and Listener.ora are setup.
  4. When I try to startup sonarqube(on another server pointing to the database server) I get the following error:
	at org.sonar.db.DefaultDatabase.checkConnection(
	at org.sonar.db.DefaultDatabase.start(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(
	at org.picocontainer.behaviors.AbstractBehavior.start(
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(
	at org.picocontainer.behaviors.Stored.start(
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(
	at org.picocontainer.DefaultPicoContainer.startAdapters(
	at org.picocontainer.DefaultPicoContainer.start(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(
	at org.sonar.server.platform.platformlevel.PlatformLevel1.start(
	at org.sonar.server.platform.Platform.start(
	at org.sonar.server.platform.Platform.startLevel1Container(
	at org.sonar.server.platform.Platform.init(
	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(
	at org.apache.catalina.core.StandardContext.listenerStart(
	at org.apache.catalina.core.StandardContext.startInternal(
	at org.apache.catalina.util.LifecycleBase.start(
	at org.apache.catalina.core.ContainerBase$
	at org.apache.catalina.core.ContainerBase$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (IO Error: NL Exception was generated TNS-04603: Invalid syntax error: Unexpected char "#" while parsing KEY)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(
	at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(
	at org.sonar.db.profiling.ProfiledDataSource.getConnection(
	at org.sonar.db.DefaultDatabase.checkConnection(
	... 30 common frames omitted
Caused by: java.sql.SQLRecoverableException: IO Error: NL Exception was generated TNS-04603: Invalid syntax error: Unexpected char "#" while parsing KEY
	at oracle.jdbc.driver.T4CConnection.logon(
	at oracle.jdbc.driver.PhysicalConnection.connect(
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(
	at oracle.jdbc.driver.OracleDriver.connect(
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(
	... 35 common frames omitted
Caused by: NL Exception was generated TNS-04603: Invalid syntax error: Unexpected char "#" while parsing KEY
	at oracle.jdbc.driver.T4CConnection.connect(
	at oracle.jdbc.driver.T4CConnection.logon(

Now, I’m I’ve checked everything I can think of, I even got a light weight tool call jdbc-tester and I’m getting the same error from it. I’m thinking it is an issue with firewall but I can telnet to port 1521 from source to destination server. I’ve also tried netcat, and this works as well. This leads me to believe it’s not a firewall issue.

Any help would be appreciated.

(Andrew Barrett) #2


I checked the tnslsnr log file of the database, and the connection is being established. I had a dba look at the error, and he said it seems like the character set is not happy in the database vs what the application is looking for. So I checked the character set of both the old database(still running and sonar is connected to it without any issues), and the migrated database. The character set is the same. So at this point I dont know what sonarqube is complaining about.

(Andrew Barrett) #3


I did see that the old database is running Oracle and the new database is running Not sure if this will cause an issue.