cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco and PostgreSQL

carl
Champ in-the-making
Champ in-the-making
I'm trying to install alfresco community edition (war file) on a CentOS 6u3 x86_64 machine running tomcat 7 under jsvc with java 1.6u33 and postgresql 9.1
postgresql91-server-9.1.8-2PGDG.rhel6.x86_64
postgresql91-libs-9.1.8-2PGDG.rhel6.x86_64
postgresql91-9.1.8-2PGDG.rhel6.x86_64


I've already got another database in postgresql (cmdbuild) - which works fine.

I'm getting the following errors in alfresco.log
12:12:21,951 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
12:12:21,964 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
12:12:28,449 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor Repository Template Processor for extension ftl
12:12:28,451 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor Repository Script Processor for extension js
12:12:33,372 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Connecting to database: jdbcSmiley Tongueostgresql://localhost:5432/alfresco, UserName=alfresco, PostgreSQL Native Driver
12:12:33,372 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.PostgreSQLDialect.
12:12:33,695 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
org.alfresco.service.cmr.repository.ContentIOException: 06050000 Failed to open stream onto channel:
   writer: ContentAccessor[ contentUrl=store:///usr/share/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-2242626767569121007.sql, mimetype=null, size=0, encoding=UTF-8, locale=en_GB]
        at org.alfresco.repo.content.AbstractContentWriter.getContentOutputStream(AbstractContentWriter.java:426)
        at org.alfresco.repo.content.AbstractContentWriter.putContent(AbstractContentWriter.java:458)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:992)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:802)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1539)
        at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
        at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:209)
        at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:180)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
        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.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:968)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1646)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: java/nio/channels/SeekableByteChannel
        at org.alfresco.repo.content.AbstractContentAccessor.getCallbackFileChannel(AbstractContentAccessor.java:215)
        at org.alfresco.repo.content.AbstractContentWriter.getCallbackWritableChannel(AbstractContentWriter.java:246)
        at org.alfresco.repo.content.AbstractContentWriter.getWritableChannel(AbstractContentWriter.java:278)
        at org.alfresco.repo.content.AbstractContentWriter.getContentOutputStream(AbstractContentWriter.java:419)
        … 28 more
Caused by: java.lang.ClassNotFoundException: java.nio.channels.SeekableByteChannel
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
        … 32 more
12:12:33,696 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 06050001 Schema auto-update failed
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1679)
        at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
        at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:209)
        at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:180)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
        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.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:968)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1646)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 06050000 Failed to open stream onto channel:
   writer: ContentAccessor[ contentUrl=store:///usr/share/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-2242626767569121007.sql, mimetype=null, size=0, encoding=UTF-8, locale=en_GB]
        at org.alfresco.repo.content.AbstractContentWriter.getContentOutputStream(AbstractContentWriter.java:426)
        at org.alfresco.repo.content.AbstractContentWriter.putContent(AbstractContentWriter.java:458)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:992)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:802)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1539)
        … 24 more
Caused by: java.lang.NoClassDefFoundError: java/nio/channels/SeekableByteChannel
        at org.alfresco.repo.content.AbstractContentAccessor.getCallbackFileChannel(AbstractContentAccessor.java:215)
        at org.alfresco.repo.content.AbstractContentWriter.getCallbackWritableChannel(AbstractContentWriter.java:246)
        at org.alfresco.repo.content.AbstractContentWriter.getWritableChannel(AbstractContentWriter.java:278)
        at org.alfresco.repo.content.AbstractContentWriter.getContentOutputStream(AbstractContentWriter.java:419)
        … 28 more
Caused by: java.lang.ClassNotFoundException: java.nio.channels.SeekableByteChannel
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
        … 32 more


Despite googling and other research in the documentation I'm obviously missing something about the setup.

I've followed the instructions as far as I can tell
I have postgresql-9.2-1002.jdbc4.jar in ${TOMCAT_HOME}/lib

Postgresql database created
CREATE USER alfresco WITH PASSWORD 'alfresco';
CREATE DATABASE alfresco WITH ENCODING 'UTF7' OWNER=alfresco;


There's a hint that the alfresco database owner needs the rights to create and modify tables.  I've tried a few options for this, but not got any further.  Database appears to be configured for remote login.

Any ideas?
3 REPLIES 3

gyro_gearless
Champ in-the-making
Champ in-the-making
The log does not say anything about trouble with Postgres; it barks on ClassNotFoundException!

So check which version of java you have installed - Sun err Oracle JDK 7 is the preferred version, OpenJDK 7 should do as well!

HTH
Gyro

carl
Champ in-the-making
Champ in-the-making
As per original entry:
Java SDK 1.6u33 (required for other purposes)

It's on the PATH and JAVA_HOME is defined

java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)


Maybe something in the invocation of tomcat?

bopolissimus
Confirmed Champ
Confirmed Champ
Hi,

have a look at:

12:12:33,695 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
org.alfresco.service.cmr.repository.ContentIOException: 06050000 Failed to open stream onto channel:
writer: ContentAccessor[ contentUrl=store:///usr/share/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-2242626767569121007.sql, mimetype=null, size=0, encoding=UTF-8, locale=en_GB]

it looks like the problem is that tomcat is trying to create a file in /usr/share/tomcat/temp/Alfresco and it's not able/allowed to.

I'm on Ubuntu (running alfresco under the distribution tomcat7) and I didn't run into that issue, so I don't know how to fix it *the*right*way*.  To fix it the quick way, you could just make sure that directory exists and is writable by the tomcat7 user (or whatever user runs tomcat).

gerald