使用Oracle DB安装SonarQube - 获取用户不存在

时间:2013-09-03 20:22:08

标签: java oracle sonarqube

在使用Oracle安装SonarQube 3.7时遇到问题 - 始终获取 ORA-01435:用户不存在

在粘贴堆栈跟踪之前,我将按照以下步骤验证

  1. 能够使用SQL Plus和SQL Developer连接到同一用户。
  2. 能够为同一个用户创建一个表并插入一些虚拟数据,以确保它正常工作。
  3. Oracle瘦JDBC URL中的更改会引发错误,指出URL格式错误。
  4. 这是我的 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]
    

1 个答案:

答案 0 :(得分:1)

我刚遇到这个问题,并设法解决了这个问题,但是将模式名称设置为大写,如下所示:

sonar.jdbc.schema:                         TEST_SONAR

此外,没有必要同时拥有sonar.jdbc.schemasonar.hibernate.default_schema,因为第二个属性实际上覆盖了第一个属性。