cancel
Showing results for 
Search instead for 
Did you mean: 

Custom DB Setup

tcordova
Champ in-the-making
Champ in-the-making
Ok…  I;ve read the wiki for database configuration and for Repository Configuration http://wiki.alfresco.com/wiki/Repository_Configuration .  It looks like I'm supposed to create some files in:

<JBOSS-HOME>/server/default/conf/alfresco/extension

The files it says to create are:

~ custom-db-and-data-context.xml
~ custom-db-connection.properties
~ custom-hibernate-dialect.properties
~ custom-data-location.properties

It also says I should be able to find samples of these in the <JBOSS_HOME>/server/default/conf/ directory.  I looked there and in <JBOSS_HOME>/server/default/conf/alfresco/extension and couldn't find the samples anywhere.

I've created 2 of the files:

<JBOSS-HOME>/server/default/conf/alfresco/extension/custom-db-connection.properties

db.driver=com.sybase.jdbc2.jdbc.SybDataSource
db.name=alfresco
db.url=jdbc:sybase:Tds:devdb1:4100/alfresco?JCONNECT_VERSION=6
db.username=alfresco
db.password=alfresco

<JBOSS-HOME>/server/default/conf/alfresco/extension/custom-hibernate-dialect.properties

hibernate.dialect=org.hibernate.dialect.SybaseDialect

I don't know what to do for the others, and the server is generating an error on startup because it's still looking for mysql.

HELP!!!
21 REPLIES 21

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

This is what you're missing:

<JBOSS-HOME>/server/default/conf/alfresco/extension/custom-data-location.properties
dir.root=/srv/alfresco/data   (replace this with whatever you like)

<JBOSS-HOME>/server/default/conf/alfresco/extension/custom-db-and-data-context.xml
<beans>

    <!– overriding to point to custom properties –>
    <bean id="repository-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/repository.properties</value>
                <value>classpath:alfresco/version.properties</value>
                <value>classpath:alfresco/domain/transaction.properties</value>
                <!– override core properties –>
                <value>file:[JBossHome]/server/default/conf/alfresco/extension/custom-data-location.properties</value> 
                <value>file:[JBossHome]/server/default/conf/alfresco/extension/custom-db-connection.properties</value> 
            </list>
        </property>
    </bean>

    <!– override Hibernate properties –>
    <bean id="hibernateConfigProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="locations">
            <list>
                <value>classpath:alfresco/domain/hibernate-cfg.properties</value>
                <value>file:[JBossHome]/server/default/conf/alfresco/extension/custom-hibernate-dialect.properties</value>
            </list>
        </property>
    </bean>

</beans>

Cheers,

–Aladdin

tcordova
Champ in-the-making
Champ in-the-making
I created the 2 files you mentioned, but now I get the following error on deployment during server startup:

2006-05-26 09:17:19,318 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML document from file [C:\JBoss\jboss-portal-2.2.1-bundled\server\default\conf\alfresco\extension\custom-db-and-data-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".

Here's my custom-db-and-data-context.xml contents:


<beans>

    <!– overriding to point to custom properties –>
    <bean id="repository-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/repository.properties</value>
                <value>classpath:alfresco/version.properties</value>
                <value>classpath:alfresco/domain/transaction.properties</value>
                <!– override core properties –>
                <value>file:/JBoss/jboss-portal-2.2.1-bundled/server/default/conf/alfresco/extension/custom-data-location.properties</value>
                <value>file:jboss-portal-2.2.1-bundled/server/default/conf/alfresco/extension/custom-db-connection.properties</value>
            </list>
        </property>
    </bean>

    <!– override Hibernate properties –>
    <bean id="hibernateConfigProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="locations">
            <list>
                <value>classpath:alfresco/domain/hibernate-cfg.properties</value>
                <value>file:jboss-portal-2.2.1-bundled/server/default/conf/alfresco/extension/custom-hibernate-dialect.properties</value>
            </list>
        </property>
    </bean>

</beans>

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

You should add:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
at the top of custom-db-and-data-context.xml

Also replace:
file:jboss-portal-2.2.1-bundled/
with the full path starting with /
(e.g. /opt/jbossAS/jboss-portal-2.2.1-bundled/….)
Regards,

–Aladdin

tcordova
Champ in-the-making
Champ in-the-making
I've done that and now it seems to get past that point, but I'm getting yet another error that halts the server startup…

09:45:51,816 ERROR [STDERR] May 26, 2006 9:45:51 AM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
09:45:53,066 ERROR [STDERR] May 26, 2006 9:45:53 AM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
09:45:53,238 ERROR [STDERR] May 26, 2006 9:45:53 AM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
09:45:54,176 ERROR [STDERR] May 26, 2006 9:45:54 AM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect

rivetlogic
Champ on-the-rise
Champ on-the-rise
It's not really halted, it's just slow on first boot because the database is being populated along with the content store and indexes, and that generates A LOT of logs. To make this process faster:

- Edit <JBOSS-HOME>/server/default/conf/log4j.xml
- Scroll down to the  <root> element
- Change it to:
<root>
   <priority value="INFO" />
   <appender-ref ref="CONSOLE"/>
   <appender-ref ref="FILE"/>
</root>
Cheers,

–Aladdin

tcordova
Champ in-the-making
Champ in-the-making
It looks like I've gotten past the database issue…  The tables have been created in my Sybase database, but now I'm getting this error:


May 26, 2006 1:50:57 PM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
NDC
null

Can you help with this or should I start another thread?

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

What you need to do to get rid of this error is run your OpenOffice suite in headless mode like so:
soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless &
Hope this helps.

–Aladdin

tcordova
Champ in-the-making
Champ in-the-making
I'm not even running openoffice.  I thought that was an "optional" thing.

rivetlogic
Champ on-the-rise
Champ on-the-rise
It is. That is why you can also choose to ignore that error if you don't care about this functionality. The error is simply reporting failure to connect to the OpenOffice service.

–Aladdin