Jira and stash integration break STASH

Hi,

On my windows server 2008, i manage to make work Stash and jira following this configuration:

    • On C:\Atlassian\JIRA, the jira and jira-home folder - use the JIRADBUSER on my oracle server
    • On C:\Atlassian\Stash, the stash and stash-home folders (stash is using the JRE used by Jira. Is this a correct solution?) - use the STASHDBUSER on my oracle server

Both tools were correctly working after installation. I also linked them without any problems. But tonight, my server rebooted and now, Jira work but not Stash. (integration seems dead also)

Stash complain about:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crowdUserDao' defined in class path resource [crowd-spi-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.transaction.PlatformTransactionManager]: : Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginPersistentStateStore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPersistentStateStore' defined in class path resource [stash-context.xml]: Cannot create inner bean 'com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore#bf81f2' of type [com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore#bf81f2' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginStateDao' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pluginStateDao' defined in URL [jar:file:/C:/Atlassian/STASH/atlassian-stash-2.9.3/atlassian-stash/WEB-INF/lib/stash-dao-impl-2.9.3.jar!/com/atlassian/stash/internal/plugin/HibernatePluginStateDao.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.hibernate.SessionFactory]: : Error creating bean with name 'sessionFactory' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_active in JIRADBUSER.CWD_APPLICATION; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_active in JIRADBUSER.CWD_APPLICATION; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginPersistentStateStore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPersistentStateStore' defined in class path resource [stash-context.xml]: Cannot create inner bean 'com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore#bf81f2' of type [com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore#bf81f2' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginStateDao' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pluginStateDao' defined in URL [jar:file:/C:/Atlassian/STASH/atlassian-stash-2.9.3/atlassian-stash/WEB-INF/lib/stash-dao-impl-2.9.3.jar!/com/atlassian/stash/internal/plugin/HibernatePluginStateDao.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.hibernate.SessionFactory]: : Error creating bean with name 'sessionFactory' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_active in JIRADBUSER.CWD_APPLICATION; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_active in JIRADBUSER.CWD_APPLICATION

It seems the link with jira break the startup of Stash. I verified on both database users. The database for Stash do have an is_active field (char 1) bu jira doesn't have (a active field is here, but it is a number 9).

Thanks,

2 answers

1 accepted

So, i found my problem: I had 1 oracle database (instance) with 2 users. The user JIRADBUSER and STASHDBUSER. For an unknown reason when the framework used inside atlassian apps try to use the CWD_APPLICATION table, oracle redirect to the CWD_APPLICATION of user JIRADBUSER (alphabetical order?) My only solution was to create 2 separates instances of Oracle for each user. From there, it seems to work flawlessly. More investigation will be made tomorrow.
1 vote

It looks like you've configured Stash to use the JIRA database (JIRADBUSER) instead of the Stash database?

Have a look at the tables in your JIRADBUSER and STASHDBUSER databases. If you see tables in the JIRADBUSER database that start with sta_ you've probably pointed Stash to the JIRA database at some point. The jdbc connection details can be found in STASH_HOME/stash-config.properties.

If that's the case, you probably want to open a support request on support.atlassian.com to get some assistence in fixing things up.

No, i have 2 separates user with separate databases for each application.

Both application are freshly installed and they both use their own bases without any problems. The problem have happen:

  • When linking both application
  • Reboot the server

I will flush my stash application and retry the process to confirm.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_active in JIRADBUSER.CWD_APPLICATION

implies that Stash is accessing the JIRADBUSER database. Please check your stash-config.properties to make sure it is configured correctly.

Here is the content of my stash-config.properties:

#>*******************************************************
#> Migrated to database at jdbc:oracle:thin:@//172.21.0.56:1522/siioracle
#> Updated on 2013-11-27T16:14:59.382+01:00
#>*******************************************************
jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@//172.21.0.56:1522/siioracle
jdbc.user=stashdbuser
jdbc.password=stashdbpassword

As you can see, it doesn't mention the jiradbuser...

I tried to reinstall stash, here is my process:

I have cut my service. (net stop stash)

Then, in my folder, i have removed:

  • Stash application repertory
  • HOME-STASH

Recreated en empty HOME-STASH folder

copied a cleanly extracted archive.

I have (for being sure) created a new user in my oracle: TEST. I verified his rights and that the base is empty.

Restarted my service, and connected to the url of stash. I filled my information of connection to the database using the TEST user.

There i can't also regenerate my database. the same kind of error is happening.

The Hibernate SessionFactory could not be created. The database schema may not have been correctly applied
	com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:340)
	com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:158)
	com.atlassian.stash.internal.maintenance.SpringMaintenanceTaskFactory.setupTask(SpringMaintenanceTaskFactory.java:139)
	...
Missing column: is_active in JIRADBUSER.CWD_APPLICATION
	org.hibernate.mapping.Table.validateColumns(Table.java:366)
	org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1305)
	org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)
	...

Is it safe to use the same JRE for both applications? It seems there is a Jira configuration file which is applied on Stash.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,048 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you