cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco tries to connect to Mysql while configured to use Postgresql

bostaxola
Champ in-the-making
Champ in-the-making
I'm trying to install alfresco 5.a into an existing tomcat7. I have follow this guide http://fcorti.com/2013/01/09/installation-alfresco-4-2-c-on-ubuntu/ along with the one provided by alfresco wiki. The point is that I have installed postgresql 9.3.1, but Alfresco tries to connect to mysql:


13:27:56,066 WARN  [org.alfresco.util.RuntimeSystemPropertiesSetter] [localhost-startStop-1] Could not find alfresco-jmxrmi.password on classpath</br>
13:27:56,520 INFO  [org.alfresco.repo.admin] [localhost-startStop-1] Using database URL 'jdbc:mysql:///alfresco' with user 'alfresco'.
13:27:56,524 ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed


Share is deployed and I can access the login page, but not log in since there is no database, and another strange thing… I can no longer access to tomca7's web-manager (tomcat-users.xml file is edited with an user with manager and admins roles)


Here are some info that might be useful to determinate what is happening:

$cat /var/lib/tomcat7/shared/classes/alfresco-global.properties | grep -v '^#'

dir.root=/opt/alfresco/alf_data

db.username=alfresco
db.password=alfresco

ooo.exe=/usr/lib/libreoffice/program/soffice.bin
ooo.enabled=false

jodconverter.officeHome=/usr/lib/libreoffice
jodconverter.portNumbers=8100
jodconverter.enabled=true

img.root=/usr/share/doc/imagemagick
img.exe=/usr/bin/convert
swf.exe=/usr/bin/pdf2swf

db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco

index.recovery.mode=AUTO

authentication.chain=alfrescoNtlm1:alfrescoNtlm

alfresco.rmi.services.host=0.0.0.0



Directory list:
$/var/lib/tomcat7# tree . -L 3


.
├── alfresco.log
├── bin
│   ├── bootstrap.jar
│   ├── catalina.bat
│   ├── catalina.sh
│   ├── catalina-tasks.xml
│   ├── commons-daemon.jar
│   ├── commons-daemon-native.tar.gz
│   ├── configtest.bat
│   ├── configtest.sh
│   ├── daemon.sh
│   ├── digest.bat
│   ├── digest.sh
│   ├── setclasspath.bat
│   ├── setclasspath.sh
│   ├── shutdown.bat
│   ├── shutdown.sh
│   ├── startup.bat
│   ├── startup.sh
│   ├── tomcat-juli.jar
│   ├── tomcat-native.tar.gz
│   ├── tool-wrapper.bat
│   ├── tool-wrapper.sh
│   ├── version.bat
│   └── version.sh
├── common
│   └── classes
├── conf -> /etc/tomcat7
├── endorsed
│   ├── serializer-2.7.1.jar
│   └── xalan-2.7.1.jar
├── lib
│   ├── annotations-api.jar
│   ├── catalina-ant.jar
│   ├── catalina-ha.jar
│   ├── catalina.jar
│   ├── catalina-tribes.jar
│   ├── ecj-4.4.jar
│   ├── el-api.jar
│   ├── jasper-el.jar
│   ├── jasper.jar
│   ├── jsp-api.jar
│   ├── servlet-api.jar
│   ├── tomcat7-websocket.jar
│   ├── tomcat-api.jar
│   ├── tomcat-coyote.jar
│   ├── tomcat-dbcp.jar
│   ├── tomcat-i18n-es.jar
│   ├── tomcat-i18n-fr.jar
│   ├── tomcat-i18n-ja.jar
│   ├── tomcat-jdbc.jar
│   ├── tomcat-util.jar
│   └── websocket-api.jar
├── logs -> ../../log/tomcat7
├── server
│   └── classes
├── shared
│   ├── classes
│   │   ├── alfresco-global.properties
│   │   └── alfresco-global.properties~
│   └── lib
│       └── postgresql-9.3-1101-jdbc41.jar
├── temp
│   └── safeToDelete.tmp
├── webapps
│   ├── alfresco
│   │   ├── cmis-browser-app
│   │   ├── cmisfs
│   │   ├── css
│   │   ├── css-boilerplate
│   │   ├── favicon.ico
│   │   ├── images
│   │   ├── index.jsp
│   │   ├── jsp
│   │   ├── META-INF
│   │   ├── scripts
│   │   ├── swf
│   │   ├── WEB-INF
│   │   └── yui
│   ├── alfresco.war
│   ├── sample
│   │   ├── hello.jsp
│   │   ├── images
│   │   ├── index.html
│   │   ├── META-INF
│   │   └── WEB-INF
│   ├── sample.war
│   ├── share
│   │   ├── components
│   │   ├── css
│   │   ├── error500.jsp
│   │   ├── favicon.ico
│   │   ├── index.jsp
│   │   ├── jquery
│   │   ├── js
│   │   ├── META-INF
│   │   ├── modules
│   │   ├── site-index.jsp
│   │   ├── templates
│   │   ├── themes
│   │   ├── WEB-INF
│   │   └── yui
│   ├── share.war
└── work -> ../../cache/tomcat7
8 REPLIES 8

afaust
Legendary Innovator
Legendary Innovator
Hello,

somehow Alfresco picks up a property override from somewhere - have you made sure that you provide no system properties via the -D flags to the Tomcat Java process and don't have a JNDI data source setup for the container / web app?

Regards
Axel

bostaxola
Champ in-the-making
Champ in-the-making
Thank you for both replies.

First of all, this is the alfresco process, I don't see anything weird.


alfresco 27186     1  0 13:27 ?        00:01:18 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms512m -Xmx768m -Xss768k -XX:MaxPermSize=256m -XX:NewSize=256m -server -Dalfresco.home=/opt/alfresco -Dcom.sun.management.jmxremote -Djava.endorsed.dirs=/var/lib/tomcat7/endorsed -classpath /var/lib/tomcat7/bin/bootstrap.jar:/var/lib/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/var/lib/tomcat7 -Djava.io.tmpdir=/var/lib/tomcat7/temp org.apache.catalina.startup.Bootstrap start



The share.loader is:

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar




And I dont know anything about the JNDI, I have checked tomcat7's conf files, and the only thing I have found about it is on the server.xml file:

<Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<Realm className="org.apache.catalina.realm.LockOutRealm">
        <!– This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  –>
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

mrogers
Star Contributor
Star Contributor
And have you added the "shared" folder to catalina's shared classloader?

e.g.
shared.loader= /var/lib/tomcat7/shared/classes

in catalina.properties

blevinson
Champ in-the-making
Champ in-the-making
Any resolution for this?

blevinson
Champ in-the-making
Champ in-the-making
Extract alfresco-repository-5.0.0.3.jar, change entries in repository.properties:
- db.driver=org.gjt.mm.mysql.Driver to db.driver=org.postgresql.Driver
- db.url=jdbc:mysql:///${db.name} to db.url=jdbcSmiley Tongueostgresql:///${db.name}
Recompress to a jar. If on a new mac, you may need to delete the __MACOSX folder that it creates when it compresses by doing this: zip -d [path]/alfresco-repository-5.0.0.3.jar  __MACOSX/\*

mrogers
Star Contributor
Star Contributor
No!   Don't change repository.properties, or otherwise hack the alfresco jars.   Over-ride alfresco's settings as per the docs and admin guidelines.

olfa
Champ in-the-making
Champ in-the-making
Please, any solution for this?

I did not extract alfresco-repository-5.0.0.3.jar.
But i did modified cat /var/lib/tomcat7/shared/classes/alfresco-global.properties and add shared.loader= /var/lib/tomcat7/shared/classes
in catalina.properties.Alfresco connect automatically to Mysql, a Mysql command prompt appears showing this msg:

"150422 11:48:06 [Note] Plugin 'FEDERATED' is disabled.
150422 11:48:06 InnoDB: The InnoDB memory heap is disabled
150422 11:48:06 InnoDB: Mutexes and rw_locks use Windows interlocked functions
150422 11:48:06 InnoDB: Compressed tables use zlib 1.2.3
150422 11:48:06 InnoDB: Initializing buffer pool, size = 128.0M
150422 11:48:06 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
150422 11:48:06 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait…
150422 11:48:06 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait…
150422 11:48:06 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150422 11:48:07 InnoDB: Waiting for the background threads to start
150422 11:48:08 InnoDB: 1.1.8 started; log sequence number 0
150422 11:48:08 [Note] Server hostname (bind-address): '0.0.0.0'; port: 33061
150422 11:48:08 [Note] - '0.0.0.0' resolves to '0.0.0.0';
150422 11:48:08 [Note] Server socket created on IP: '0.0.0.0'.
150422 11:48:08 [Note] Event Scheduler: Loaded 0 events
150422 11:48:08 [Note] E:\PROJET~1\ALFRES~1\ALFRES~1.B\mysql\bin\mysqld: ready for connections.
Version: '5.5.28' socket: '' port: 33061 MySQL Community Server (GPL)

olfa
Champ in-the-making
Champ in-the-making
Please, any solution for this?

I did not extract alfresco-repository-5.0.0.3.jar.
But i did modified cat /var/lib/tomcat7/shared/classes/alfresco-global.properties and add shared.loader= /var/lib/tomcat7/shared/classes
in catalina.properties.Alfresco connect automatically to Mysql, a Mysql command prompt appears showing this msg:

"150422 11:48:06 [Note] Plugin 'FEDERATED' is disabled.
150422 11:48:06 InnoDB: The InnoDB memory heap is disabled
150422 11:48:06 InnoDB: Mutexes and rw_locks use Windows interlocked functions
150422 11:48:06 InnoDB: Compressed tables use zlib 1.2.3
150422 11:48:06 InnoDB: Initializing buffer pool, size = 128.0M
150422 11:48:06 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
150422 11:48:06  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait…
150422 11:48:06  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait…
150422 11:48:06  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150422 11:48:07  InnoDB: Waiting for the background threads to start
150422 11:48:08 InnoDB: 1.1.8 started; log sequence number 0
150422 11:48:08 [Note] Server hostname (bind-address): '0.0.0.0'; port: 33061
150422 11:48:08 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
150422 11:48:08 [Note] Server socket created on IP: '0.0.0.0'.
150422 11:48:08 [Note] Event Scheduler: Loaded 0 events
150422 11:48:08 [Note] E:\PROJET~1\ALFRES~1\ALFRES~1.B\mysql\bin\mysqld: ready for connections.
Version: '5.5.28'  socket: ''  port: 33061  MySQL Community Server (GPL)