cancel
Showing results for 
Search instead for 
Did you mean: 

Deploying .WARs to an existing Tomcat installation

matt_bennett
Champ in-the-making
Champ in-the-making
Hello,

I have succeeded in installing a Alfresco Community 3.3 using the Linux and OS X installers, but I'm struggling to create a deployment into an existing Tomcat instance. There are several scant forum topics on the subject e.g. [1], and I'm new to Tomcat, but there does not seem to be a definitive guide on how to achieve this. I'm not sure what needs copying and to where.

I started with a clean Debian Lenny machine, and apt-get install'd sun-java6-jdk, tomcat5.5 and all the other dependencies. I compiled swftools-0.9.1 from source. We have a separate MySQL server which will be used for Alfresco's data.

Following the guide at [2], section "Installing the Alfresco WAR on any platform", I grabbed alfresco-community-war-3.3.tar.gz and duly copied the .war files into /var/lib/tomcat5.5/webapps. Upon restarting the server, Tomcat barfed an enormous mess into my syslog, beginning:

Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.security.AccessController.checkPermission(AccessController.java:546)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Thread.setContextClassLoader(Thread.java:1351)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager$Cleaner.<init>(LogManager.java:206)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager$Cleaner.<init>(LogManager.java:200)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager.<init>(LogManager.java:237)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.juli.ClassLoaderLogManager.<init>(ClassLoaderLogManager.java:44)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Class.newInstance0(Class.java:355)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Class.newInstance(Class.java:308)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager$1.run(LogManager.java:166)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.security.AccessController.doPrivileged(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager.<clinit>(LogManager.java:158)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.Logger.getLogger(Logger.java:273)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.Jdk14Logger.getLogger(Jdk14Logger.java:181)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.Jdk14Logger.<init>(Jdk14Logger.java:61)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Class.newInstance0(Class.java:355)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Class.newInstance(Class.java:308)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:139)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: Can't load log handler "1catalina.org.apache.juli.FileHandler"
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.security.AccessController.doPrivileged(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager$3.run(LogManager.java:359)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.security.AccessController.doPrivileged(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:346)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager.addLogger(LogManager.java:447)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager$1.run(LogManager.java:182)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.security.AccessController.doPrivileged(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.LogManager.<clinit>(LogManager.java:158)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.util.logging.Logger.getLogger(Logger.java:273)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.Jdk14Logger.getLogger(Jdk14Logger.java:181)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.Jdk14Logger.<init>(Jdk14Logger.java:61)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Class.newInstance0(Class.java:355)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at java.lang.Class.newInstance(Class.java:308)
Nov 18 17:50:24 alfresco01-ss-imn jsvc.exec[5026]: #011at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:139)

I didn't copy anything in to /var/lib/tomcat5.5/shared/classes/ or /var/lib/tomcat5.5/shared/lib/, nor do I have an alfresco-global.properties file yet. I figured if there was no MySQL connector the traceback would have been something along those line…

Have I done something fundamentally wrong? Is there any better documentation than [2] hiding somewhere?

Many thanks,
Matt.

[1] http://forums.alfresco.com/en/viewtopic.php?t=14703
[2] http://www2.alfresco.com/e/1234/4-2009-10-05-F2TF5-1234-43621-/MUSXR/315847155 (via http://www.alfresco.com/community/resources/documentation/)
7 REPLIES 7

mrogers
Star Contributor
Star Contributor
What you have done should work….    It should be that simple.

However the more recent versions of Alfresco require Java 1.6.    And while Tomcat5.5 was a good and venerable platform most users will be using a more recent version.

Your problem is not connected to Alfresco,  Tomcat is not getting as far as doing anything with Alfresco.   I've never seen anything like your problem :?  but have you changed or deleted anything else or possibly are you trying to run Alfresco with a different user account that does not have access to certain files

matt_bennett
Champ in-the-making
Champ in-the-making
What you have done should work…. It should be that simple

OK good, thanks.

Your problem is not connected to Alfresco… have you changed or deleted anything else

The 'manager' and 'admin' applications that ship with Tomcat work correctly. I modified tomcat-users.xml to add a manager role, but that's it. I wasn't given the opportunity to run alfresco as a different user - I just dropped in the .war, restarted and boom! Broken Smiley Sad

I will try again with Tomcat 6 and report back.

matt_bennett
Champ in-the-making
Champ in-the-making
Cool. Some progress with Tomcat 6…

I have:
  • deployed the .WARs into $CATALINA_HOME/webapps

  • created the $CATALINA_HOME/shared/classes and $CATALINA_HOME/shared/lib directories

  • copied commons-el.jar & mysql-connector-java-5.1.7-bin.jar into $CATALINA_HOME/shared/lib (which I got from the tomcat bundle within alfresco-community-tomcat-3.3.tar.gz)
Predictably, alfresco now complains about the database connection:


19-Nov-2010 12:12:59 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
19-Nov-2010 12:12:59 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
19-Nov-2010 12:13:00 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
19-Nov-2010 12:13:00 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
19-Nov-2010 12:13:00 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
19-Nov-2010 12:13:00 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/35  config=null
19-Nov-2010 12:13:00 org.apache.catalina.startup.Catalina start
INFO: Server startup in 15458 ms

12:13:02,814  INFO  [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
12:13:02,816  INFO  [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
12:13:02,904  INFO  [alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]
12:13:05,202  WARN  [hibernate.cfg.SettingsFactory] Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

Last packet sent to the server was 0 ms ago.)
   at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
   at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
   at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)

I didn't have a global config file, so I created a minimal one at $CATALINA_HOME/shared/classes/alfresco-shared.properties. But no dice.

The docs seem sparse on this matter. Have I put it in the wrong place?

Thanks,
Matt.

mrogers
Star Contributor
Star Contributor
Right location but the file should be called alfresco-global.properties.

And have you remembered to set up the shared class loader for Tomcat6?
http://wiki.alfresco.com/wiki/Install_Tomcat6

matt_bennett
Champ in-the-making
Champ in-the-making
Thanks mrogers.

I had missed some of the steps listed in the http://wiki.alfresco.com/wiki/Install_Tomcat6 – specifically copying all the contents of shared/classes across. These steps aren't listed in the documentation at [1] (it just says "create the shared/classes directory") and the files aren't distributed in the alfresco-community-war archive, which is confusing.

Explorer and Share attempt to start now, but Explorer dies in a storm of PermGen Space out-of-memory errors. For the time being I've given up and started using the bundled tomcat deployment.

Matt.


[1] http://www2.alfresco.com/e/1234/4-2009-10-05-F2TF5-1234-43621-/MUSXR/315847155

mrogers
Star Contributor
Star Contributor
The PermGen problems are simple to fix and are well covered in these forums, you just need to increse the memory.

R.E. "specifically copying all the contents of shared/classes across."   You should not copy everything, only the one or two bits that you need to change.    Minimising the configuration will help when it comes time to upgrade.

matt_bennett
Champ in-the-making
Champ in-the-making
The PermGen problems *are* simple to fix - all I did was add
JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=128m
to my catalina.sh file.

Hopefully this thread will help others achieve the same thing.

Thanks for your patience,
Matt.