atom feed5 messages in org.codehaus.sonar.userRe: [sonar-user] Sonar mssql database...
FromSent OnAttachments
Figler, JoshJan 13, 2011 9:17 am 
Fabrice BellingardJan 17, 2011 12:11 am 
Figler, JoshJan 17, 2011 7:12 am 
GEREA CatalinJan 17, 2011 8:39 am 
Figler, JoshJan 21, 2011 9:44 am 
Subject:Re: [sonar-user] Sonar mssql database 'issue'
From:Fabrice Bellingard (fabr@sonarsource.com)
Date:Jan 17, 2011 12:11:21 am
List:org.codehaus.sonar.user

Anyone who've used MSSQL integrated security feature can help Josh/give feedback on this?

Thanks,

Best regards, Fabrice

On Thu, Jan 13, 2011 at 6:17 PM, Figler, Josh <jfig@paychex.com> wrote:

To take advantage of the integratedSecurity feature that Microsofts SqlServer driver (sqljdbc.jar) provides, we tried to change drivers from the default mssql packaged within sonar. We can connect to the database with the following (modified to be fake host and instance) settings in the sonar.properties file:

sonar.jdbc.url: jdbc:sqlserver://MyHost.bla.com ;databaseName=sonar;instanceName=MyInstanceName sonar.jdbc.driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver sonar.jdbc.validationQuery: select 1

However, when connecting to the database, there is a problem with validating the database tables, specifically when it is looking for nvarchar but finding ntext. The odd thing is, that when using SqlServer explorer, the column specified is nvarchar, so I'm not sure if the problem lies in the driver or Sonar. Startup and stacktrace below.

We even tried pointing to an empty db so Sonar could create it. It creates it, but then has the same problem. ANY help would be greatly appreciated. We would love to use the integrated security feature.

STATUS | wrapper | 2011/01/13 11:46:13 | --> Wrapper Started as Service STATUS | wrapper | 2011/01/13 11:46:13 | Java Service Wrapper Community Edition 3.3.0 STATUS | wrapper | 2011/01/13 11:46:13 | Copyright (C) 1999-2008 Tanuki Software, Inc. All Rights Reserved. STATUS | wrapper | 2011/01/13 11:46:13 | http://wrapper.tanukisoftware.org STATUS | wrapper | 2011/01/13 11:46:13 | DEBUG | wrapper | 2011/01/13 11:46:13 | Using tick timer. DEBUG | wrapperp | 2011/01/13 11:46:14 | server listening on port 32000. DEBUG | wrapper | 2011/01/13 11:46:14 | Classpath element, wrapper.java.classpath.5, does not match any files: ../../extensions/jdbc-driver/oracle/*.jar DEBUG | wrapper | 2011/01/13 11:46:14 | Ping settings: wrapper.ping.interval=5, wrapper.ping.interval.logged=1, wrapper.ping.timeout=240 STATUS | wrapper | 2011/01/13 11:46:14 | Launching a JVM... DEBUG | wrapper | 2011/01/13 11:46:14 | command: "C:\Program Files (x86)\Java\jdk1.6.0_19\bin\java" -Djava.awt.headless=true -XX:MaxPermSize=128m -server -Xms256m -Xmx512m -Djava.library.path="./lib" -classpath "../../lib/commons-io-1.4.jar;../../lib/geronimo-spec-jta-1.0-M1.jar;../../lib/janino-2.5.10.jar;../../lib/jcl-over-slf4j-1.5.6.jar;../../lib/jetty-6.1.24.jar;../../lib/jetty-ajp-6.1.24.jar;../../lib/jetty-naming-6.1.24.jar;../../lib/jetty-plus-6.1.24.jar;../../lib/jetty-util-6.1.24.jar;../../lib/logback-classic-0.9.15.jar;../../lib/logback-core-0.9.15.jar;../../lib/mail-1.4.jar;../../lib/servlet-api-2.5-20081211.jar;../../lib/slf4j-api-1.5.6.jar;../../lib/sonar-application-2.4.1.jar;../../lib/wrapper.jar;../../;../../extensions/jdbc-driver/derby/derbyclient-10.6.1.0.jar;../../extensions/jdbc-driver/mysql/mysql-connector-java-5.1.13.jar;../../extensions/jdbc-driver/postgresql/postgresql-8.3-603.jdbc3.jar;../../extensions/jdbc-driver/mssql/sqljdbc.jar" -Dwrapper.key="iQddOE64sINuMHkC" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=8348 -Dwrapper.version="3.3.0" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.sonar.application.StartServer DEBUG | wrapper | 2011/01/13 11:46:14 | JVM started (PID=2856) INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: WrapperManager class initialized by thread: main Using classloader: sun.misc.Launcher$AppClassLoader@17182c1 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager: Initializing... INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: JVM #1 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Running a 32-bit JVM. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Registering shutdown hook INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Using wrapper INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Load native library. One or more attempts may fail if platform specific libraries do not exist. This is NORMAL and is only a problem if they all fail. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Unable to load native library: wrapper-windows-x86-32.dll Cause: no wrapper-windows-x86-32 in java.library.path INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Loaded native library: wrapper.dll INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Calling native initialization method. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperJNI Debug: Initializing WrapperManager native library. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperJNI Debug: Java Executable: C:\Program Files (x86)\Java\jdk1.6.0_19\bin\java.exe INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperJNI Debug: Windows version: 6.1.7600 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Java Version : 1.6.0_19-b04 Java HotSpot(TM) Server VM INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Java VM Vendor : Sun Microsystems Inc. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@2c84d9, args[]) called by thread: main INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Control event monitor thread started. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Communications runner thread started. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Open socket to wrapper...Wrapper-Connection INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Startup runner thread started. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Failed attempt to bind using local port 31000 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Opened Socket from 31001 to 32000 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Send a packet KEY : iQddOE64sINuMHkC INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31001]) DEBUG | wrapperp | 2011/01/13 11:46:15 | accepted a socket from 127.0.0.1 on port 31001 DEBUG | wrapperp | 2011/01/13 11:46:15 | read a packet KEY : iQddOE64sINuMHkC DEBUG | wrapper | 2011/01/13 11:46:15 | Got key from JVM: iQddOE64sINuMHkC DEBUG | wrapperp | 2011/01/13 11:46:15 | send a packet LOW_LOG_LEVEL : 1 DEBUG | wrapperp | 2011/01/13 11:46:15 | send a packet PING_TIMEOUT : 240 DEBUG | wrapperp | 2011/01/13 11:46:15 | send a packet PROPERTIES : (Property Values) DEBUG | wrapper | 2011/01/13 11:46:15 | Start Application. DEBUG | wrapperp | 2011/01/13 11:46:15 | send a packet START : start INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Received a packet LOW_LOG_LEVEL : 1 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: LowLogLevel from Wrapper is 1 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Received a packet PING_TIMEOUT : 240 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: PingTimeout from Wrapper is 240000 INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Received a packet PROPERTIES : (Property Values) INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Received a packet START : start INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: calling WrapperListener.start() INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: Waiting for WrapperListener.start runner thread to complete. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperManager Debug: WrapperListener.start runner thread started. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperSimpleApp Debug: start(args) Will wait up to 2 seconds for the main method to complete. INFO | jvm 1 | 2011/01/13 11:46:15 | WrapperSimpleApp Debug: invoking main method INFO | jvm 1 | 2011/01/13 11:46:16 | WrapperManager Debug: Send a packet START_PENDING : 5000 DEBUG | wrapperp | 2011/01/13 11:46:16 | read a packet START_PENDING : 5000 DEBUG | wrapper | 2011/01/13 11:46:16 | JVM signalled a start pending with waitHint of 5000 millis. INFO | jvm 1 | 2011/01/13 11:46:18 | WrapperManager Debug: Send a packet START_PENDING : 5000 INFO | jvm 1 | 2011/01/13 11:46:18 | WrapperSimpleApp Debug: start(args) end. Main Completed=false, exitCode=null INFO | jvm 1 | 2011/01/13 11:46:18 | WrapperManager Debug: WrapperListener.start runner thread stopped. INFO | jvm 1 | 2011/01/13 11:46:18 | WrapperManager Debug: returned from WrapperListener.start() INFO | jvm 1 | 2011/01/13 11:46:18 | WrapperManager Debug: Send a packet STARTED : DEBUG | wrapperp | 2011/01/13 11:46:18 | read a packet START_PENDING : 5000 DEBUG | wrapper | 2011/01/13 11:46:18 | JVM signalled a start pending with waitHint of 5000 millis. DEBUG | wrapperp | 2011/01/13 11:46:18 | read a packet STARTED : DEBUG | wrapper | 2011/01/13 11:46:18 | JVM signalled that it was started. INFO | jvm 1 | 2011/01/13 11:46:18 | WrapperManager Debug: Startup runner thread stopped. DEBUG | wrapperp | 2011/01/13 11:46:19 | send a packet PING : ping INFO | jvm 1 | 2011/01/13 11:46:19 | WrapperManager Debug: Received a packet PING : ping INFO | jvm 1 | 2011/01/13 11:46:19 | WrapperManager Debug: Send a packet PING : ping DEBUG | wrapperp | 2011/01/13 11:46:19 | read a packet PING : ping 2011.01.13 11:46:21 INFO org.sonar.INFO JDBC datasource bound to JNDI, name=jdbc/sonar 2011.01.13 11:46:22 INFO org.sonar.INFO Database dialect class org.sonar.jpa.dialect.MsSql DEBUG | wrapperp | 2011/01/13 11:46:25 | send a packet PING : ping INFO | jvm 1 | 2011/01/13 11:46:25 | WrapperManager Debug: Received a packet PING : ping INFO | jvm 1 | 2011/01/13 11:46:25 | WrapperManager Debug: Send a packet PING : ping DEBUG | wrapperp | 2011/01/13 11:46:25 | read a packet PING : ping 2011.01.13 11:46:27 ERROR o.s.s.p.Platform Can not start Sonar org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.server.database.JndiDatabaseConnector.start()', instance 'org.sonar.server.database.JndiDatabaseConnector@1a01f91, org.hibernate.HibernateException: Wrong column type in sonar.dbo.rules for column description. Found: ntext, expected: nvarchar(max) at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77) [picocontainer-2.10.2.jar:na] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132) [picocontainer-2.10.2.jar:na] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115) [picocontainer-2.10.2.jar:na] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) [picocontainer-2.10.2.jar:na] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) [picocontainer-2.10.2.jar:na] at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) [picocontainer-2.10.2.jar:na] at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) [picocontainer-2.10.2.jar:na] at org.picocontainer.behaviors.Stored.start(Stored.java:110) [picocontainer-2.10.2.jar:na] at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:996) [picocontainer-2.10.2.jar:na] at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:989) [picocontainer-2.10.2.jar:na] at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:746) [picocontainer-2.10.2.jar:na] at org.sonar.server.platform.Platform.startDatabaseConnectors(Platform.java:116) [classes/:na] at org.sonar.server.platform.Platform.init(Platform.java:88) [classes/:na] at org.sonar.server.platform.PlatformLifecycleListener.contextInitialized(PlatformLifecycleListener.java:43) [classes/:na] at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) [jetty-6.1.24.jar:6.1.24] at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) [jetty-6.1.24.jar:6.1.24] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) [jetty-6.1.24.jar:6.1.24] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) [jetty-6.1.24.jar:6.1.24] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) [jetty-6.1.24.jar:6.1.24] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.24.jar:6.1.24] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jetty-6.1.24.jar:6.1.24] at org.mortbay.jetty.Server.doStart(Server.java:224) [jetty-6.1.24.jar:6.1.24] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.24.jar:6.1.24] at org.sonar.application.JettyEmbedder.start(JettyEmbedder.java:80) [sonar-application-2.4.1.jar:na] at org.sonar.application.StartServer.main(StartServer.java:48) [sonar-application-2.4.1.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_19] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_19] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_19] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_19] at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:237) [wrapper.jar:3.3.0] at java.lang.Thread.run(Thread.java:619) [na:1.6.0_19] Caused by: org.hibernate.HibernateException: Wrong column type in sonar.dbo.rules for column description. Found: ntext, expected: nvarchar(max) at org.hibernate.mapping.Table.validateColumns(Table.java:284) [hibernate-core-3.3.2.GA.jar:3.3.2.GA] at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1130) [hibernate-core-3.3.2.GA.jar:3.3.2.GA] at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139) [hibernate-core-3.3.2.GA.jar:3.3.2.GA] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:359) [hibernate-core-3.3.2.GA.jar:3.3.2.GA] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341) [hibernate-core-3.3.2.GA.jar:3.3.2.GA] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) [hibernate-annotations-3.4.0.GA.jar:3.3.2.GA] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) [hibernate-entitymanager-3.4.0.GA.jar:3.4.0.GA] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) [hibernate-entitymanager-3.4.0.GA.jar:3.4.0.GA] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52) [ejb3-persistence-1.0.2.GA.jar:3.0 Final Release (1.0.2.GA) April 2 2008] at org.sonar.jpa.session.AbstractDatabaseConnector.createEntityManagerFactory(AbstractDatabaseConnector.java:138) [sonar-core-2.4.1.jar:na] at org.sonar.jpa.session.AbstractDatabaseConnector.start(AbstractDatabaseConnector.java:109) [sonar-core-2.4.1.jar:na] at org.sonar.server.database.JndiDatabaseConnector.start(JndiDatabaseConnector.java:64) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_19] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_19] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_19] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_19] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) [picocontainer-2.10.2.jar:na] ... 28 common frames omitted