org.springframework.beans.BeanInstantiationException when trying to start Fisheye

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

This error was verified so far when using HSQL.

The following appears in the atlassian-fisheye.log:

2014-09-26 16:15:34,586 ERROR [main ] fisheye FishEyeWebApplicationContext-doStart - The Web context could not be started
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbControlFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cenqua.crucible.hibernate.DBControlFactoryImpl]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Database not available (Unable to connect to hsql database jdbc:hsqldb:file:/Users/grefosco/Documents/Atlassian/FishEye/fecru-3.3.1/var/data/crudb/crucible: java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]). Current state: NO_DB
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at com.cenqua.fisheye.web.jetty.FishEyeWebApplicationContext.doStart(FishEyeWebApplicationContext.java:28)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:280)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at com.cenqua.fisheye.web.WebServer.start(WebServer.java:295)
    at com.cenqua.fisheye.ctl.Run.mainImpl(Run.java:254)
    at com.cenqua.fisheye.ctl.Run.main(Run.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:99)
    at com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:42)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cenqua.crucible.hibernate.DBControlFactoryImpl]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Database not available (Unable to connect to hsql database jdbc:hsqldb:file:/Users/grefosco/Documents/Atlassian/FishEye/fecru-3.3.1/var/data/crudb/crucible: java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]). Current state: NO_DB
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:108)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)
    ... 40 more
Caused by: java.lang.IllegalStateException: Database not available (Unable to connect to hsql database jdbc:hsqldb:file:/Users/grefosco/Documents/Atlassian/FishEye/fecru-3.3.1/var/data/crudb/crucible: java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]). Current state: NO_DB
    at com.cenqua.crucible.hibernate.DefaultDBControl.start(DefaultDBControl.java:321)
    at com.cenqua.crucible.hibernate.DefaultDBControl.start(DefaultDBControl.java:288)
    at com.cenqua.crucible.hibernate.DBControlFactoryImpl.<init>(DBControlFactoryImpl.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
    ... 42 more

Cause

The Fisheye database (HSQL) may have been accessed by some external tool (e.g. DBVisualizer) using a different driver version than the one used by Fisheye.

For instance, under the $FISHEYE_INSTALL/lib folder, you will find the jar hsqldb-1.8.0.10.jar. If this database was, at some point accessed using another driver, e.g. hsqldb-2.2.4.jar, the database will be altered and the old driver won't be able to use it.

Workaround

  1. Go to $FISHEYE_INSTALL/lib.
  2. Replace the current HSQL driver by the one used to access the database externally (i.e. if it was accessed using hsqldb-2.2.4.jar, replace hsqldb-1.8.0.10.jar by the hsqldb-2.2.4.jar.
  3. Start Fisheye.

Obs.: it was not tested whether the driver in a different version is fully compatible with Fisheye or not.

Last modified on Jul 31, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.