This documentation relates to Confluence 3.1.x
If you are using an earlier version, please view the previous versions of the Confluence documentation and select the relevant version.

Known Issues for JBoss

A Quick Note about Confluence and JBoss

Confluence does not make any use of the JBoss container beyond its embedded Tomcat web application server, as can be easily demonstrated by the fact that our Confluence standalone distribution ships with and runs entirely inside, Tomcat. In addition deploying Confluence inside JBoss can cause additional problems, as described below.

While JBoss is a supported platform, and (subject to the limitations below) you can deploy Confluence into it successfully, we recommend that unless there is some overriding reason to run JBoss - i.e. you are making use of its specific management features, or you're already running several other JBoss servers and want to keep your deployments consistent - you just run Confluence directly under Tomcat instead.

JBoss and Multiple Application Deployments

Atlassian does not currently support configuring Confluence on the same JBoss instance as an existing Confluence or JIRA server.


Due to JBoss's inventive interpretation of the J2EE Classloader specification, multiple applications deployed on the same JBoss instance can interfere with each other. The most common symptom of this problem from the Confluence side is for a user to be unable to edit their profile (although it causes many other seemingly random problems). As such, we do not recommend running Confluence on the same JBoss instance as any other J2EE application.

This issue is reported in CONF-1635.

Some customers have reported success having Confluence share a server with other Confluence or JIRA instances by tweaking their classloader settings or server configurations. A number of recipes for doing so are mentioned below in comments. We currently have not verified these configurations at Atlassian. You're welcome to try them yourself, but if they do not work for you, we can not currently provide support getting them to work.

JBoss Root Logging

On starting up Confluence under JBoss, you may see the following message logged to the console:

ERROR [lifecycle] The root log4j logger is set to DEBUG level. This may cause Confluence to run slowly.
ERROR [lifecycle] If you are running Confluence under JBoss, please read http://confluence.atlassian.com/x/PtAB
ERROR [lifecycle] To disable this error message, start Confluence with the system property -Dconfluence.ignore.debug.logging=true


By default, JBoss ships with the root confluence logger set to DEBUG level. This means that Confluence (and any other log4j-enabled application deployed in the JBoss server) will spend a lot of time generating debugging information that will just end up wasting processor cycles and disk space.

To fix this problem, edit the conf/log4j.xml file in your JBoss server installation. Find the following section:

Before
<root>
      <appender-ref ref="CONSOLE"/>
      <appender-ref ref="FILE"/>
   </root>


Replace it with this:

After
<root>
      <priority value ="warn" />
      <appender-ref ref="CONSOLE"/>
      <appender-ref ref="FILE"/>
   </root>


This will raise the default log level to WARN, which is where Confluence is most comfortable running day-to-day. Logging at INFO level should also be safe, but it will result in a lot more unnecessary information being logged. We recommend you keep Confluence logging at WARN level unless something is going wrong that you need to diagnose (or you're asked to log at a lower level by support).

Additional log4j.xml Configuration

The Confluence log4j.properties file includes some additional logging configuration, which is overridden by JBoss's log4j.xml. To set logging to the same level as the standard Confluence distribution, you should include the following in log4j.xml immediately above the root declaration you edited above.

Putting this anywhere else in the file will probably break your JBoss logging configuration.


Additional Logging
<logger name="com.atlassian.confluence.lifecycle" additivity="false">
      <level value="INFO"/>
      <appender-ref ref="FILE"/>
      <appender-ref ref="CONSOLE"/>
   </logger>
   <logger name="com.atlassian.confluence.upgrade" additivity="false">
      <level value="INFO"/>
      <appender-ref ref="FILE"/>
      <appender-ref ref="CONSOLE"/>
   </logger>


International Characters in Attachment File Names

JBoss uses Apache Tomcat as its servlet engine. To support international characters in URLs it is not sufficient to only configure JBoss to use an encoding such as UTF-8; you must also configure Tomcat to process URLs using your selected encoding.

Inside JBoss you'll find the tomcat server.xml here:

<jboss home>/server/default/deploy/jbossweb-tomcat55.sar/server.xml

Here is an example configuration for the HTTP connector listening on port 8080:

<!-- A HTTP/1.1 Connector on port 8080 -->
      <Connector port="8080" address="${jboss.bind.address}"
         maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
         emptySessionPath="true"
         enableLookups="false" redirectPort="8443" acceptCount="100"
	 connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" />

Note the URIEncoding attribute should be set to your desired character encoding.

-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE startup directive

If you are experiencing a problem with missing images when generating a PDF page export and following error is found in the logs:

[30-10-2007 05:10:41.944] [249524602] [STDOUT] [INFO ] [ajp-0.0.0.0-61781-15] 2007-10-30 05:10:41,939 ERROR [ajp-0.0.0.0-61781-15] [confluence.importexport.impl.AbstractExporterImpl] exportResource The image /Wiki/download/attachments/39308/Overview1-1.gif cannot be exported
 -- url: /Wiki/pages/doexportpage.action | userName: mimzg | action: doexportpage | page: 39308
javax.servlet.ServletException: Original SevletResponse or wrapped original ServletResponse not passed to RequestDispatcher in violation of SRV.8.2 and SRV.14.2.5.1

This is due to more strict Servlet 2.5 specifications on JBoss.
This can be experienced on JBossAS-4.2.0.GA and can be fixed by adding the following startup directive to the server and restarting it:

-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false

Problem with loading "agenda" on JBoss (order of dependencies)

Thanks to Kevin Merigot from KapIT

JBoss 4.2 and datasource configured for MySQL

  • descriptors configured in mysql-ds.xml and references in standardjboss-jdbc.xml
  • Confluence is configured to use this datasource confluenceDS.

Problem description:

1. JBoss Server is running
2. Starting Confluence App
3. Error NameNotFoundException : confluenceDS not bound - fail to load confluence
4. Datasource is being loaded DefaultDS and confluenceDS

Checking the JBoss console will confirm that indeed the datasource is loaded. What's going on ?

Solution

  1. Reload Confluence manually without restarting JBoss server.
  2. Confluence is able to reach the datasource.

Explanation

The order of dependencies have to be configured to load the datasource prior to starting services or web application such as Confluence.
i.e. one can not load web applications at all if the datasource is unavailable!

This can be configured in /jboss-web.deployer/META-INF/jboss-service.xml

Specifically :

<depends>jboss.jca:service=DataSourceBinding,name=confluenceDS</depends>

The above line configures JBoss to load the specific datasource before loading the web app.

References

Labels

appserver appserver Delete
known-issues-appserver known-issues-appserver Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 14, 2005

    Anonymous says:

    The warning about potential issues is accepted. However, there are no answers on...

    The warning about potential issues is accepted. However, there are no answers on how to deploy confluence on an existing jboss application server, despite the page being titled 'Running Confluence on JBoss.' Perhaps, this can be rectified by the responsible parties?

    1. Sep 14, 2005

      Anonymous says:

      The process for installing Confluence into an existing application server is cov...

      The process for installing Confluence into an existing application server is covered here: [Installing the WAR version]. The instructions assume you are already familiar with installing a WAR application into your existing J2EE application server.

      If you do not know how to install a WAR into JBoss, we suggest you stick with the standalone Confluence distribution, which is bundled with its own application server. Java application servers can be tricky beasts, and unless you already know how to run them, it's best to stick with the simplest (and most effectively supported) option.

  2. Apr 28, 2006

    David Smiley says:

    FYI, I have successfully installed Confluence 2.1.3 and Jira 3.5.3 into the same...

    FYI, I have successfully installed Confluence 2.1.3 and Jira 3.5.3 into the same JBoss 3.2.7 instance. The notable things I had to do were:

    • modify the jboss-service.xml for the embedded Tomcat to not use JBoss's UCL and to not use Java 2 style classloading
      • this is good practice for all JBoss setups, IMO
    • removed commons-logging & log4j jars from Confluence & Jira's webapps
      • I don't know why there remained a conflict with these libs in place despite the classloading adjustments
    • renamed the "debug" folder in the Jira war to "xdebug" because there was some problem on startup as it searched for some file
      • ideally Atlassian would diagnose and fix whatever is going wrong. At least the "debug" folder isn't necessary for Jira use; I probably could have deleted it.

    Note: although JBoss can handle being in a directory whose path contains spaces, either Confluence or Jira couldn't handle that (I forget which) so I was forced to move JBoss.

  3. Oct 13, 2006

    Lindsay Smith says:

    FWIW We run both Confluence as a war Version: 2.2.9 Build:#527, and Jira as a wa...

    FWIW We run both Confluence as a war Version: 2.2.9 Build:#527, and Jira as a war , Version: 3.3.3-#99, on one Jboss 4.03 instance.

    We already run with the Jboss isolated classloader. So the only things I had to do were

    • remove log4j.jar, commons-logging.jar from lib
    • remove the log4j.properties in classes
    • add a jboss-web.xml into classes (for the virtual host details)

    And the war hot-deployed. Too easy.

    The bit about the default config of Jboss running in default as debug level in log4j is a little bit alarmist. If you were running Jboss in production you would very likely have sorted this out. Likewise the comment about the Jboss classloader, you probabley understand this issue if you run Jboss already. Anyway, installing Confluence took a few minutes. Cheers.

    1. Oct 15, 2006

      Ivan Benko says:

      Thanks for the informative comment Lindsay.

      Thanks for the informative comment Lindsay.

    2. Oct 16, 2006

      Charles Miller says:

      Thanks for the information, Lindsay.  This document is a year and a half old, a...

      Thanks for the information, Lindsay. 

      This document is a year and a half old, and represents the state of our knowledge after spending almost six months trying ourselves, and collaborating with customers, to get Confluence and JIRA running together. At the time, the most we could get was anecdotal evidence from one or two customers that it was possible, based on configuration recipes that we were entirely unable to reproduce in-house.

      As such, the page may be a little out of date, and might reflect a little more frustration than it should.

       The bit about the default config of Jboss running in default as debug level in log4j is a little bit alarmist. If you were running Jboss in production you would very likely have sorted this out.

      If only this were true. If we hadn't had this problem show up so often in support cases, we wouldn't have had to document it so clearly.

    3. Jan 08, 2007

      Gerald MacKenzie says:

      Thanks, Lindsay, this helped me a lot.  I got this to work under JBoss 4.0....

      Thanks, Lindsay, this helped me a lot.  I got this to work under JBoss 4.0.5 GA.

      I do have a couple of comments:

      The jboss-web.xml is not placed in WEB-INF/classes. I put it in WEB-INF, which is where the container-independent web.xml lives, as per standard. 

       Here's what my jboss-web.xml looks like:

       <?xml version='1.0' encoding='UTF-8' ?>

      <!DOCTYPE jboss-web PUBLIC
          "-//JBoss//DTD Web Application 2.4//EN"
          "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
              
      <jboss-web>

          <class-loading java2ClassLoadingCompliance="false">
               <loader-repository>
                   com.example:loader=unique-archive-name
                   <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
               </loader-repository>
          </class-loading>

          <context-root>/confluence</context-root>

      </jboss-web>

  4. Jan 08, 2007

    Gerald MacKenzie says:

    I just wanted to report back confirming that I got Confluence deployed as a war ...

    I just wanted to report back confirming that I got Confluence deployed as a war file inside the JBoss default server deploy directory.  I had some problems that were easy to fix:

    • The default memory config for JBoss is too low, and I experienced out of memory errors after multiple undeploy-deploy cycles.  I bumped it up to 786 MB (min and max) and restarted. This worked.
    • I'm using MySQL and got bitten when I didn't create the database using UTF-8.  Re-created it.
    • Occasionally forgot to run jboss as my "jboss" user, and had permission problems with the Confluence data directory, so watch out for that.
    • Had weird "missing macros" errors when creating an initial empty space.  It's better to start with the demo space and then create other spaces.
  5. Jan 13, 2007

    Gerald MacKenzie says:

    One more insight.  To get both Jira and Confluence to deploy together, usin...

    One more insight.  To get both Jira and Confluence to deploy together, using separate class loaders, I had to increase the size of the permgen space, to allow space for the duplicated classes that exist in both. 

    That's the -XX:MaxPermSize parameter, which is configured in the run.conf file for jboss, in the bin directory. I made it 256 MB (!). 

    It would be nicer to remove duplicated jars across the two apps.

  6. Jun 07, 2007

    George Daswani says:

    On JBOSS 4.0.5, even with the $CONFLUENCE_WAR/WEB-INF/jboss-web.xml forced to us...

    On JBOSS 4.0.5, even with the $CONFLUENCE_WAR/WEB-INF/jboss-web.xml forced to use the child first classloading scheme, you'll still run into an issue with log4j initializing with the $JBOSS_HOME/server/$INSTANCE/conf/log4j.xml. Lots of errors in the jboss server log usually ensues.

    JBOSS 4.2.0 fixes this problem by making the Jboss Logging service use "jboss-log4j.xml" instead.

    A good way to get confluence, and log4j working properly on JBOSS 4.0.5 is to create a log4j.xml and stick it in the $CONFLUENCE.war/WEB-INF/classes folder along with the child first, unique class loading scheme. This way, the web-app classloader will read it from the WEB-INF/classes first, and not fall back to the log4j.xml used by the JBoss logger service. If done this way, you won't have to modify $JBOSS_HOME/server/$INSTANCE/conf/log4j.xml.

    The log4j.xml in the WEB-INF/classes can just be a bare bones configuration, something like the following

    log4j.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration>
    
           <appender name="ROLLING"
                    class="org.apache.log4j.RollingFileAppender">
                    <param name="File" value="/logs/confluence/confluence.log" />
                    <param name="MaxFileSize" value="1024KB" />
                    <param name="MaxBackupIndex" value="5" />
                    <layout class="org.apache.log4j.PatternLayout">
                            <param name="ConversionPattern"
                                    value="[%d{ISO8601}] %-5p %c %m %n" />
                    </layout>
                    <filter class="org.apache.log4j.varia.LevelRangeFilter">
                            <param name="LevelMin" value="DEBUG" />
                            <param name="LevelMax" value="FATAL" />
                    </filter>
            </appender>
    
            <root>
                    <level value="INFO" />
                    <appender-ref ref="ROLLING" />
            </root>
    
    </log4j:configuration>
    
  7. Jun 07, 2007

    George Daswani says:

    In regards to JBOSS-4.0.5 and using the JNDI based mail session config ($JBOSS_H...

    In regards to JBOSS-4.0.5 and using the JNDI based mail session config ($JBOSS_HOME/server/$INSTANCE/deploy/mail-service.xml).

    ie. java:comp/env/mail/Mail

    <resource-ref>
    <res-ref-name>mail/Mail</res-ref-name>
    <res-type>javax.mail.Session</res-type>
    <jndi-name>java:/Mail</jndi-name>
    </resource-ref>

    make sure you also modify the WEB-INF/classes/web.xml and add the following

    <resource-ref>
    <res-ref-name>mail/Mail</res-ref-name>
    <res-type>javax.mail.Session</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    then remove the WEB-INF/lib/javamail-1.3.2.jar (else you'll run into an issue with the classloader throwing a class cast exception because JBOSS 4.0.5 comes with JavaMail 1.4, and I believe thats the version of the mail session serialized into JNDI during startup).

  8. Jul 13, 2007

    Stefan Baader says:

    JBoss with tomcat inside When using attachments with umlauts in the file name l...

    JBoss with tomcat inside

    When using attachments with umlauts in the file name like döner.jpg we had problems to edit or remove those attachments.

    Due to your hints concerning url encoding and an information from your own server we finally found the solution.

    As we use JBoss application server with tomcat embedded we tried the following:

    http://confluence.atlassian.com/display/DOC/Configuring+Tomcat%27s+URI+encoding

    Configuring Tomcat's URI encoding

    By default, Tomcat uses ISO-8859-1 character encoding when decoding URLs received from a browser. This can cause problems when Confluence's encoding is UTF-8, and you are using international characters in attachment or page names.

    In the conf/server.xml insert

    "8080" URIEncoding="UTF-8"/>
    

    This means it is not enough to tell JBoss to use UTF-8. You have to tell it tomcat inside also.

    Inside JBoss you'll find the tomcat server.xml here: 

    <jboss home>/server/default/deploy/jbossweb-tomcat55.sar/server.xml 

    Example for the configuration for port 8080: 

          <!-- A HTTP/1.1 Connector on port 8080 -->
          <Connector port="8080" address="${jboss.bind.address}"
             maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
             emptySessionPath="true"
             enableLookups="false" redirectPort="8443" acceptCount="100"
    	 connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" />


    1. Oct 17, 2007

      Sarah Maddox [Atlassian Technical Writer] says:

      Hi Stefan Thank you for this information We have included it in the page, unde...

      Hi Stefan

      Thank you for this information We have included it in the page, under the heading 'International Characters in Attachment File Names'.

      Cheers – Sarah

  9. Oct 23, 2007

    Imtiaz B Syed says:

    Hi There is porblem in jboss (Linux OS machines) along with confluence 2.6.0. T...

    Hi

    There is porblem in jboss (Linux OS machines) along with confluence 2.6.0. The sql macro is not working for the query

    {sql:datasource=confluenceDS}
    SELECT SPACENAME, 'syed' as NAME FROM SPACES;
    {sql}
    

    So, Any known issues with this combination.

    it throws the exception as follows:

    sql: Unexpected program error: java.sql.SQLException: Column '' not found.
    SELECT SPACENAME, 'syed' as NAME FROM SPACES;

    Please let me know if u guys have any updates on this.

    1. Oct 29, 2007

      Mei Yan Chan says:

      Hi Imtiaz, It would be appreciated if you can raise a support request at the fo...

      Hi Imtiaz,

      It would be appreciated if you can raise a support request at the following link:

      Regards,
      Mei

  10. Nov 27, 2007

    Anonymous says:

    General instructions for Installing Confluence on JBOSS with Targ...

    General instructions for Installing Confluence on JBOSS with

    Target: Ubuntu Server 7.01 / JBOSS 4.2.2 / JDK 1.5

    This assumes you have root access to the destination
    In this situation Jira is already running on the JBOSS Application Server


    Retrieve Confluence and updated Apache classes:

        wget http://www.atlassian.com/software/confluence/downloads/binary/confluence-2.6.2.tar.gz
        wget http://mirror.olnevhost.net/pub/apache/logging/log4j/1.2.15/apache-log4j-1.2.15.tar.gz
        wget http://apache.ziply.com/commons/logging/binaries/commons-logging-1.1.tar.gz

    Extract each gzip file:

        tar -zxfv confluence-2.6.2.tar.gz
        tar -zxvf commons-logging-1.1.tar.gz
        tar -zxvf apache-log4j-1.2.15.tar.gz

    Build confluence:

        ./confluence-2.6.2/build.sh

    Copy newer Apache classes to Confluence class library

        cp ./apache-log4j-1.2.15/log4j-1.2.15.jar ./confluence-2.6.2/tmp/build/war/WEB-INF/lib
        cp ./commons-logging-1.1/commons-logging-1.1.jar ./confluence-2.6.2/tmp/build/war/WEB-INF/lib

    Create a location for Confluence configuration, backup, and attachment files:

        mkdir /var/local/confluence
        chown jboss.jboss /var/local/confluence #(this assumes JBOSS is running as the jboss user)

    Specify the configuration directory in confluence properties file:

        vim ./confluence-2.6.2/tmp/build/war/WEB-INF/classes/confluence-init.properties
        add the following line: confluence.home=/var/local/confluence/

    Deploy Confluence to JBOSS Application Server

        cp -R ./confluence-2.6.2/tmp/build/war [JBOSS_HOME]/server/default/deploy/confluence.war

    Restart JBOSS

        /etc/init.d/jboss stop
        /etc/init.d/jboss start

    References:

    http://forums.atlassian.com/thread.jspa?threadID=21090&tstart=0 http://confluence.atlassian.com/display/DOC/Installing+the+Confluence+EAR-WAR+edition http://commons.apache.org/downloads/download_logging.cgi http://logging.apache.org/log4j/

    Errors encountered which lead to the above solution:

    Exception sending context initialized event to listener instance of class com.atlassian.config.bootstrap.BootstrappedContextLoaderListener

    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log


    submitted by:
    reece.theobald at bodybuilding.com

Add Comment