cancel
Showing results for 
Search instead for 
Did you mean: 

Backport of Alfresco to 1.4.2

furtado
Champ in-the-making
Champ in-the-making
I was working on a freeBSD 4 system to install Alfresco. There is not currently a stable build of Java 5 available for the system. After a few sleepless nights, a little help from google, and thanks to Retroweaver, I was able to successfully deploy Alfresco after a few mods on a Java 1.4.2 JVM. If any body is interested I would be willing to forward the WAR (really huge) or the build files…
9 REPLIES 9

kevinr
Star Contributor
Star Contributor
That's a very impressive effort! Smiley Surprised I would have expected that to have been some hard work indeed!

In theory this means your build of Alfresco could be deployed to app-servers that don't support 1.5 such as WebSphere…

Cheers,

Kevin

gavinc
Champ in-the-making
Champ in-the-making
Yes, we'd definitely be interested in the build files.

furtado
Champ in-the-making
Champ in-the-making
Yes I have it running on a freebsd 4 with java 1.4.2 and tomcat 5.0

furtado
Champ in-the-making
Champ in-the-making
I just mailed the info to John Newton <john.newton@alfresco.org>

furtado
Champ in-the-making
Champ in-the-making
Just in case here are the steps I followed. I did it in Eclipse

1) download bin of retrotranslator from http://retrotranslator.sourceforge.net/

2) unzip retrotranslator into 3rd-party/lib/retrotranslator

3) copy retrotranslator-runtime-0.9.8.jar and backport-util-concurrent.jar into 3rd-party/lib

4) Change the common.xml to use the retrotranslator
   <target name="compile-java" depends="init" description="Compiles the Java source code">
        <mkdir dir="${dir.classes}" />
       
        <taskdef
            resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
             <classpath refid="classpath.compile" />
      </taskdef>
      <javac destdir="${dir.classes}" fork="true" deprecation="on" debug="on" target="1.5" source="1.5">
            <src path="${dir.src.java}" />
            <classpath refid="classpath.compile" />
        </javac>
      <taskdef name="retrotranslator" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask">
            <classpath refid="classpath.retrotranslator" />
       </taskdef>
       
       <echo message="Starting Retrotranslator to backport to 1.4.2"/>
      <retrotranslator srcdir="${dir.classes}"/>       

        <copy todir="${dir.classes}">
            <fileset dir="${dir.src.java}">
                <patternset>
                    <exclude name="**/*.java" />
                </patternset>
            </fileset>
        </copy>
    </target>


5) Change remote-api/project-build.xml (included)
    <!– we need to override the compile-java target so that we can include the generated source –>
    <target name="compile-java" depends="init" description="Compiles the Java source code">
        <mkdir dir="${dir.classes}" />
        <javac destdir="${dir.classes}" fork="true" deprecation="on" debug="on" target="1.5" source="1.5">
            <src path="${dir.src.java}" />
            <src path="${dir.src.java.generated}" />
            <classpath refid="classpath.compile" />
        </javac>

      <taskdef name="retrotranslator" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask">
            <classpath refid="classpath.retrotranslator" />
       </taskdef>
       
       <echo message="Starting Retrotranslator to backport to 1.4.2"/>
      <retrotranslator srcdir="${dir.classes}"/>       

        <copy todir="${dir.classes}">
            <fileset dir="${dir.src.java}">
                <patternset>
                    <exclude name="**/*.java" />
                </patternset>
            </fileset>
        </copy>
    </target>


6) download latest Apache Xerces and unzip the xercesImpl.jar and xml-apis.jar to 3rd-party/lib

7) Search the repository for org.alfresco.util.ISO9075.java  and change import to import org.apache.xerces.util.XMLChar;

😎 Search for all java.util.concurrent imports and change them to edu.emory.mathcs.backport.java.util.concurrent

9) Change the org.alfresco.util.transaction.SpringAwareUserTransaction.java to handle thread.getID() function that is not backported
( Line No. 83)
    private String threadId = "";

(Line 195)
        // a few quick self-checks
        if (threadId.length() == 0 && internalStatus != Status.STATUS_NO_TRANSACTION)
        {
            throw new RuntimeException("Transaction has been started but there is no thread ID");
        }
        else if (threadId.length() > 0 && internalStatus == Status.STATUS_NO_TRANSACTION)
        {
            throw new RuntimeException("Transaction has not been started but a thread ID has been recorded");
        }

(Line 218)
            if (Thread.currentThread().toString().compareTo(threadId) != 0)

(Line 330)
        threadId = Thread.currentThread().toString();


10) Change org.alfresco.web.bean.BrowseBean.java to handle  the  rowset enumeration. (Line No. 610).
            for (int i = 0; i < results.length(); i++)//ResultSetRow row: results)
            {
                ResultSetRow row = results.getRow(i);
               NodeRef nodeRef = row.getNodeRef();

11) Download Retroweaver (Just because it is easier and faster to backport jar files) from http://retroweaver.sourceforge.net/

12) Backport following jars to 1.4.2 (Unzip jar to harddisk, use the retroweaver-ex.jar GUI and backport unzipped files and Zip into jar) in the 3rd-party/lib directory
    a) myfaces-impl.jar
    b) myfaces-api.jar
    c) jaxen-1.1-beta-8.jar
    d) tm-extractors-0.4_patched.jar
    e) lucene-1.4.3.jar

13) As I used retroweaver to backport the Jars I had to include that runtime in 3rd-party/lib too. that can be avoided if you use the retrotranslator to do that too. It would just have taken me too much time…

Now build and deploy and enjoy!

furtado
Champ in-the-making
Champ in-the-making
Sorry Missed a step…
5a) Modify common-init.xml as follows
        <path id="classpath.retrotranslator">
         <fileset dir="${dir.common.lib}">
            <include name="**/retrotranslator/*.*" />
         </fileset>
        </path>

brobie
Champ in-the-making
Champ in-the-making
It was be so incredibly awesome if you would be willing to send me the .war and the source that has been backported to Java 1.4.2.

brobie (at) cdsfulfillment.com

Thank you so much!

andri_yadi
Champ in-the-making
Champ in-the-making
Please please email me your war that build using Java 1.4 or tell me the link to download. I desperately need it because I need to deploy alfresco to IBM WAS 5.
Please send me email to andri [at] dycode.com

Thanks very much.

shmc
Champ in-the-making
Champ in-the-making
Hello,
Could you please email me your war that build using Java 1.4 or tell me the link to download it.
My email is sergio.correia [at] pararede.com

Thanks,
Sérgio