How use different postgresql schemas for EPP-SP 5.1
I want to use postgresql schemas to store portal and ecmdemo contents, so the datasources were configured as follow below.
gatein-ds.xml
<no-tx-datasource>
<jndi-name>gatein-idm_portal</jndi-name>
<connection-url>jdbc:postgresql://localhost/jbepp01</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>u_epp_portal01</user-name>
<password>admin123</password>
<new-connection-sql>SET search_path TO epp_portal01</new-connection-sql>
</no-tx-datasource>
<no-tx-datasource>
<jndi-name>gatein-jcr_portal</jndi-name>
<connection-url>jdbc:postgresql://localhost/jbepp01</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>u_epp_portal01</user-name>
<password>admin123</password>
<new-connection-sql>SET search_path TO epp_portal01</new-connection-sql>
</no-tx-datasource>
wcm-ds.xml
<no-tx-datasource>
<jndi-name>gatein-idm_ecmdemo</jndi-name>
<connection-url>jdbc:postgresql://localhost/jbepp01</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>u_epp_ecm01</user-name>
<password>admin123</password>
<new-connection-sql>SET search_path TO epp_ecm01</new-connection-sql>
</no-tx-datasource>
<no-tx-datasource>
<jndi-name>gatein-jcr_ecmdemo</jndi-name>
<connection-url>jdbc:postgresql://localhost/jbepp01</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>u_epp_ecm01</user-name>
<password>admin123</password>
<new-connection-sql>SET search_path TO epp_ecm01</new-connection-sql>
</no-tx-datasource>
CREATE SCHEMA epp_portal01 AUTHORIZATION u_epp_portal01;
GRANT ALL ON SCHEMA epp_portal01 TO u_epp_portal01;
CREATE SCHEMA epp_ecm01 AUTHORIZATION u_epp01;
GRANT ALL ON SCHEMA epp_ecm01 TO u_epp_ecm01;
CREATE ROLE u_epp_ecm01 LOGIN
ENCRYPTED PASSWORD 'md5496b71c50a6c7784e1ac9f905509cdd3'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
ALTER ROLE u_epp_ecm01 SET search_path=epp_ecm01;
CREATE ROLE u_epp_portal01 LOGIN
ENCRYPTED PASSWORD 'md5a76265547d2c6772623fc38a6211fa16'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
ALTER ROLE u_epp_portal01 SET search_path=epp_portal01;
Note each user has default path to the appropriate schema.
When EPP starts it correctly created the tables at epp_ecm01 schema.
However, the tables are not created for schema epp_portal01, there are errors.
I ask if it is possible to use different postgresql schemas for EPP-SP ?
Caused by: java.lang.RuntimeException: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Database exception. org.postgresql.util.PSQLException: ERROR: relation "jcr_config" does not exist
Position: 22
at org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl.start(RepositoryServiceConfigurationImpl.java:299)
at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:75)
... 77 more
Caused by: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Database exception. org.postgresql.util.PSQLException: ERROR: relation "jcr_config" does not exist
Position: 22
at org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister.hasConfig(JDBCConfigurationPersister.java:293)
at org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl.start(RepositoryServiceConfigurationImpl.java:254)
... 81 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "jcr_config" does not exist
Position: 22
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:91)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
at org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister.hasConfig(JDBCConfigurationPersister.java:254)
... 82 more
Caused by:
java.lang.RuntimeException: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Database exception. org.postgresql.util.PSQLException: ERROR: relation "jcr_config" does not exist
Position: 22
at org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl.start(RepositoryServiceConfigurationImpl.java:299)
at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:75)
at org.picocontainer.defaults.LifecycleVisitor.start(LifecycleVisitor.java:113)
at org.exoplatform.container.ConcurrentPicoContainer.start(ConcurrentPicoContainer.java:453)
at org.exoplatform.container.ExoContainer.start(ExoContainer.java:186)
at org.exoplatform.container.PortalContainer.start(PortalContainer.java:620)
at org.exoplatform.container.ExoContainer.start(ExoContainer.java:180)
at org.exoplatform.container.RootContainer.createPortalContainer(RootContainer.java:357)
at org.exoplatform.container.RootContainer.createPortalContainers(RootContainer.java:249)
at org.exoplatform.container.web.PortalContainerCreator.contextInitialized(PortalContainerCreator.java:57)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:321)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.GeneratedMethodAccessor294.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.exoplatform.services.jcr.config.RepositoryConfigurationException: Database exception. org.postgresql.util.PSQLException: ERROR: relation "jcr_config" does not exist
Position: 22
at org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister.hasConfig(JDBCConfigurationPersister.java:293)
at org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl.start(RepositoryServiceConfigurationImpl.java:254)
... 81 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "jcr_config" does not exist
Position: 22
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:91)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
at org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister.hasConfig(JDBCConfigurationPersister.java:254)
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
