cancel
Showing results for 
Search instead for 
Did you mean: 

JBoss build (Still supported?)

edk
Champ in-the-making
Champ in-the-making
I have been trying to build Alfresco using the following directions: http://wiki.alfresco.com/wiki/Alfresco_SVN_Development_Environment

But I get into problems when trying the following command
ant build-jboss
It seems that the jboss targets where removed with SVN v8881. That commit's comment was:
r8881 | gavinc | 2008-04-24 17:08:54 -0400 (Thu, 24 Apr 2008) | 8 lines

Improved build scripts
  - Cleaned up spaghetti dependencies
  - More stable build process for WAR files
  - Added consistent top level targets for building and deploying all WAR files
  - Improved clean targets
  - Improved -projecthelp/-p output (now only shows top level useful targets)
  - Fixed issue in continuous build for Paul where tomcat instance was required
  - Continuous build now packages slingshot.war in relevant bundles
The jboss targets are excluded as of SVN v13002.

So, is jboss still supported as a build target? If so, is there new documentation?
13 REPLIES 13

mlmalfresco123
Champ in-the-making
Champ in-the-making
Ok. Ya I"m using Windows and pure JBoss AS 4.05GA & JBoss Portal 2.4. The OS may be the difference.. Thanks for your help.. I"ll keep looking.

mlmalfresco123
Champ in-the-making
Champ in-the-making
Ok.. I found that the compile error I was having about "package-info.java" is due to some quirky bug with the JRE I was using 1.5.0_16 - but this I believe only happens when you run on Windows - Once I upgraded to 1.6 JRE on Windows, it compiled fine. I believe however, when compiling against 1.5.0_16 on Linux - as edk said above, everything compiles fine.

edk
Champ in-the-making
Champ in-the-making
I've now been able to reproduce to get this working - just as well as the package does. Starting out with jboss-4.2.3.GA.zip, then apply this patch:

diff -u -r jboss-org/bin/run.sh jboss/bin/run.sh
— jboss-org/bin/run.sh   2008-07-18 14:18:48.000000000 -0400
+++ jboss/bin/run.sh   2009-02-03 15:48:33.000000000 -0500
@@ -5,6 +5,9 @@
##                                                                          ##
### ====================================================================== ###

+JAVA_HOME="/home/ed/local/jdk1.6.0_11"
+JAVA_OPTS="-Xms512m -Xmx1G -XX:MaxPermSize=128m -server -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false"
+
### $Id: run.sh 75849 2008-07-15 18:43:17Z dimitris@jboss.org $ ###

DIRNAME=`dirname $0`
Only in jboss/server/default/deploy: alfresco.war
diff -u -r jboss-org/server/default/deploy/ejb3.deployer/META-INF/persistence.properties jboss/server/default/deploy/ejb3.deployer/META-INF/persistence.properties
— jboss-org/server/default/deploy/ejb3.deployer/META-INF/persistence.properties   2008-07-18 14:21:02.000000000 -0400
+++ jboss/server/default/deploy/ejb3.deployer/META-INF/persistence.properties   2009-02-03 15:29:30.000000000 -0500
@@ -14,4 +14,4 @@
hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
hibernate.bytecode.use_reflection_optimizer=false
# I don't think this is honored, but EJB3Deployer uses it
-hibernate.bytecode.provider=javassist
\ No newline at end of file
+hibernate.bytecode.provider=cglib
diff -u -r jboss-org/server/default/deploy/jboss-web.deployer/conf/web.xml jboss/server/default/deploy/jboss-web.deployer/conf/web.xml
— jboss-org/server/default/deploy/jboss-web.deployer/conf/web.xml   2008-07-18 14:21:02.000000000 -0400
+++ jboss/server/default/deploy/jboss-web.deployer/conf/web.xml   2009-02-03 15:29:30.000000000 -0500
@@ -59,16 +59,20 @@

    <!– Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared –>
    <!– in web.xml.                                                                             –>
+   <!–
    <listener>
      <listener-class>org.jboss.web.jsf.integration.config.JBossJSFConfigureListener</listener-class>
    </listener>
+   –>

    <!– Listens to all web app lifecycle events so that @PreDestroy can be called on –>
    <!– JSF managed beans that go out of scope.  You can comment this out if you     –>
    <!– don't use JSF or you don't use annotations on your managed beans.            –>
+   <!–
    <listener>
      <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
    </listener>
+   –>


   <!– ================== Built In Servlet Definitions ==================== –>
Only in jboss/server/default/deploy: share.war
Only in jboss/server/default/lib: mysql-connector-java-5.1.6-bin.jar
diff -u -r -N jboss-org/server/default/conf/alfresco/extension/custom-repository.properties jboss/server/default/conf/alfresco/extension/custom-repository.properties
— jboss-org/server/default/conf/alfresco/extension/custom-repository.properties   1969-12-31 19:00:00.000000000 -0500
+++ jboss/server/default/conf/alfresco/extension/custom-repository.properties   2009-02-03 21:01:23.000000000 -0500
@@ -0,0 +1,58 @@
+###############################
+## Common Alfresco Properties #
+###############################
+
+#
+# Sample custom content and index data location
+#
+#dir.root=/home/ed/Alfresco-Labs/alf_data
+#dir.indexes=/home/ed/Alfresco-Labs/alf_data/lucene-indexes
+
+#
+# Sample database connection properties
+#
+db.name=alfresco
+db.username=alfresco
+db.password=alfresco
+#db.pool.initial=10
+#db.pool.max=100
+
+#
+# External locations
+#
+ooo.exe=/usr/lib/openoffice.org3/program/soffice
+ooo.user=${dir.root}/oouser
+img.root=/usr/local
+swf.exe=/home/ed/local/swftools-2009-01-06-2243/bin/pdf2swf
+
+#
+# Property to control whether schema updates are performed automatically.
+# Updates must be enabled during upgrades as, apart from the static upgrade scripts,
+# there are also auto-generated update scripts that will need to be executed.  After
+# upgrading to a new version, this can be disabled.
+#
+#db.schema.update=true
+
+#
+# Derby connection
+#
+#db.driver=org.apache.derby.jdbc.EmbeddedDriver
+#db.url=jdbc:derby:/home/ed/Alfresco-Labs/alf_data/derby_data/alfresco;create=true
+
+#
+# HSQL connection
+#
+#hsql#db.driver=org.hsqldb.jdbcDriver
+#hsql#db.url=jdbc:hsqldb:file:/home/ed/Alfresco-Labs/alf_data/hsql_data/alfresco;ifexists=true;shutdown=true;
+
+#
+# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server)
+#
+mysql#db.driver=org.gjt.mm.mysql.Driver
+mysql#db.url=jdbc:mysql://localhost:3306/alfresco
+
+#
+# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent)
+#
+#postgresql#db.driver=org.postgresql.Driver
+#postgresql#db.url=jdbc:postgresql://localhost:3306/alfresco

And add the alfresco.war and share.war compiled with svn v12844. Plus mysql-connector-java-5.1.6-bin.jar… and most things work…. Except for:
  • Personal Photo

  • No thumbnails for images/documents/pdf
correction to include OpenOffice support 2/3/2009 11pm

vgarmash
Champ in-the-making
Champ in-the-making
I don't want to blog here, but I hope that someone listening will point me in the correct direction - or report that they are getting the same errors.

I get the fewest errors following this procedure:
  1. Download jboss-portal-2.7.1-bundled.zip

  2. Apply patch

  3. Move files into proper locations (alfresco.war  mysql-connector-java-5.1.6-bin.jar  share.war)

  4. Execute ./jboss/bin/run.sh
This test is done with an empty alfresco database and no alf_data directory.

The errors are:
09:33:09,716 ERROR [STDERR] Feb 3, 2009 9:33:09 AM javax.faces.webapp.FacesServlet init
SEVERE: Initialization of the JSF runtime either failed or did not occurr.  Review the server''s log for details.
java.lang.InstantiationException: org.jboss.portletbridge.context.FacesContextFactoryImpl

09:33:09,717 ERROR [STDERR] g.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:109)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

09:35:36,460 ERROR [[/alfresco]] Servlet /alfresco threw load() exception
org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.SLF4FLogFactory does not implement org.apache.commons.logging.LogFactory
        at org.apache.commons.discovery.tools.ClassUtils.verifyAncestory(ClassUtils.java:180)
        at org.apache.commons.discovery.tools.SPInterface.verifyAncestory(SPInterface.java:201)


Complete logs and patches can be found at : http://www.atl.org/~ed/alfresco-logs.zip

Is there something else to do? Can someone verify the errors on their system?

Patch File

diff -r -u jboss-org/bin/run.sh jboss/bin/run.sh
— jboss-org/bin/run.sh   2009-01-20 12:46:36.000000000 -0500
+++ jboss/bin/run.sh   2009-02-02 23:14:59.000000000 -0500
@@ -5,6 +5,9 @@
##                                                                          ##
### ====================================================================== ###

+JAVA_HOME="/home/ed/local/jdk1.6.0_11"
+JAVA_OPTS="-Xms512m -Xmx1G -XX:MaxPermSize=128m -server"
+
### $Id: run.sh 75849 2008-07-15 18:43:17Z dimitris@jboss.org $ ###

DIRNAME=`dirname $0`
Only in jboss/server/default/deploy: alfresco.war
diff -r -u jboss-org/server/default/deploy/ejb3.deployer/META-INF/persistence.properties jboss/server/default/deploy/ejb3.deployer/META-INF/persistence.properties
— jboss-org/server/default/deploy/ejb3.deployer/META-INF/persistence.properties   2009-01-20 12:46:38.000000000 -0500
+++ jboss/server/default/deploy/ejb3.deployer/META-INF/persistence.properties   2009-02-02 23:16:33.000000000 -0500
@@ -14,4 +14,4 @@
hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
hibernate.bytecode.use_reflection_optimizer=false
# I don't think this is honored, but EJB3Deployer uses it
-hibernate.bytecode.provider=javassist
\ No newline at end of file
+hibernate.bytecode.provider=cglib
diff -r -u jboss-org/server/default/deploy/jboss-web.deployer/conf/web.xml jboss/server/default/deploy/jboss-web.deployer/conf/web.xml
— jboss-org/server/default/deploy/jboss-web.deployer/conf/web.xml   2009-01-20 12:46:40.000000000 -0500
+++ jboss/server/default/deploy/jboss-web.deployer/conf/web.xml   2009-02-02 23:18:27.000000000 -0500
@@ -59,16 +59,20 @@

    <!– Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared –>
    <!– in web.xml.                                                                             –>
+   <!–
    <listener>
      <listener-class>org.jboss.web.jsf.integration.config.JBossJSFConfigureListener</listener-class>
    </listener>
+   –>

    <!– Listens to all web app lifecycle events so that @PreDestroy can be called on –>
    <!– JSF managed beans that go out of scope.  You can comment this out if you     –>
    <!– don't use JSF or you don't use annotations on your managed beans.            –>
+   <!–
    <listener>
      <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
    </listener>
+   –>


   <!– ================== Built In Servlet Definitions ==================== –>
@@ -293,11 +297,13 @@
           be scanned for common tag lib descriptors to include in every war
           deployment.
         –>
+        <!–
         <init-param>
            <description>JSF standard tlds</description>
            <param-name>tagLibJar0</param-name>
            <param-value>jsf-libs/jsf-impl.jar</param-value>
         </init-param>
+        –>
         <init-param>
            <description>JSTL standard tlds</description>
            <param-name>tagLibJar1</param-name>
Only in jboss/server/default/deploy: share.war
Only in jboss/server/default/lib: mysql-connector-java-5.1.6-bin.jar
This error happened because specific features of JBoss Classloading. org.apache.commons.logging.impl.SLF4FLogFactory is located in jcl104-over-slf4j-1.3.0.jar which is at jboss\server\default\deploy\jboss-portal.sar\portal-cms.sar\lib. Because Apache Commons Logging designed to provide implementation-independent logging API application code has only references to interfaces and implementation selected by Apache Commons Logging in runtime. And it usually works fine, but here we have a conflict in Axis which is included into Alfresco.war distribution. The problem has happened because on new org.apache.commons.discovery included into Axis - it use it is own algorithm to verify interface classes for compatibility with implementation.
Here is what happened:
  • Jboss deployed jboss-portal.sar with jcl104-over-slf4j-1.3.0.jar inside which has class org.apache.commons.logging.LogFactory inside this jar and 1 implementation of this class: org.apache.commons.logging.impl.SLF4FLogFactory
  • JBoss cached org.apache.commons.logging.LogFactory in one of Unified Class Loaders
  • Jboss deployed alfresco.war with commons-logging-1.1.jar inside which has another class org.apache.commons.logging.LogFactory.
  • Apache Commons API found implementation for org.apache.commons.logging.LogFactory in Jboss Unified Class Loader
  • org.apache.commons.discovery trying to verify implementation for org.apache.commons.logging.LogFactory but using second copy of it from commons-logging-1.1.jar and because loaded org.apache.commons.logging.impl.SLF4FLogFactory implements first version of class org.apache.commons.logging.LogFactory but not second one you see this exception:
    org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.SLF4FLogFactory does not implement org.apache.commons.logging.LogFactory
As usual I see that Alfresco team need to spend more time to test compatibility of Alfresco.war with different popular servers and portals on the market because we can get so many different combinations of jars and classloaders we can't even imagine.

You can remove jcl104-over-slf4j-1.3.0.jar from jboss\server\default\deploy\jboss-portal.sar\portal-cms.sar\lib if you not using jboss-portal.sar\portal-cms.sar already.