使用 Oracle 安装 SonarQube 3.7 时遇到问题 - 总是得到ORA-01435: User does not exist。
在粘贴堆栈跟踪之前,这是我验证的步骤
- 能够使用 SQL Plus 和 SQL Developer 连接到同一用户。
- 能够为同一个用户创建一个表并插入一些虚拟数据,以确保它工作正常。
- Oracle 瘦 JDBC URL 中的更改会引发错误,指出 URL 格式错误。
这是我的sonar.properties文件
sonar.jdbc.username: test_sonar
sonar.jdbc.password: test_sonar
sonar.jdbc.dialect: oracle
sonar.jdbc.schema: test_sonar
sonar.jdbc.url: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=HOST)(PORT=MYPORT))(failover=yes))(CONNECT_DATA=(service_name=MYSERVICE)(SERVER=DEDICATED)))
sonar.jdbc.driverClassName: oracle.jdbc.driver.OracleDriver
sonar.jdbc.validationQuery: select 1 from dual
sonar.hibernate.default_schema: test_sonar
使用上述属性,我能够成功运行 SolarQube 2.8 而没有任何错误,但无法从 3.0 运行任何其他版本。
感谢你的帮助。
堆栈跟踪
2013.09.03 16:09:46 INFO o.s.s.p.ServerImpl SonarQube Server / 3.7 / 7c385c2c648967302cf69e08f56c0da135b3e5e9
2013.09.03 16:09:46 INFO o.s.c.p.Database Create JDBC datasource for jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=MYHOST)(PORT=MYPORT))(failover=yes))(CONNECT_DATA=(service_name=MYSERVICE)(SERVER=DEDICATED)))
2013.09.03 16:09:47 ERROR o.s.c.p.Database Can not connect to database. Please check connectivity and settings (see the properties prefixe
d by 'sonar.jdbc.').
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01435: user does not exist
)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) ~[commons-dbcp-1.4.jar:1.4]
at org.sonar.core.persistence.DefaultDatabase.checkConnection(DefaultDatabase.java:141) [sonar-core-3.7.jar:na]
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:70) [sonar-core-3.7.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_37]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_37]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_37]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_37]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) [picocontainer-2.14.3
.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) [picocontainer-2.14.3.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) [picocontainer-2.1
4.3.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) [picocontainer-2.14.3.jar:na]
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) [picocontainer-2.14.3.jar:na]
at org.picocontainer.behaviors.Stored.start(Stored.java:110) [picocontainer-2.14.3.jar:na]
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015) [picocontainer-2.14.3.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008) [picocontainer-2.14.3.jar:na]
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766) [picocontainer-2.14.3.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:87) [sonar-plugin-api-3.7.jar:na]
at org.sonar.server.platform.Platform.startDatabaseConnectors(Platform.java:193) [classes/:na]
at org.sonar.server.platform.Platform.init(Platform.java:134) [classes/:na]
at org.sonar.server.platform.PlatformLifecycleListener.contextInitialized(PlatformLifecycleListener.java:33) [classes/:na]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:746) [jetty-server-7.6.11.v20130520.jar:7.6.11.
v20130520]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:238) [jetty-servlet-7.6.11.v20130520.jar
:7.6.11.v20130520]
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1240) [jetty-webapp-7.6.11.v20130520.jar:7.6.11.v20130520
]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:689) [jetty-server-7.6.11.v20130520.jar:7.6.11.v2013
0520]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:482) [jetty-webapp-7.6.11.v20130520.jar:7.6.11.v20130520]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-7.6.11.v20130520.jar:7.6.11.v201
30520]
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-7.6.11.v20130520.jar:7.6.11
.v20130520]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-7.6.11.v20130520.jar:7.6.11.v201
30520]