cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco war on ubuntu 7.10

alixbarbosa
Champ in-the-making
Champ in-the-making
I'm having problems installing the Alfresco war on a Ubuntu 7.10 server (console interface)

heres what i have done so far on a new install:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install sun-java6-jdk sun-java6-jre

sudo vim /etc/profile


JAVA_HOME=/usr/lib/jvm/java-6-sun; export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

CATALINA_HOME=/usr/share/tomcat5.5
TOMCAT_HOME=/usr/ share/tomcat5.5
CLASSPATH=.
export CATALINA_HOME TOMCAT_HOME CLASSPATH

sudo apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps

sudo vim /usr/share/tomcat5.5/conf/tomcat-users.xml

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="admin"/>
  <role rolename="manager"/>
  <user username="username" password="password" roles="admin,manager"/>
</tomcat-users>

sudo apt-get install imagemagick xvfb openoffice.org
sudo apt-get install mysql-server

sudo wget -c http://garr.dl.sourceforge.net/sourceforge/alfresco/alfresco-community-war-2.1.0.tar.gz
sudo mkdir alfresco
sudo tar xvfz alfresco-community-war-2.1.0.tar.gz -C alfresco
sudo vm -rv alfresco /usr/share/tomcat5.5-webapps/

cd /usr/share/tomcat5.5-webapps/alfresco/extras/databases/mysql/
mysql -u root -p <db_setup.sql

sudo wget -c http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.5.tar.gz/from/http://mysql.e...
sudo tar xvzf mysql-connector-java-5.1.5.tar.gz
sudo mv mysql-connector-java-5.1.5/mysql-connector-java-5.1.5-bin.jar /usr/share/tomcat5.5/common/lib/
sudo cp /usr/share/tomcat5.5/common/lib/mysql-connector-java-5.1.5-bin.jar /usr/share/tomcat5.5/server/default/lib/
sudo rm -r mysql-connector-java-5.1.5 mysql-connector-java-5.1.5.tar.gz


after this i used the following from  http://wiki.alfresco.com/wiki/Debian_Installation

* Configuring configuration files (accordantly)
* Edited repository.properties accordantly

After this i got the following error:

30/Dez/2007 3:32:59 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8180
30/Dez/2007 3:32:59 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
30/Dez/2007 3:32:59 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/18  config=null
30/Dez/2007 3:32:59 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
30/Dez/2007 3:32:59 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1628 ms
Dec 30, 2007 2:44:23 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib
Dec 30, 2007 2:44:23 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8180
Dec 30, 2007 2:44:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1392 ms
Dec 30, 2007 2:44:23 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 30, 2007 2:44:23 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5
Dec 30, 2007 2:44:23 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Dec 30, 2007 2:44:29 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory alfresco
org.apache.commons.logging.LogConfigurationException: java.lang.ExceptionInInitializerError (Caused by java.lang.ExceptionInInitializerError)
(..)
Caused by: java.lang.ExceptionInInitializerError
        at org.apache.log4j.Logger.getLogger(Logger.java:85)
        at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
        at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        … 33 more
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission alfresco.log write)
(..)

I tried editing log4j.properties to point log4j.appender.File.File= to a chmod 777 dir but i get the same error.. ( different dir on error)

Can someone give a hand here?
13 REPLIES 13

steve
Champ in-the-making
Champ in-the-making
Hi,

Have you followed the instructions here?:
http://wiki.alfresco.com/wiki/Installing_Alfresco_on_Ubuntu_7.10

Specifically, the section:

Create a directory for the logs and make the user and group alfresco it's owner:

mkdir -p /var/log/alfresco/tomcat/logs

chown -R alfresco:alfresco /var/log/alfresco

The Alfresco log will be in /var/log/alfresco/alfresco.log.

Steve

gcastro
Champ in-the-making
Champ in-the-making
I deployed the alfresco war ( alfresco-community-war-2.1.0.zip ) with the Tomcat manager, the directory webapps\alfresco was created.

But Tomcat Manager does not list alfresco as application.

apeshansky
Champ in-the-making
Champ in-the-making
Hi,

Have you followed the instructions here?:
http://wiki.alfresco.com/wiki/Installing_Alfresco_on_Ubuntu_7.10

Specifically, the section:

Create a directory for the logs and make the user and group alfresco it's owner:

mkdir -p /var/log/alfresco/tomcat/logs

chown -R alfresco:alfresco /var/log/alfresco

The Alfresco log will be in /var/log/alfresco/alfresco.log.

Steve
I am having the same problems as alixbarbosa, to whom Steve replied in quoted message, although I am installing Alfresco on Ubuntu 6.06 LAMP server.  I did essentially the same things as alixbarbosa did, and I did follow quoted directions (fixing minor errors in Installing_Alfresco_on_Ubuntu_7.10 wiki page in the process):

alex@gcrc-dev:~$ sudo  mkdir -p /var/log/alfresco/tomcat/logs
alex@gcrc-dev:~$ sudo  chown -R alfresco:alfresco /var/log/alfresco
alex@gcrc-dev:~$ ls -ld /var/log/alfresco/
drwxr-x— 2 alfresco alfresco 4096 2008-02-04 10:35 /var/log/alfresco/
My error message is (the source of error, I believe)

INFO: Installing web application at context path /alfresco from URL file:/var/lib/tomcat5/webapps/alfresco
Feb 5, 2008 12:22:48 PM org.apache.catalina.startup.HostConfig deployWARs
SEVERE: Exception while expanding web application archive alfresco.war
java.lang.ExceptionInInitializerError
[ … ]
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /var/log/alfresco/alfresco.log write)
I tried the following:
1. Allow all access to /var/log/alfresco/:
alex@gcrc-dev:~$ sudo chmod -R 777 /var/log/alfresco/
alex@gcrc-dev:~$ ls -ld /var/log/alfresco/
drwxrwxrwx 2 alfresco alfresco 4096 2008-02-05 10:35 /var/log/alfresco/
- no effect.
2. Manually creating alfresco.log file:
sudo touch /var/log/alfresco/alfresco.log
sudo chmod 777 /var/log/alfresco/alfresco.log
- no effect.
3. Changing Alfresco logging configuration in tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties:
log4j.appender.File.File=/home/alfresco/alfresco.log
- no effect.
4. Changing ownership of /var/log/alfresco/ subtree to tomcat5:nogroup (default tomcat user) - no effect.

The only changes I saw was different directory in the error message when I change it in log4j.properties.

Anyone knows what the problem is?

alixbarbosa
Champ in-the-making
Champ in-the-making
@apeshansky I did exactly the same thing has you.. I should have updated the thread Smiley Frustrated.

I'm still trig to make the war work tho.. I would like to get the war working instead of the tomcat+alfresco pack..

Can anyone give us a hand please.

apeshansky
Champ in-the-making
Champ in-the-making
@apeshansky I did exactly the same thing has you.. I should have updated the thread Smiley Frustrated.

I'm still trig to make the war work tho.. I would like to get the war working instead of the tomcat+alfresco pack..

Can anyone give us a hand please.

OK, with the help of with Java Guru (my son, who is doing research on Java compilers for IBM), we discovered that the error was not file system permissions, but Java security manager permissions Smiley Surprisedops: (the key was in the log line immediately after the one alixbarbosa ended quoting with:
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /var/log/tomcat5/alfresco.log write)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)

So we did web search for "tomcat FilePermission ExceptionInInitializerError", and found (http://nutch.sourceforge.net/cgi-bin/twiki/view/Main/GettingNutchRunningOnDebian) a solution: grant Alfresco permission to access files. :idea:  Just insert a line
permission java.io.FilePermission "/var/log/alfresco/*", "read,write,delete";
into /etc/tomcat5/policy.d/04webapps.policy right before closing }.

I am now getting different error
 FATAL [webapp.webxml.WebXmlParser] Unable to parse web.xml
java.security.AccessControlException: access denied (java.net.SocketPermission
java.sun.com:80 connect,resolve)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
which apparently means that I should find why alfresco cannot talk to java.sun.com:80 and let it.

Very similar solution: add line
permission java.net.SocketPermission "java.sun.com:80", "connect,resolve";
after the previous one in the same /etc/tomcat5/policy.d/04webapps.policy.

Restart tomcat … and now the error is
ERROR [web.context.ContextLoader] Context initialization failed
java.security.AccessControlException: access denied (java.util.PropertyPermission alfresco.jmx.dir write)
OK, this is almost too easy Smiley Happy : add line
permission java.util.PropertyPermission "alfresco.jmx.dir", "read,write";
into the familiar place.

Restart tomcat … and now the error is
ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneFullTextSearchIndexer' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path …
Oh, well, this can wait until tomorrow :wink:

apeshansky
Champ in-the-making
Champ in-the-making
The saga of installation continues…

When I saw the error message
INFO: Installing web application at context path /alfresco from URL file:/var/lib/tomcat5/webapps/alfresco
10:34:09,295 ERROR [web.context.ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneFullTextSearchIndexer' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory. BeanCreationException: Error creating bean with name 'dbNodeService' defined in
class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'nodeDaoService' while setting bean property 'nodeDaoService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeDaoService' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean 'nodeDaoServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeDaoServiceImpl' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]:
Invocation of init method failed; nested exception is java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
[ … ]
I first thought that I did not copy all folders packed into alfresco-community-war-2.1.0.tar.gz (./extensions, ./extras etc.) to the proper place. From analyzing what alfresco-community-tomcat-2.1.0.tar.gz unpacks into it looked like "proper place" should be /var/liv/tomcat5/shared/classes/alfresco.

When copying everything there and restarting tomcat did not bring me one step closer (same error), I noticed the last line in quoted error:
Invocation of init method failed; nested exception is java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
:idea: Time to add more permissions to /etc/tomcat5/policy.d/04webapps.policy:
permission java.lang.RuntimePermission "accessDeclaredMembers";
Restart … failed again.  But now that line says
Invocation of init method failed; nested exception is java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
:idea: Adding
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
Restart … A-ha!  Now the error is
Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: EHCache configuration failed
Further in the message the real culprit seems to be
Caused by: net.sf.ehcache.CacheException: Error configuring from file:/var/lib/tomcat5/webapps/alfresco/WEB-INF/classes/alfresco/ehcache-default.xml. Initial cause was Error configuring from input stream. Initial cause was null:5: Could not set attribute "path".. Message was: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
:idea: Let's give alfresco Java permissions to user.home:
permission java.util.PropertyPermission "user.home", "read";
Restarting … Nope.  The security exception now seems to be
java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
Giving rights to user.* (replace the line above with
permission java.util.PropertyPermission "user.*", "read";
) Restarting … Nope.  The security exception now seems to be
java.security.AccessControlException: access denied (java.util.PropertyPermission java.io.tmpdir read)
OK, adding this permission:
permission java.util.PropertyPermission "java.io.tmpdir", "read";
Now it wants to read net.sf.ehcache.disabled; adding permissions to the ehcache.*
permission java.util.PropertyPermission "net.sf.ehcache.*", "read";
Now it wants to read /var/lib/tomcat5/temp ?!!
ERROR [ehcache.store.DiskStore] org.alfresco.cache.ticketsCacheCache: Could not create disk store. Initial cause was access denied (java.io.FilePermission /var/lib/tomcat5/temp read)
I guess it is looking for tomcat5.pid there.  OK, let's allow it:
permission java.io.FilePermission "/var/lib/tomcat5/temp/*", "read";
Restart … and the same error.  Now I'm stuck.

alixbarbosa
Champ in-the-making
Champ in-the-making
I'm on trip so i only have my laptop, can help you out real time.

Try 
permission java.io.FilePermission "/var/lib/tomcat5/temp", "read";

as it can be access to the directory itself ( i think its possible to have access to the files within the directory but can't get to them cause of the permitions of the directory itself - I may be mistaken )

apeshansky
Champ in-the-making
Champ in-the-making
I'm on trip so i only have my laptop, can help you out real time.

Try 
permission java.io.FilePermission "/var/lib/tomcat5/temp", "read";

as it can be access to the directory itself ( i think its possible to have access to the files within the directory but can't get to them cause of the permitions of the directory itself - I may be mistaken )

Great idea!  Actually, I looked up match rules at http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html, and after several iteration ended up with
  permission java.io.FilePermission "/var/log/alfresco/*", "read,write,delete";
  permission java.io.FilePermission "/var/lib/alfresco/*", "read,write,execute";
  permission java.io.FilePermission "/var/lib/alfresco/alf_data/-", "read,write,delete,execute";
  permission java.io.FilePermission "/var/lib/alfresco/tmp/-", "read,write,delete,execute";
as {trailing -} syntax apparently expands to both named directory, all files in it, all its subdirectories and all files in them.
Now I am at
java.lang.NoClassDefFoundError: Could not initialize class org.alfresco.repo.security.authentication.MD4PasswordEncoderImpl
which is rather strange, as this class seem to be defined in webapps/alfresco/WEB-INF/lib/alfresco-repository.jar, but there is no alfresco-repository.jar in /opt/alfresco/ tree created by untarring alfresco-community-tomcat!

alixbarbosa
Champ in-the-making
Champ in-the-making
did it work or did you get a new error?