org.springframework.beans.factory.BeanCreationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • According to this documentation: https://confluence.atlassian.com/display/STASH/Connecting+Stash+to+PostgreSQL bq.PostgreSQL has the idea of schemas. When you create a PostgreSQL database, a 'public' schema is created and set as the default for that database. It is possible to create a different schema (e.g. 'stash') and set that as the default schema. Stash will use whatever schema is set as the default for the logged-in user. Stash does not provide a way for a user to nominate the schema to use; it uses schema that is set as the PostgreSQL default. However, it will only work partially and Stash still trying to use other schema h3.Steps to reproduce # Run the following SQL queries: {code:sql} CREATE DATABASE atlassian WITH ENCODING='UTF8'; CREATE USER conf WITH PASSWORD 'conf'; CREATE SCHEMA AUTHORIZATION conf; {code} # Connect a Confluence server to the database "atlassian" with user "conf" It will use the schema "conf" # Run the following SQL queries: {code:sql} CREATE USER stash WITH PASSWORD 'stash'; CREATE SCHEMA AUTHORIZATION stash; {code} # Connect a Stash server to the database "atlassian" with user "stash" The migration function in Stash will failed with the following error: {noformat} 2015-02-13 16:47:12,415 ERROR [http-nio-7990-exec-4] kahloun.foong @1050IV3x1007x82x0 kyk9e1 0:0:0:0:0:0:0:1 "POST /admin/db/edit HTTP/1.1" c.a.s.i.db.DefaultDatabaseManager Failed to obtain session factory 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_allow_all in confgtt.cwd_app_dir_mapping at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) ~[AbstractAutowireCapableBeanFactory.class:4.0.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:991) ~[AbstractApplicationContext.class:4.0.6.RELEASE] at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:340) [DefaultDatabaseManager.class:na] at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:165) [DefaultDatabaseManager.class:na] ... Caused by: org.hibernate.HibernateException: Missing column: is_allow_all in conf.cwd_app_dir_mapping {noformat} Checking the table in the schema "stash", the tables are created correctly. However, Stash is trying to access schema "conf" and the AO tables are missing too.
    via by Kah Loun Foong [Atlassian],
  • According to this documentation: https://confluence.atlassian.com/display/STASH/Connecting+Stash+to+PostgreSQL bq.PostgreSQL has the idea of schemas. When you create a PostgreSQL database, a 'public' schema is created and set as the default for that database. It is possible to create a different schema (e.g. 'stash') and set that as the default schema. Stash will use whatever schema is set as the default for the logged-in user. Stash does not provide a way for a user to nominate the schema to use; it uses schema that is set as the PostgreSQL default. However, it will only work partially and Stash still trying to use other schema h3.Steps to reproduce # Run the following SQL queries: {code:sql} CREATE DATABASE atlassian WITH ENCODING='UTF8'; CREATE USER conf WITH PASSWORD 'conf'; CREATE SCHEMA AUTHORIZATION conf; {code} # Connect a Confluence server to the database "atlassian" with user "conf" It will use the schema "conf" # Run the following SQL queries: {code:sql} CREATE USER stash WITH PASSWORD 'stash'; CREATE SCHEMA AUTHORIZATION stash; {code} # Connect a Stash server to the database "atlassian" with user "stash" The migration function in Stash will failed with the following error: {noformat} 2015-02-13 16:47:12,415 ERROR [http-nio-7990-exec-4] kahloun.foong @1050IV3x1007x82x0 kyk9e1 0:0:0:0:0:0:0:1 "POST /admin/db/edit HTTP/1.1" c.a.s.i.db.DefaultDatabaseManager Failed to obtain session factory 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_allow_all in confgtt.cwd_app_dir_mapping at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) ~[AbstractAutowireCapableBeanFactory.class:4.0.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:991) ~[AbstractApplicationContext.class:4.0.6.RELEASE] at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:340) [DefaultDatabaseManager.class:na] at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:165) [DefaultDatabaseManager.class:na] ... Caused by: org.hibernate.HibernateException: Missing column: is_allow_all in conf.cwd_app_dir_mapping {noformat} Checking the table in the schema "stash", the tables are created correctly. However, Stash is trying to access schema "conf" and the AO tables are missing too.
    via by Kah Loun Foong [Atlassian],
  • h3.Steps to reproduce: h4.SQL Server # Create a database 'atlassian' # Create a schema name 'stash' in the database # Create a user 'stash' with the default schema 'stash' # Connect Stash server with SQL server database 'atlassian' All the tables are created in the default schema 'dbo' except for AO tables created in schema 'stash' h4.Oracle # Create a database user 'stash' # Grant all the permission to the user 'stash' on the schema 'stash' # Grant another access permission to the user 'stash' on the schema 'crowd' (schema 'crowd' has been used by Crowd application) # Migrate Stash database from HSQLDB to Oracle through the UI It will fail with the following error: {noformat} 2014-02-07 12:09:03,235 ERROR [http-bio-7990-exec-7] 728x27x0 jv58e6 10.123.16.180 "POST /setup HTTP/1.1" c.a.s.i.db.DefaultDatabaseManager Failed to obtain session factory 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_allow_all in CROWD.CWD_APP_DIR_MAPPING at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1129) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:337) [stash-service-impl-2.10.1.jar:na] at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:158) [stash-service-impl-2.10.1.jar:na] {noformat} it seems that Stash somehow try to use the schema 'crowd' cause the database user 'stash' have access permission to it.
    via by Kah Loun Foong [Atlassian],
  • h3.Steps to reproduce: h4.SQL Server # Create a database 'atlassian' # Create a schema name 'stash' in the database # Create a user 'stash' with the default schema 'stash' # Connect Stash server with SQL server database 'atlassian' All the tables are created in the default schema 'dbo' except for AO tables created in schema 'stash' h4.Oracle # Create a database user 'stash' # Grant all the permission to the user 'stash' on the schema 'stash' # Grant another access permission to the user 'stash' on the schema 'crowd' (schema 'crowd' has been used by Crowd application) # Migrate Stash database from HSQLDB to Oracle through the UI It will fail with the following error: {noformat} 2014-02-07 12:09:03,235 ERROR [http-bio-7990-exec-7] 728x27x0 jv58e6 10.123.16.180 "POST /setup HTTP/1.1" c.a.s.i.db.DefaultDatabaseManager Failed to obtain session factory 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_allow_all in CROWD.CWD_APP_DIR_MAPPING at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1129) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:337) [stash-service-impl-2.10.1.jar:na] at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:158) [stash-service-impl-2.10.1.jar:na] {noformat} it seems that Stash somehow try to use the schema 'crowd' cause the database user 'stash' have access permission to it.
    via by Kah Loun Foong [Atlassian],
  • GitHub comment 43#61047683
    via GitHub by shivarajan
    ,
    • 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_allow_all in confgtt.cwd_app_dir_mapping at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)[AbstractAutowireCapableBeanFactory.class:4.0.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:991)[AbstractApplicationContext.class:4.0.6.RELEASE] at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:340)[DefaultDatabaseManager.class:na] at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:165)[DefaultDatabaseManager.class:na]

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    tvrmsmithtvrmsmith
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    137 more bugmates