由于alfreco对utf-8的支持,需要设置mysql的字符集,否则中文显示为??
以下所有的操作的前提环境如下(对其余系统不保证有效)
在/etc/my.cnf中
[mysqld] |
port = 3306 |
socket = /tmp/mysql.sock |
default-character-set=utf8 // 这句要有 |
[mysql] |
no-auto-rehash |
default-character-set=utf8 // 这句要有 |
问题:
alfresco 启动不了
在一次重启系统之后,alfresco启动不了
8080端口虽然打开,但是alfresco页面打不开
查看日志 /usr/local/alfresco/tomcat/logs/catalina.out
出错内容如下
INFO: Deploying web application archive alfresco.war 21:19:57,118 ERROR [web.context.ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘serverConnector’ defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is java.io.IOException: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi]: javax.naming.NameAlreadyBoundException: alfresco/jmxrmi [Root exception is java.rmi.AlreadyBoundException: alfresco/jmxrmi] Caused by: java.io.IOException: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi]: javax.naming.NameAlreadyBoundException: alfresco/jmxrmi [Root exception is java.rmi.AlreadyBoundException: alfresco/jmxrmi] 中间略 ( 很多错误信息 ) SEVERE: Error listenerStart Jul 2, 2008 9:33:03 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/alfresco] startup failed due to previous errors Jul 2, 2008 9:33:04 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 |
这样启动以后发现8080端口是开的,但是alfresco访问不了
参照[url]http://forums.alfresco.com/en/viewtopic.php?f=8&t=7&p=43150&hilit=org.springframework.beans.factory.BeanCreationException#p43150[/url]
的说明,说到的是alfresco连不到数据库,以前一直都是好的.里面提到的解决办法
first you have to remove the alfresco database in mysql using the db_remove.sql second create the database using the db_setup.sql third clean your alf_data… (delete all the foLders inside th alf_data dir) fourth run alfresco then [url]http://localhost:8080/alfresco…[/url] it should run.. |
我做的是:
先将alfresco给停止掉
将当前的alf_data文件夹 和alfresco数据库备份
然后执行extras/databases/mysql/db_remove.sql 这个sql文件
作用是删掉MYSQL中alfresco这个mysql用户和alfresco数据库
这个sql文件的内容如下
drop database alfresco; revoke all privileges, grant option from ‘alfresco’@’localhost’; drop user ‘alfresco’@’localhost’; |
然后将alf_data里面的内容删掉
然后执行 less extras/databases/mysql/db_setup.sql 这个sql文件
它的功能是创建alfresco用户和数据库,内容如下
create database alfresco; grant all on alfresco.* to ‘alfresco’@’localhost’ identified by ‘alfresco’ with grant option; grant all on alfresco.* to ‘alfresco’@’localhost.localdomain’ identified by ‘alfresco’ with grant option; |
然后重启机器,手动启动alfresco 会看到
正常启动的日志tomcat/logs/catalina.out如下
Jul 2, 2008 9:28:05 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive alfresco.war 21:28:26,990 WARN [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry – creating new one 21:28:30,101 INFO [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect. 21:28:30,232 INFO [domain.schema.SchemaBootstrap] Executing database script /usr/local/alfresco/tomcat/temp/Alfresco/AlfrescoSchemaCreate-org.hibernate.dialect.MySQLInnoDBDialect-58118.sql (Generated). 21:28:31,785 INFO [domain.schema.SchemaBootstrap] Executing database script /usr/local/alfresco/tomcat/temp/Alfresco/AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-58119.sql (Copied from classpath:alfresco/dbscripts/create/2.1/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-2.1-FKIndexes.sql). 21:28:31,824 INFO [domain.schema.SchemaBootstrap] All executed statements written to file /usr/local/alfresco/tomcat/temp/Alfresco/AlfrescoSchemaUpdate-All_Statements-58120.sql. 21:29:26,752 WARN [repo.admin.ConfigurationChecker] The Alfresco ‘dir.root’ property is set to a relative path ‘./alf_data’. ‘dir.root’ should be overridden to point to a specific folder. 21:29:26,752 INFO [repo.admin.ConfigurationChecker] The Alfresco root data directory (‘dir.root’) is: ./alf_data 21:29:26,766 INFO [admin.patch.PatchExecuter] Checking for patches to apply … 21:29:26,855 INFO [repo.module.ModuleServiceImpl] Found 0 module(s). 21:29:26,976 ERROR [alfresco.smb.protocol] Failed to get local domain/workgroup name, using default of WORKGROUP 21:29:26,976 ERROR [alfresco.smb.protocol] (This may be due to firewall settings or incorrect <broadcast> setting) 21:29:27,013 INFO [service.descriptor.DescriptorService] Alfresco JVM – v1.5.0_14-b03; maximum heap size 493.063MB 21:29:27,014 WARN [service.descriptor.DescriptorService] Alfresco JVM – WARNING – maximum heap size 493.063MB is less than recommended 512MB 21:29:27,014 INFO [service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 2.1.0 (484) schema 64 – Installed version 2.1.0 (484) schema 64 Jul 2, 2008 9:29:30 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Jul 2, 2008 9:29:30 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Jul 2, 2008 9:29:30 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 85514 ms |
就是说它会运行很多的sql文件在里面(因为当前数据库为空),这个时间会有点长
此时访问是正常的,可是还要恢复数据
先将alfresco停止
将alfreco的备份文件导入:
sql文件导入到数据库,然后把alf_data也放到/usr/local/alresco下
重新启动alfresco
第一次启动可能不行,先将它关了,手工启动一次
正常情况下的日志tomcat/logs/catalina.out如下
Jul 2, 2008 9:38:34 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive alfresco.war 21:38:55,014 WARN [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry – creating new one 21:38:58,452 INFO [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialec t. 21:39:02,508 INFO [domain.schema.SchemaBootstrap] No changes were made to the schema. 21:39:04,759 WARN [repo.admin.ConfigurationChecker] The Alfresco ‘dir.root’ property is set to a relative path ‘./alf_data’. ‘dir.root’ should be overridden to point to a specific folder. 21:39:04,759 INFO [repo.admin.ConfigurationChecker] The Alfresco root data directory (‘dir.root’) is: ./alf_data 21:39:05,493 INFO [admin.patch.PatchExecuter] Checking for patches to apply … 21:39:05,591 INFO [repo.module.ModuleServiceImpl] Found 0 module(s). 21:39:05,805 ERROR [alfresco.smb.protocol] Failed to get local domain/workgroup name, using default of WORKGROUP 21:39:05,805 ERROR [alfresco.smb.protocol] (This may be due to firewall settings or incorrect <broadcast> setting) 21:39:05,844 INFO [service.descriptor.DescriptorService] Alfresco JVM – v1.5.0_14-b03; maximum heap size 493.063MB 21:39:05,844 WARN [service.descriptor.DescriptorService] Alfresco JVM – WARNING – maximum heap size 493.063MB is less than recommended 512MB 21:39:05,845 INFO [service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 2.1.0 (484) s chema 64 – Installed version 2.1.0 (484) schema 64 Jul 2, 2008 9:39:09 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Jul 2, 2008 9:39:09 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Jul 2, 2008 9:39:09 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 36241 ms |
本文转自yahoon 51CTO博客,原文链接:http://blog.51cto.com/yahoon/85502,如需转载请自行联系原作者