Install Weblogic 10 WAR

From AlfrescoWiki

Jump to: navigation, search

Back to Server Installation


These are some simple instructions for installing Alfresco as a WAR into BEA Weblogic 10.

Please note that currently Alfresco isn't designed to be deployed as a WAR due to the fact that at bootstrap it uses filesystem lookups for certain config files, and because these files are in the WAR and haven't been exploded out the bootstrap fails. The steps below modify the WAR so that it can be deployed as a WAR, and future versions of Alfresco will be changed so that WAR deployment can happen without any modifications.


[edit] Example Deployment for 2.1

Alfresco 2.1(.1) has been successfully deployed on Weblogic 10 and MySQL DB as a WAR (unexploded) with the following steps:

Pre-requisites:

  • Install OpenOffice and ensure the binaries are in the path
  • Install MySQL and create an 'alfresco' database and user with appropriate permissions
  • Install Weblogic 10, but do not create any domains or servers yet

Installation Steps (for Win platforms):

  1. Use the BEA Configuration Wizard to create a new domain, e.g.'alf_domain'
  2. The Alfresco WAR file needs some files editing, and some new files added so open it in your favorite zip file editor (or rename it to 'alfresco.zip' to open it).
    1. Add weblogic.xml to the WAR's WEB-INF dir
    2. Add application.xml to WAR's META_INF dir
    3. [Fixed in 2.1.3E] Extract and edit the file WEB-INF/classes/alfresco/core-services-context
      1. Comment out the bean 'runtimeProperties'
    4. [Fixed in 2.1.3E] Extract the files alfresco-jmxrmi.access and alfresco-jmxrmi.password from WEB-INF/classes/alfresco/ and put them on the path. Note, you can comment out the entries in core-services-context that refer to the jmxrmi files but there will be an extra error on the startup of WLS (that will have no impact).
    5. [Fixed in 2.1.3E] Extract and edit the file WEB-INF/classes/alfresco/web-scripts-application-context
      1. Comment out the 2 beans '<bean parent="webscripts.classpathstore">'
    6. Move the following libraries from WEB-INF/lib folder to bea/user_projects/domains/alf_domain/lib/
      1. xercesImpl-2.8.0.jar
      2. xml-apis.jar
      3. rhino-js-1.6R7.jar
    7. Close the WAR file
  3. Edit setDomainEnv.cmd/sh file in the C:\bea\user_projects\domains\alf_domain\bin\ folder (or Linux equivalent)
    1. Edit the PRE_CLASSPATH variable and add the following:
      1. set PRE_CL ASSPATH=%PRE_CLASSPATH%;C:\bea\user_projects\domains\alf_domain\lib\xercesImpl-2.8.0.jar
      2. set PRE_CLASSPATH=%PRE_CLASSPATH%;C:\bea\user_projects\domains\alf_domain\lib\xml-apis.jar
      3. set PRE_CLASSPATH=%PRE_CLASSPATH%;C:\bea\user_projects\domains\alf_domain\lib\rhino-js-1.6R4.jar
  4. The JSP's need to be precompiled otherwise you may get runtime compilation errors, which can be performed in a few ways:
    1. Use 'weblogic.appc' to precompile the JSPs:
      1. Open a Command Prompt
      2. Run the setDomainEnv.cmd command (e.g. C:\bea\user_projects\domains\alf_domain\bin\setDomainEnv.cmd
      3. Run the 'weblogic.appc' command, e.g. java -Xmx512m -server weblogic.apcc -classpath <your classpath here> alfresco.war
        1. Example command: java -Xmx512m -server weblogic.appc -classpath C:\bea\user_projects\domains\alf_domain\lib;C:\bea\user_projects\domains\alf_domain\servers\AdminServer\tmp\_WL_user\alfresco\hp7x2s\war\WEB-INF\classes;C:\bea\patch_wls1001\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\bea\JDK150~1\lib\tools.jar;C:\bea\WLSERV~1.0\server\lib\weblogic_sp.jar;C:\bea\WLSERV~1.0\server\lib\weblogic.jar;C:\bea\modules\features\weblogic.server.modules_10.0.1.0.jar;C:\bea\modules\features\com.bea.cie.common-plugin.launch_2.1.2.0.jar;C:\bea\WLSERV~1.0\server\lib\webservices.jar;C:\bea\modules\ORGAPA~1.5/lib/ant-all.jar;C:\bea\modules\NETSFA~1.0/lib/ant-contrib.jar;;C:\bea\WLSERV~1.0\common\eval\pointbase\lib\pbclient51.jar;C:\bea\WLSERV~1.0\server\lib\xqrl.jar; alfresco.war
    2. Place a directive in the weblogic.xml to enable pre-compile at deploy time:
      1. Use this weblogic.xml in place of the one above:
  5. Place the MySQL Connector in the Alfresco Domain's Lib directory (e.g. C:\bea\user_projects\domains\alf_domain\lib directory)
  6. Start Weblogic (e.g. C:\bea\user_projects\domains\alf_domain\startWebLogic.cmd)
  7. Place the WAR into the autodeploy directory. This should trigger a WebLogic autodeploy (Note: you need to be running Weblogic in development mode)
  8. Note: If you see classNotFound exceptions you may need to do the following, suggestions welcome on alternative solutions.
    1. Update the classpath and path for the deployed war in setDomainEnv.cmd by adding the following 2 lines to end of the file. You will need to change the path to match your install location e.g.
      1. set CLASSPATH=%PRE_CLASSPATH%;C:\bea\user_projects\domains\alf_domain\lib;C:\bea\user_projects\domains\alf_domain\servers\AdminServer\tmp\_WL_user\alfresco\hp7x2s\war\WEB-INF\classes;%WEBLOGIC_CLASSPATH%;%POST_CLASSPATH%;%WLP_POST_CLASSPATH%
      2. set PATH=%PATH%;C:\bea\user_projects\domains\alf_domain\lib
  9. Start and test the installation by opening http://localhost:7001/alfresco in a browser

[edit] Using Alfresco Extension mechanism

If you want to use the Alfresco Extension mechanism to configure Alfresco without modifying core configuration files, you can do so by doing the following:

  1. Place the extension files somewhere, e.g. in the BEA domain's lib directory
    1. The dir structure should then be .../bea/user_projects/domains/alf_domain/lib/alfresco/extension/
  2. Add the ".../bea/user_projects/domains/alf_domain/lib" dir to the classpath so that these files can get picked up
    1. Edit the .../bea/user_projects/domains/alf_domain/bin/setDomainEnv.sh/bat file and include the above dir in one of the classpath setting statements (e.g. PRE_CLASSPATH=".../bea/user_projects/domains/alf_domain/lib")
  3. License files can then be placed into the .../bea/user_projects/domains/alf_domain/lib/alfresco/extension/license directory



Notes:

Because some webscripts were not loaded at bootstrap trying to use these could cause issues in the web client.

You may see the following error come up (observed on 2.1.3 and 2.2). Contact Alfresco support for resolution to the issue. It is being tracked at http://issues.alfresco.com/browse/ETWOTWO-345.

11:38:34,877 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.service.license.LicenseException: Failed to install license file enterprise-network-customer-unlimited.lic
        at org.alfresco.license.LicenseComponent.verifyLicense(LicenseComponent.java:142)