JBoss Portal 2.6.5

Reference Guide

Thomas Heute

Julien Viet

Roy Russo

Release 2.6.5

May 2008


Table of Contents

JBoss Portal - Overview
Feature List
Target Audience
Acknowledgements
1. System Requirements
1.1. Minimum System Requirements
1.2. Supported Operating Systems
1.3. JBoss Application Server
1.4. Databases
1.5. Source building
2. Installation
2.1. The JBoss Portal and JBoss AS Bundle
2.2. Installing the Binary Download
2.2.1. Setting up your Environment
2.2.1.1. Getting the Binary
2.2.1.2. JBoss EAP and JBoss AS Setup
2.2.1.3. Database Setup
2.2.1.4. Datasource Descriptors
2.2.2. Deploying JBoss Portal
2.3. Installing from the Sources
2.3.1. Getting the Sources
2.3.2. JBoss EAP and JBoss AS Setup
2.3.2.1. JBoss Application Server Setup
2.3.2.2. Operating System Environment Settings
2.3.3. Building and Deploying from the Sources
2.3.4. Database Setup
2.3.5. Datasource Configuration
2.4. Deploying JBoss Portal
3. Customizing your Installation
3.1. Changing the Port
3.2. Changing the Context Path
3.3. Forcing the Database Dialect
3.3.1. Database Dialect Settings for JBoss Portal
3.3.2. DB Dialect Settings for the CMS Component
3.4. Setting up the Email Service
3.5. Configuring proxy settings
3.6. Disabling Dynamic Proxy Un-wrapping
4. Upgrading JBoss Portal 2.4 to 2.6
4.1. Manual Upgrade
4.1.1. Themes
4.1.2. Updating the Database
4.1.3. Portlet Names
4.1.4. CMS
5. Portlet Primer
5.1. JSR-168 Overview
5.1.1. Portal Pages
5.1.2. Rendering Modes
5.1.3. Window States
5.1.4. Section Status
5.2. Tutorials
5.2.1. Deploying your first Portlet
5.2.1.1. Introduction
5.2.1.2. Package Structure
5.2.1.3. Portlet Classes
5.2.1.4. Application Descriptors
5.2.1.5. Building your Portlet
5.2.1.6. Deploying your Portlet
5.2.2. An example JSP Portlet
5.2.2.1. Introduction
5.2.2.2. Package Structure
5.2.2.3. Portlet Classes
5.2.2.4. JSP Files and the Portlet Tag Library
5.2.2.5. Building your JSP Portlet
5.2.2.6. Deploying your JSP Portlet
5.2.3. An example Sun JSF Reference Implementation (RI) Portlet
5.2.3.1. Introduction
5.2.3.2. Package Structure
5.2.3.3. Application Descriptors
5.2.3.4. Building your JSF Portlet
5.2.3.5. Deploying your JSF Portlet
5.2.4. An example Apache MyFaces JSF Portlet
5.2.4.1. Introduction
5.2.4.2. Package Structure
5.2.4.3. Application Descriptors
5.2.4.4. Building your Apache MyFaces JSF Portlet
5.2.4.5. Deploying your Apache MyFaces JSF Portlet
6. XML Descriptors
6.1. Changes from previous releases
6.1.1. The JBoss Portlet DTD
6.1.2. The JBoss Portlet Instance DTD
6.1.3. The JBoss Portal Object DTD
6.1.4. The JBoss Portal App DTD
6.2. Portlet Descriptors
6.2.1. *-object.xml Descriptors
6.2.2. The portlet-instances.xml Descriptor
6.2.3. The jboss-portlet.xml Descriptor
6.2.3.1. Injecting Header Content
6.2.3.2. Injecting Services in the Portlet Context
6.2.3.3. Defining Extra Portlet Information
6.2.3.4. Portlet Session Replication in a Clustered Environment
6.2.4. The portlet.xml Descriptor
6.3. JBoss Portal Descriptors
6.3.1. Datasource Descriptors (portal-*-ds.xml)
6.3.1.1. Datasource Descriptors included in Binary releases
6.3.1.2. Building Datasource Descriptors from Source
6.3.2. Portlet Debugging (jboss-portal.sar/conf/config.xml)
6.3.3. Log in to Dashboard
6.4. Descriptor Examples
6.4.1. Defining a new Portal Page
6.4.2. Defining a new Portal Instance
7. Portal urls
7.1. Introduction
7.2. Accessing a portal
7.3. Accessing a page
7.4. Accessing CMS Content
8. Error handling configuration
8.1. Error types
8.2. Control policies
8.2.1. Policy delegation and cascading
8.2.2. Default policy
8.2.3. Portal policy
8.2.4. Page policy
8.3. Configuration using the XML descriptors
8.3.1. Portal policy properties
8.3.2. Page policy properties
8.4. Handling errors with JSP
8.5. Configuration using the Portal Management Application
9. Content Integration
9.1. Window content
9.2. Content customization
9.3. Content Driven Portlet
9.3.1. Displaying content
9.3.2. Configuring content
9.3.3. Step by step example of a content driven portlet
9.3.3.1. The Portlet skeleton
9.3.3.2. Overriding the dispatch method
9.3.3.3. Utilities methods
9.3.3.4. The editor
9.3.3.5. Viewing content at runtime
9.3.3.6. Hooking the portlet into the portal
9.4. Configuring window content in deployment descriptor
10. Widget Integration
10.1. Introduction
10.2. Widget portlet configuration
11. Portlet Modes
11.1. Admin Portlet Mode
11.1.1. Portlet configuration
11.1.2. Declarative instance security configuration
11.1.3. Instance security configuration with the administration portlet
12. Portal API
12.1. Introduction
12.2. Portal URL
12.3. Portal session
12.4. Portal runtime context
12.5. Portal nodes
12.6. Portal navigational state
12.7. Portal events
12.7.1. Portal node events
12.7.1.1. Portal node event propagation model
12.7.1.2. Portal node event listener
12.7.1.3. Portal node event context
12.7.2. Portal session events
12.7.3. Portal user events
12.8. Examples
12.8.1. UserAuthenticationEvent example
12.8.2. Achieving Inter Portlet Communication with the events mechanism
12.8.3. Link to other pages
13. Clustering Configuration
13.1. Introduction
13.2. Considerations
13.3. JBoss Portal Clustered Services
13.3.1. Portal Session Replication
13.3.2. Hibernate clustering
13.3.3. Identity clustering
13.3.4. CMS clustering
13.4. Setup
13.5. Portlet Session Replication
13.5.1. JBoss Portal configuration
13.5.2. Portlet configuration
13.5.3. Limitations
14. Web Services for Remote Portlets (WSRP)
14.1. Introduction
14.2. Level of support in JBoss Portal
14.3. Deploying JBoss Portal's WSRP services
14.3.1. Considerations to use WSRP when running Portal on a non-default port or hostname
14.3.2. Considerations to use WSRP with SSL
14.4. Making a portlet remotable
14.5. Consuming JBoss Portal's WSRP portlets from a remote Consumer
14.6. Consuming remote WSRP portlets in JBoss Portal
14.6.1. Overview
14.6.2. Configuring a remote producer walk-through
14.6.2.1. Using the configuration portlet
14.6.2.2. Using a WSRP Producer XML descriptor
14.6.2.3. Configuring access to a remote portlet
14.6.3. WSRP Producer descriptors
14.6.3.1. Required configuration information
14.6.3.2. Optional configuration
14.6.4. Examples
14.7. Consumers maintenance
14.7.1. Modifying a currently held registration
14.7.1.1. Registration modification for service upgrade
14.7.1.2. Registration modification on producer error
14.7.2. Consumer operations
14.7.3. Erasing local registration data
14.8. Configuring JBoss Portal's WSRP Producer
14.8.1. Overview
14.8.2. Default configuration
14.8.3. Registration configuration
14.8.3.1. Customization of Registration handling behavior
15. Security
15.1. Securing Portal Objects
15.2. Securing the Content Management System
15.2.1. CMS Security Configuration
15.2.1.1. CMS Super User
15.2.1.2. CMS Security Console
15.3. Authentication with JBoss Portal
15.3.1. Authentication configuration
15.3.2. The portal servlet
15.4. Authorization with JBoss Portal
15.4.1. The portal permission
15.4.2. The authorization provider
15.4.3. Making a programmatic security check
15.4.4. Configuring an authorization domain
16. JBoss Portal Identity Management
16.1. Identity management API
16.1.1. How to obtain identity modules services ?
16.1.2. API changes since 2.4
16.2. Identity configuration
16.2.1. Main configuration file architecture (identity-config.xml)
16.2.1.1. Datasources
16.2.1.2. Modules
16.2.1.3. Options
16.3. User profile configuration
16.4. Identity modules implementations
16.4.1. Database modules
16.4.2. Delegating UserProfile module
16.4.3. Database UserProfile module implementation
17. JBoss Portal Identity Portlets
17.1. Introduction
17.1.1. Features
17.2. Configuration
17.2.1. Captcha support
17.2.2. Lost password
17.2.3. Reset password
17.2.4. jBPM based user registration
17.2.5. The configuration file
17.2.6. Customize e-mail templates
17.3. User interface customization
17.3.1. Example 1: required fields
17.3.2. Example 2: dynamic values (dropdown menu with predefined values)
17.3.3. Example 3: adding new properties
17.3.4. Illustration
17.3.5. Customizing the View Profile page
17.4. Customizing the workflow
17.4.1. Duration of process validity
17.5. Disabling the Identity Portlets
17.5.1. Enabling the Identity Portlets
18. Authentication and Authorization
18.1. Authentication in JBoss Portal
18.1.1. Configuration
18.2. JAAS Login Modules
18.2.1. org.jboss.portal.identity.auth.IdentityLoginModule
18.2.2. org.jboss.portal.identity.auth.DBIdentityLoginModule
18.2.3. org.jboss.portal.identity.auth.SynchronizingLdapLoginModule
18.2.4. org.jboss.portal.identity.auth.SynchronizingLdapExtLoginModule
18.2.5. org.jboss.portal.identity.auth.SynchronizingLoginModule
19. LDAP
19.1. How to enable LDAP usage in JBoss Portal
19.2. Configuration of LDAP connection
19.2.1. Connection Pooling
19.2.2. SSL
19.2.3. ExternalContext
19.3. LDAP Identity Modules
19.3.1. Common settings
19.3.2. UserModule
19.3.2.1. LDAPUserModuleImpl
19.3.2.2. LDAPExtUserModuleImpl
19.3.3. RoleModule
19.3.3.1. LDAPRoleModuleImpl
19.3.3.2. LDAPExtRoleModuleImpl
19.3.4. MembershipModule
19.3.4.1. LDAPStaticGroupMembershipModuleImpl
19.3.4.2. LDAPStaticRoleMembershipModuleImpl
19.3.5. UserProfileModule
19.3.5.1. LDAPUserProfileModuleImpl
19.4. LDAP server tree shapes
19.4.1. Keeping users membership in role entries
19.4.1.1. Example LDIF
19.4.1.2. Example identity configuration
19.4.2. Keeping users membership in user entries
19.4.2.1. Example LDIF
19.4.2.2. Example identity configuration
19.5. Synchronizing LDAP configuration
19.6. Supported LDAP servers
20. Single Sign ON
20.1. Overview of SSO in portal
20.2. Using Tomcat Valve
20.2.1. Enabling Tomcat SSO Valve
20.2.2. Example of usage
20.3. CAS - Central Authentication Service
20.3.1. Integration steps
20.4. JOSSO - Java Open Single SignOn
20.4.1. Integration steps
21. CMS Portlet
21.1. Introduction
21.2. Features
21.3. CMS content
21.3.1. Configuring a window to display CMS content
21.4. CMS Configuration
21.4.1. Display CMS content
21.4.2. Service Configuration
21.4.2.1. Tuning Jackrabbit
21.4.2.2. Changing the url under which the content should be accessible
21.4.3. Configuring the Content Store Location
21.4.3.1. 100% Filesystem Storage
21.4.3.2. 100% Database Storage
21.4.3.3. Mixed Storage
21.5. Localization Support
21.6. CMS Service
21.6.1. CMS Interceptors
22. Portal Workflow
22.1. JBPM Workflow Engine Integration
22.2. CMS Publish/Approve Workflow Service
23. Navigation Tabs
23.1. Explicit ordering of tabs
23.2. Translating tab labels
23.2.1. Method one: Multiple display-name
23.2.2. Defining a resource bundle and supported locales
24. Layouts and Themes
24.1. Overview
24.2. Header
24.2.1. Overview
24.2.1.1. Writing his own JSPs
24.3. Layouts
24.3.1. How to define a Layout
24.3.2. How to use a Layout
24.3.2.1. Declarative use
24.3.2.2. Programmatic use
24.3.3. Where to place the Descriptor files
24.3.4. Layout JSP-tags
24.4. RenderSets
24.4.1. What is a RenderSet
24.4.2. How is a RenderSet defined
24.4.3. How to specify what RenderSet to use
24.5. Themes
24.5.1. What is a Theme
24.5.2. How to define a Theme
24.5.3. How to use a Theme
24.5.4. How to write your own Theme
24.6. Other Theme Functionalities and Features
24.6.1. Content Rewriting and Header Content Injection
24.6.2. Declarative CSS Style injection
24.6.3. Disabling Portlet Decoration
24.7. Theme Style Guide (based on the Industrial theme)
24.7.1. Overview
24.7.2. Main Screen Shot
24.7.3. List of CSS Selectors
24.8. Additional Ajax selectors
25. Ajax
25.1. Introduction
25.2. Ajaxified markup
25.2.1. Ajaxified layouts
25.2.2. Ajaxified renderers
25.3. Ajaxified pages
25.3.1. Drag and Drop
25.3.2. Partial refresh
25.3.2.1. Portal objects configuration
25.3.2.2. Portlet configuration
25.3.2.3. Limitations
26. Troubleshooting and FAQ
26.1. Troubleshooting and FAQ
A. *-object.xml DTD
B. portlet-instances.xml DTD
C. jboss-portlet.xml DTD

JBoss Portal - Overview

Many IT organizations look to achieve a competitive advantage for the enterprise by improving business productivity and reducing costs. Today's top enterprises are realizing this goal by deploying enterprise portals within their IT infrastructure. Enterprise portals simplify access to information by providing a single source of interaction with corporate information. Although today's packaged portal frameworks help enterprises launch portals more quickly, only JBoss Portal can deliver the benefits of a zero-cost open source license combined with a flexible and scalable underlying platform.

JBoss Portal provides an open source and standards-based environment for hosting and serving a portal's Web interface, publishing and managing its content, and customizing its experience. It is entirely standards-based and supports the JSR-168 portlet specification, which allows you to easily plug-in standards-compliant portlets to meet your specific portal needs. JBoss Portal is available through the business-friendly LGPL open source license and is supported by Red Hat Middleware, LLC Professional Support and Consulting . JBoss support services are available to assist you in designing, developing, deploying, and ultimately managing your portal environment. JBoss Portal is currently developed by Red Hat Middleware, LLC developers and community contributors.

The JBoss Portal framework and architecture includes the portal container and supports a wide range of features including standard portlets, single sign-on, clustering and internationalization. Portal themes and layouts are configurable. Fine-grained security administration down to portlet permissions rounds out the security model.

JBoss Portal Resources:

The JBoss Portal team encourages you to use this guide to install and configure JBoss Portal. If you encounter any configuration issues or simply want to take part in our community, we would love to hear from you in our forums.

Feature List

The following list details features found in this document's related release. For a technical view of our features, view the Project Roadmap and Task List .

Technology and Architecture

  • JEMS: Leverages the power of JBoss Enterprise Middleware Services : JBoss Application Server, JBoss Cache, JGroups, and Hibernate.
  • DB Agnostic: Will work with any RDBMS supported by Hibernate
  • JAAS Authentication: Custom authentication via JAAS login modules.
  • Cacheing: Utilizes render-view caching for improved performance.
  • Clusterable: Cluster support allows for portal state to be clustered for all portal instances.
  • Hot-Deployment: Leverages JBoss dynamic auto deployment features.
  • SAR Installer: Browser-based installer makes installation and initial configuration a breeze.

Single Sign On

  • Leverages Tomcat and JBoss single sign on (SSO) solutions.
  • Integrates with JOSSO and CAS out of the box. (Experimental support for Open SSO)

LDAP

  • Connect to virtually any LDAP server
  • Integrates with Sun Active Directory and OpenLDAP out of the box. (Experimental support for Active Directory)

Supported Standards

  • Portlet Specification and API 1.0 (JSR-168)
  • Content Repository for Java Technology API (JSR-170)
  • Java Server Faces 1.2 (JSR-252)
  • Java Management Extension (JMX) 1.2
  • Web Services for Remote Portlets (WSRP) 1.0 See WSRP support in Portal for more details.
  • Full J2EE 1.4 compliance when used with JBoss AS

Portal and Portal Container

  • Multiple Portal Instances: Ability to have multiple Portal instances running inside of one Portal container.
  • IPC Inter-Portlet Communication API enables portlets to create links to other objects such as a page, portal or window .
  • Dynamicity The ability for administrators and users to create and destroy objects such as portlets, pages, portals, themes, and layouts at runtime.
  • Internationalization: Ability to use internationalization resource files for every portlet.
  • Pluggable services: Authentication performed by the servlet container and JAAS make it possible to swap the authentication scheme.
  • Page-based Architecture: Allows for the grouping/division of portlets on a per-page basis.
  • Existing Framework support: Portlets utilizing Struts, Spring MVC, Sun JSF-RI, AJAX, or MyFaces are supported.

Themes and Layouts

  • Easily swappable themes/layouts: New themes and layouts containing images can be deployed in WAR archives.
  • Flexible API: Theme and Layout API are designed to separate the business layer from the presentation layer.
  • Per-page layout strategy: Different layouts can be assigned to different pages.

User and Group Functionality

  • User registration/validation: Configurable registration parameters allow for user email validation before activation.
  • Workflow: Ability to define your own jBPM workflow on user registration.
  • User login: Makes use of servlet container authentication.
  • Create/Edit Users: Ability for administrators to create/edit user profiles.
  • Create/Edit Roles: Ability for administrators create/edit roles.
  • Role Assignment: Ability for administrators to assign users to roles.
  • Captcha support: To distinct humans from machines when registering.

Permissions Management

  • Extendable permissions API: Allows custom portlets permissions based on role definition.
  • Administrative interface: Allows for permissions assignments to roles at any time for any deployed portlet, page, or portal instance.

Content Management System

  • JCR-compliant: The CMS is powered by Apache Jackrabbit, an open source implementation of the Java Content Repository API.
  • DB or Filesystem store support: Configurable content store to either a filesystem or RDBMS.
  • External Blob Support: Configurable content store allowing large blobs to reside on filesystem and content node references/properties to reside in RDBMS.
  • Versioning support: All content edited/created is autoversioned with a history of edits that can be viewed at any time.
  • Content Serving Search-engine-friendly URLS: http://yourdomain/portal/content/index.html (Does not apply to portlet actions.)
  • No long portal URLS: Serve binaries with simple urls. (http://domain/files/products.pdf)
  • Multiple HTML Portlet instance support: Allows for extra instances of static content from the CMS to be served under separate windows.
  • Directory Support: create, move, delete, copy, and upload entire directory trees.
  • File Functions: create, move, copy, upload, and delete files.
  • Embedded directory-browser: When copying, moving, deleting, or creating files, administrators can simply navigate the directory tree to find the collection they want to perform the action on.
  • Ease-of-use architecture: All actions to be performed on files and folder are one mouse-click away.
  • Full-featured HTML editor: HTML Editor contains WYSIWYG mode, preview functionality, and HTML source editting mode. HTML commands support tables, fonts, zooming, image and url linking, flash movie support, bulleted and numbered list, and dozens more.
  • Editor style-sheet support: WYSIWYG editor displays current Portal style-sheet, for easy choosing of classes.
  • Internationalization Support: Content can be attributed to a specific locale and then served to the user based on his/her browser settings.
  • Workflow Support: Basic submit for review and approval process.

Target Audience

This guide is aimed towards Portlet developers, Portal administrators, and those wishing to implement and extend the JBoss Portal framework. For end-user documentation, please refer to the JBoss Portal User Manual from the JBoss Portal Documentation Library .

Acknowledgements

We would like to thank the developers that participate in the JBoss Portal project effort.

Specifically,

  • Luca Stancapiano and Luc Boudreau for their localization contributions.
  • Antoine Herzog for his feedback, for writing Wikis and helping in the forums.
  • Mark Fernandes and Paul Tamaro from Novell, for their hard work in supplying the portal project with usable and attractive themes and layouts in the 2.4 version of JBoss Portal.
  • Martin Holzner from Novell, for his work on themes in the 2.4 version of JBoss Portal.
  • Kev "kevs3d" Roast for supplying us with two working portlets that integrate existing frameworks in to the portal: Sun JSF-RI and Spring MVC Portlet.
  • Swarn "sdhaliwal" Dhaliwal for supplying us with the Struts-Bridge, that will allow for existing struts applications to work with the Portal.
  • A few Red Hat employees, Remy Maucherat for Tomcat configuration, Magesh Kumar Bojan and Martin Putz always there to help our customers, Prabhat Jha for making sure that JBoss Portal runs great everywhere. Noel Rocher for his early feedback on JBoss Portal 2.6 and contributions. James Cobb for the Renaissance theme.
  • The JBoss Labs (http://www.JBoss.org) team for building a great infrastructure on top of JBoss Portal 2.6, providing very useful feedback and giving us the initial Drag and Drop implementation.
  • Everyone participating in the forums and Wiki in general.

Contributions of any kind are always welcome, you can contribute by providing ideas, filling bug reports, producing some code, designing a theme, writing some documentation, etc... If you think your name is missing from this page, please let us know.

Chapter 1. System Requirements

Thomas Heute

Roy Russo

The following section details tested, or reported as working by users, hardware and software versions that are compatible with JBoss Portal. Before reporting a problem, make sure you are using compatible hardware and software.

If you successfully installed JBoss Portal on versions not listed here, please let us know so it can be added to this section.

1.1. Minimum System Requirements

  • JDK 5 (JDK 6 is not part of the test platform)
  • 512 MB RAM
  • 100 MB hard disk space
  • 400 MHz CPU

1.2. Supported Operating Systems

JBoss Portal is 100% pure Java, and therefore it is interoperable with most Operating Systems capable of running a Java Virtual Machine (JVM). These Operating Systems include but are not limited to: Linux, Microsoft Windows, UNIX, and Mac OS X.

1.3. JBoss Application Server

JBoss Portal 2.6.5 is tested with JBoss Application Server (AS) 4.2.1, JBoss AS 4.2.2, JBoss Enterprise Application Platform (EAP) 4.2 and JBoss EAP 4.3. It is highly recommended that customers who have access to the JBoss Customer Support Portal (CSP) use JBoss EAP 4.3 (It is mandatory to get access to professional support). Customers who do not have access to the JBoss CSP should use JBoss AS.

Warning

JBoss AS versions 4.0.x are not supported.

1.4. Databases

JBoss Portal is database-agnostic. The following list outlines known-to-be-working database vendor and version combinations:

Note

JBoss Portal employs Hibernate as an interface to a relational database management system (RDBMS). Most relational database management systems supported by Hibernate will work with JBoss Portal.

1.5. Source building

The source building mechanism works on Linux, Microsoft Windows, Mac OS X, and any UNIX-like Operating System.

Chapter 2. Installation

Depending on your needs, there are several different methods to install JBoss Portal. Pre-configured clustered versions (JBoss Portal Binary (Clustered)) are available from the JBoss Portal Downloads page. Clustered versions of JBoss Portal must be deployed in the JBOSS_INSTALLATION_DIRECTORY/server/all/deploy/ directory. All JBoss AS instances must reference the same datasource. Refer to Section 2.3.2.2, “Operating System Environment Settings” for details on how to configure JBoss Portal for clustering.

An environment variable, JBOSS_HOME, is configured in Section 2.3.2.2, “Operating System Environment Settings”. References to $JBOSS_HOME assume this to be your JBOSS_INSTALLATION_DIRECTORY.

2.1. The JBoss Portal and JBoss AS Bundle

This is the easiest and fastest way to get JBoss Portal installed and running. The JBoss Portal and JBoss AS bundle contains JBoss AS, JBoss Portal, and the embedded Hypersonic SQL database. To install the JBoss Portal and JBoss AS bundle:

  1. Get the bundle: the bundle is available from the JBoss Portal Downloads page. Bundles use the JBoss Portal + JBoss AS naming convention.

  2. Extract the bundle: extract the ZIP archive. It does not matter which directory is used. On Microsoft Windows, the recommended directory is C:\jboss-version-number.

  3. Start the server: change into the JBOSS_PORTAL_INSTALLATION_DIRECTORY/bin/ directory. On Microsoft Windows, execute run.bat. On Linux, run the sh run.sh command. To specify a configuration to use, for example, the default configuration, append the -c default option to the run.bat or sh run.sh commands.

  4. Log in to JBoss Portal: using a Web browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two default accounts: username user, password user, or username admin, password admin.

SQL Errors

Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:

WARN  [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
ERROR [JDBCExceptionReporter] Table not found in statement ...
WARN  [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
WARN  [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
				

2.2. Installing the Binary Download

The binary package typically consists of the jboss-portal.sar/ directory, documentation such as the JBoss Portal User Guide and the JBoss Portal Reference Guide, and a set of pre-configured Datasource descriptors that allow JBoss Portal to communicate with an external database. This installation method is recommended for users who already have JBoss EAP or JBoss AS installed, or those who need to install JBoss Portal in a clustered environment.

2.2.1. Setting up your Environment

2.2.1.1. Getting the Binary

The binary download is available from the JBoss Portal Downloads page. Look for the JBoss Portal Binary package. Once the binary ZIP file has been downloaded and extracted, the folder hierarchy will look similar to the following:

Files contained in this download are used in later sections. Download and extract the JBoss Portal binary ZIP file before proceeding.

2.2.1.2. JBoss EAP and JBoss AS Setup

Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS installed. Customers who have access to the JBoss Customer Support Portal (CSP) are advised to download and install JBoss EAP 4.3. Customers who do not have access to the JBoss CSP are advised to use JBoss AS. For JBoss AS installation instructions, please refer to the JBoss AS Installation Guide.

Use the JBoss EAP and JBoss AS ZIP file

Only use the JBoss EAP and JBoss AS ZIP file versions. DO NOT ATTEMPT to deploy JBoss Portal on the installer version of JBoss EAP or JBoss AS.

2.2.1.3. Database Setup

A database is required for JBoss Portal to run. JBoss EAP and JBoss AS include an embedded Hypersonic SQL database that JBoss Portal can use; however, this is only recommended for developer use. The following databases are recommended for production use, and have had test suites run against them: MySQL 4, MySQL 5, Microsoft SQL Server, PostgreSQL 8, Oracle 9, and Oracle 10. JBoss Portal can use any database that is supported by Hibernate.

To configure a database to use with JBoss Portal:

  1. Create a new database: this guide assumes that the new database is called jbossportal.

  2. Grant access rights for a user to the jbossportal database: JBoss Portal needs to create tables and modify table data. Grant access rights to a desired user to the jbossportal database. Configure the same username and password in the Datasource descriptor.

  3. Deploy a RDBMS JDBC connector: a RDBMS JDBC connector is required for JBoss Portal to communicate with a database. Copy the connector into the $JBOSS_HOME/server/default/lib/ directory. For example, a RDBMS JDBC connector for MySQL can be download from http://www.mysql.com/products/connector/j/. For the correct RDMBS JDBC connector, please refer to the database documentation.

2.2.1.4. Datasource Descriptors

The JBoss Portal binary download that was extracted in Section 2.2.1.1, “Getting the Binary”, contains pre-configured Datasource descriptors for the more popular databases. Datasource descriptors are provided for the MySQL 4, MySQL 5, PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in the setup subdirectory where the JBoss Portal binary was extracted to:

Copy the Datasource descriptor that matches your database into the $JBOSS_HOME/server/configuration/deploy/ directory, where configuration is either all, default, minimal or production. The production configuration only exists on JBoss EAP, and not JBoss AS. For example, if you are using the all configuration, copy the Datasource descriptor into the $JBOSS_HOME/server/all/deploy/ directory.

After the Datasource descriptor has been copied into the deploy directory, make sure the user-name, password, connection-url, and driver-class, are correct for your chosen database. Datasource descriptor files can be deployed to test before being used in production. The following is an example Datasource descriptor for a PostgreSQL database:

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>PortalDS</jndi-name>
    <connection-url>jdbc:postgresql:jbossportal</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>portal</user-name>
    <password>portalpassword</password>
  </local-tx-datasource>
</datasources>

For further details about Datasource descriptors, please refer to the JBoss JDBC Datasource Wiki page.

2.2.2. Deploying JBoss Portal

To start JBoss EAP or JBoss AS and deploy JBoss Portal:

  1. Datasource descriptor: if you have not done so already, change into the setup subdirectory where the JBoss Portal binary was extracted to. Copy the correct Datasource descriptor file (*-ds.xml) you modified in the previous steps into the $JBOSS_HOME/server/configuration/deploy/ directory.

  2. Start the server: change into the $JBOSS_HOME/bin/ directory. On Microsoft Windows, execute run.bat. On Linux, run the sh run.sh command. To specify a configuration to use, for example, the default configuration, append the -c default option to the run.bat or sh run.sh commands.

  3. Log in to JBoss Portal: using a Web browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two default accounts: username user, password user, or username admin, password admin:

SQL Errors

Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:

WARN  [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
ERROR [JDBCExceptionReporter] Table not found in statement ...
WARN  [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
WARN  [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist

2.3. Installing from the Sources

2.3.1. Getting the Sources

The JBoss Portal source files can be obtained from the JBoss Portal Downloads page. The source files download uses a JBoss Portal Source Code naming convention. As well, the sources can be obtained from SVN. The latest sources for the 2.6.x versions are located at http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_6.

Several modules have been extracted from the JBoss Portal SVN repository. These modules have a different lifecycle and a different version scheme. The following is a list of modules used in JBoss Portal 2.6.5, and the locations of their source code:

  • JBoss Portal Common 1.1.1: http://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_1_1

  • JBoss Portal Web 1.1.0: http://anonsvn.jboss.org/repos/portal/modules/web/tags/JBP_WEB_1_1_0

  • JBoss Portal Test 1.0.1: http://anonsvn.jboss.org/repos/portal/modules/test/tags/JBP_TEST_1_0_1

  • JBoss Portal Portlet 1.0.3: http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_1_0_3

  • JBoss Portal Identity 1.0.3: http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_1_0_3

After checking out the source from SVN, or after extracting the JBoss Portal Source Code ZIP file, a directory structure similar to the following will be created:

If the source files were obtained from SVN, change into the trunk/src/ directory to see the directories from the above image. As well, there is an empty thirdparty directory. This directory contains files after building the JBoss Portal source code (refer to Section 2.3.3, “Building and Deploying from the Sources”). For more information about the JBoss Portal SVN repository, and accessing different versions of the JBoss Portal codebase, refer to the JBoss Portal SVN Repo page on the JBoss Wiki.

2.3.2. JBoss EAP and JBoss AS Setup

2.3.2.1. JBoss Application Server Setup

Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS installed. Customers who have access to the JBoss Customer Support Portal (CSP) are advised to download and install JBoss EAP 4.3. Customers who do not have access to the JBoss CSP are advised to use JBoss AS. For JBoss AS installation instructions, please refer to the JBoss AS Installation Guide.

Use the JBoss EAP and JBoss AS ZIP file

Only use the JBoss EAP and JBoss AS ZIP file versions. DO NOT ATTEMPT to deploy JBoss Portal on the installer version of JBoss EAP or JBoss AS. We are currently working on aligning the Application installer with JBoss Portal.

2.3.2.2. Operating System Environment Settings

For build targets to work, you must configure a JBOSS_HOME environment variable. This environment variable must point to the root directory of the JBoss EAP or JBoss AS installation directory, which is the directory where the JBoss EAP or JBoss AS files were extracted to.

When using Microsoft Windows, this is accomplished by going to Start > Settings > Control Panel > System > Advanced > Environment Variables. Under the System Variables section, click New. Set the JBOSS_HOME environment variable to the location of your JBoss EAP or JBoss AS installation directory:

To configure the JBOSS_HOME environment variable on Linux:

  1. Add the following line to the ~/.bashrc file. Note: this must be configured while logged in as the user who runs JBoss EAP or JBoss AS:

    export JBOSS_HOME=/path/to/jboss/installation/
    

  2. Run the following command to enable the JBOSS_HOME environment variable:

    source ~/.bashrc
    

JBoss EAP JBOSS_HOME Environment Variable

If you are running JBoss EAP, configure the JBOSS_HOME environment variable to point to the /path/to/jboss-eap-version/jboss-as/ directory.

2.3.3. Building and Deploying from the Sources

During the first build, third-party libraries are obtained from an online repository, so you must be connected to the Internet, and if you are behind a proxy server, you need to define your proxy server address and proxy server port number. To define a proxy server, add the following line to the $JBOSS_HOME/bin/run.conf file:

JAVA_OPTS=-Dhttp.proxyHost=<proxy-hostname>
-Dhttp.proxyPort=<proxy-port>

Replace proxy-hostname with the proxy server's hostname, and proxy-port with the correct proxy server port number.

To build and deploy JBoss Portal from the sources, change into the JBOSS_PORTAL_SOURCE_DIRECTORY/build/ directory, where JBOSS_PORTAL_SOURCE_DIRECTORY is the directory where the JBoss Portal source code was downloaded to. Then, Microsoft Windows users need to run the build.bat deploy command, and Linux users need to run the sh build.sh deploy command.

At the end of the build process, the jboss-portal.sar file is copied into the $JBOSS_HOME/server/default/deploy/ directory:

Portal Modules

The previous steps install a bare version of JBoss Portal. In previous versions, several additional modules were deployed as well, but this has since been modularized to provide greater flexibility. To deploy additional modules, refer to the Portal's module list for more information. To deploy all modules at once, change into the build directory. If you are running Linux, run the sh build.sh deploy-all command. If you are running Microsoft Windows, run the build.bat deploy-all command.

To build the clustered version on Linux Operating Systems:

  1. Change into the JBOSS_PORTAL_SOURCE_DIRECTORY/build/ directory, and run the following command:

    sh build.sh main
    

  2. Change into the JBOSS_PORTAL_SOURCE_DIRECTORY/core/ directory, and run the following command:

    sh build.sh deploy-ha
    

    After the sh build.sh deploy-ha command completes, the jboss-portal-ha.sar file is copied into the $JBOSS_HOME/server/all/deploy/ directory.

To build the clustered version on Microsoft Windows, repeat the previous steps, replacing sh build.sh with build.bat.

2.3.4. Database Setup

A database is required for JBoss Portal to run. JBoss EAP and JBoss AS include an embedded Hypersonic SQL database that JBoss Portal can use; however, this is only recommended for developer use. The following databases are recommended for production use, and have had test suites run against them: MySQL 4, MySQL 5, Microsoft SQL Server, PostgreSQL 8, Oracle 9, and Oracle 10. JBoss Portal can use any database that is supported by Hibernate.

To configure a database to use with JBoss Portal:

  1. Create a new database: this guide assumes that the new database is called jbossportal.

  2. Grant access rights for a user to the jbossportal database: JBoss Portal needs to create tables and modify table data. Grant access rights to a desired user to the jbossportal database. Configure the same username and password in the Datasource descriptor.

  3. Deploy a RDBMS JDBC connector: a RDBMS JDBC connector is required for JBoss Portal to communicate with a database. Copy the connector into the $JBOSS_HOME/server/default/lib/ directory. For example, a RDBMS JDBC connector for MySQL can be download from http://www.mysql.com/products/connector/j/. For the correct RDMBS JDBC connector, please refer to the database documentation.

2.3.5. Datasource Configuration

The JBoss Portal binary download that was extracted in Section 2.2.1.1, “Getting the Binary”, contains pre-configured Datasource descriptors for the more popular databases. Datasource descriptors are provided for the MySQL 4, MySQL 5, PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in the setup subdirectory where the JBoss Portal binary was extracted to:

Copy the Datasource descriptor that matches your database into the $JBOSS_HOME/server/configuration/deploy/ directory, where configuration is either all, default, minimal, or production. For example, if you are using the production configuration, copy the Datasource descriptor into the $JBOSS_HOME/server/production/deploy/ directory. The production configuration only exists on JBoss EAP installations, and not JBoss AS.

After the Datasource descriptor has been copied into the deploy directory, make sure the user-name, password, connection-url, and driver-class, are correct for your chosen database. Datasource descriptor files can be deployed to test before being used in production. The following is an example Datasource descriptor for a PostgreSQL database:

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>PortalDS</jndi-name>
    <connection-url>jdbc:postgresql:jbossportal</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>portal</user-name>
    <password>portalpassword</password>
  </local-tx-datasource>
</datasources>
					  

For further details about Datasource descriptors, please refer to the JBoss JDBC Datasource Wiki page.

2.4. Deploying JBoss Portal

To start JBoss EAP or JBoss AS and deploy JBoss Portal:

  1. Datasource descriptor: if you have not done so already, change into the setup subdirectory where the JBoss Portal binary was extracted to. Copy the correct Datasource descriptor file (*-ds.xml) you modified in the previous steps into the $JBOSS_HOME/server/configuration/deploy/ directory.

  2. Start the server: change into the $JBOSS_HOME/bin/ directory. On Microsoft Windows, execute run.bat. On Linux, run the sh run.sh command. To specify a configuration to use, for example, the default configuration, append the -c default option to the run.bat or sh run.sh commands.

  3. Log in to JBoss Portal: using a Web browser, navigate to http://localhost:8080/portal to open the JBoss Portal homepage. Log in using one of the two default accounts: username user, password user, or username admin, password admin:

SQL Errors

Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:

WARN  [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
ERROR [JDBCExceptionReporter] Table not found in statement ...
WARN  [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
WARN  [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist

Chapter 3. Customizing your Installation

Thomas Heute

This chapter describes how to customize the default installation. This includes the JBoss EAP or JBoss AS listening port, email and proxy settings, and database dialect settings. For further configuration details, refer to Section 6.3, “JBoss Portal Descriptors” and Chapter 26, Troubleshooting and FAQ.

3.1. Changing the Port

It is common for web services to run on port 80. By default, JBoss EAP and JBoss AS use port 8080. If you can not use port forwarding, it is recommended to change the port JBoss EAP or JBoss AS listens on. To change the default port, open the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml file, and edit the Connector port value for the jboss.web service; however, this configuration only applies to Tomcat:

<Service name="jboss.web">
<Connector port="8088" address="${jboss.bind.address}"

This example changes the default port to port 8088. The JBoss EAP or JBoss AS server must be restarted before the new port settings take affect.

The default SSL port is 8843. To enable HTTPS support, refer to the JBoss AS Guide. For further information, refer to Tomcat's SSL configuration how-to.

Please refer to Section 14.3.1, “Considerations to use WSRP when running Portal on a non-default port or hostname” to update the WSRP service after having changed the port.

Root User Privileges

Linux systems require root user privileges to run a service on a port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-privileged user will not work. Running JBoss EAP or JBoss AS as the root user could lead to security breaches.

3.2. Changing the Context Path

By default, the main JBoss Portal page is accessible by navigating to http://localhost:8080/portal/index.html. This can be changed to a different path, for example, http://localhost:8080/index.html. The context path can be changed when using the deployed jboss-portal.sar/, or before building from source. To change the context path when using the JBoss Portal binary package:

  1. Open the $JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml file. If this file does not exist, copy and save the following example:

    <?xml version="1.0"?>
    <jboss-web>
       <security-domain>java:jaas/portal</security-domain>
       <context-root>/portal</context-root>
       <replication-config>
          <replication-trigger>SET</replication-trigger>
       </replication-config>
       <resource-ref>
          <res-ref-name>jdbc/PortalDS</res-ref-name>
          <jndi-name>java:PortalDS</jndi-name>
       </resource-ref>
    </jboss-web>

  2. Edit the <context-root> element with the desired context path:

    <context-root>/testing</context-root>
    

    Using this example, the main JBoss Portal page would be reached by navigating to http://localhost:8080/testing.

To change the context path when building from source:

  1. Change into the directory where the JBoss Portal Source Code ZIP file was extracted to, or where the source from SVN was checked out to. Copy the build/etc/local.properties-example file and save it as build/local.properties.

  2. Open the build/local.properties file and edit the portal.web.context-root option with the desired context path:

    # Context root for the portal main servlet
    portal.web.context-root=/testing
    

    Using this example, the main JBoss Portal page would be reached by navigating to http://localhost:8080/testing.

  3. To clean the project, make sure you are connected to the Internet, and change into the build/ directory. Run the ant clean command.

  4. Rebuild and redeploy JBoss Portal. Refer to Section 2.3, “Installing from the Sources” for build instructions.

Changing the context-root

By default, Tomcat holds on to the root context, /. You may need to remove the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/ directory, or add a jboss-web.xml file, which declares another context-root other than /, under the $JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/ directory, for the above changes to take affect. The following is an example jboss-web.xml file, which changes the Tomcat context path to /tomcat-root:

<?xml version="1.0"?>
<jboss-web>
   <context-root>/tomcat-root</context-root>
</jboss-web>

3.3. Forcing the Database Dialect

This sections describes how to override the Database (DB) dialect settings. Under most circumstances, the auto-detect feature works. If the Hibernate dialect is not working correctly, override the default behavior by following the instructions in this section.

3.3.1. Database Dialect Settings for JBoss Portal

All hibernate.cfg.xml files in all JBoss Portal modules you intend to use need to be modified. The hibernate.cfg.xml files are found in the jboss-portal.sar/module/conf/hibernate/directory/ directory, where module is the module name, and directory is a directory that, depending on the module, may or may not exist.

To modify these files to force the DB dialect, un-comment the following line from each hibernate.cfg.xml file in each JBoss Portal module you intend to use, so that it looks like the following:

<!-- Force the dialect instead of using autodetection -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>

Note: this example is for a PostgreSQL database. If you use another database, you need to modify org.hibernate.dialect.PostgreSQLDialect to reflect the correct database. For a list of supported dialects, refer to the dialects list on the Hibernate website.

3.3.2. DB Dialect Settings for the CMS Component

To modify the DB dialect setting for the JBoss Portal CMS component:

  1. Open the jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml file.

  2. Un-comment the following line, so that it looks like the following:

    <!-- Force the dialect instead of using autodetection -->
    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    

Note: this example is for a PostgreSQL database. If you use another database, you need to modify org.hibernate.dialect.PostgreSQLDialect to reflect the correct database. For a list of supported dialects, refer to the dialects list on the Hibernate website.

3.4. Setting up the Email Service

If you have a standard setup and a mail server installed, the email service should work without any extra configuration. Most Linux distributions have a mail server installed by default. The email service, for example, can be used to verify a user's email address when a user subscribes, or for CMS workflow notifications.

The email service is configured using the $JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml file. The following is an example of the section which is used to configure the email service:

<mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends>jboss:service=Mail</depends>
<depends>portal:service=Module,type=IdentityServiceController</depends>
<attribute name="QueueCapacity">-1</attribute>
<attribute name="Gateway">localhost</attribute>
<attribute name="SmtpUser"></attribute>
<attribute name="SmtpPassword"></attribute>
<attribute name="JavaMailDebugEnabled">false</attribute>
<attribute name="SMTPConnectionTimeout">100000</attribute>
<attribute name="SMTPTimeout">10000</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>

A different SMTP server (other than localhost) can be configured, along with a SMTP username and an SMTP password. The following is an example configuration that uses the Gmail SMTP server:

<mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends>jboss:service=Mail</depends>
<depends>portal:service=Module,type=IdentityServiceController</depends>
<attribute name="QueueCapacity">-1</attribute>
<attribute name="Gateway">smtp.gmail.com</attribute>
<attribute name="SmtpUser">username@gmail.com</attribute>
<attribute name="SmtpPassword">myPassword</attribute>
<attribute name="JavaMailDebugEnabled">false</attribute>
<attribute name="SMTPConnectionTimeout">100000</attribute>
<attribute name="SMTPTimeout">10000</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>

Using this example, replace username@gmail.com and myPassword with your correct Gmail username and password.

3.5. Configuring proxy settings

There are a couple of scenarios where you need your proxy to be correctly defined at the JVM level so that you can access documents from Internet. It could be to get the thirdparty libraries if you decided to build JBoss Portal from the sources, to access RSS feeds or weather information in the samples portlet we provide or for your own needs.

To configure the proxy settings, you need to know the proxy host and the port to use. Then, add them when starting Java.

Usually setting up JAVA_OPTS environment variable to -Dhttp.proxyHost=YOUR_PROXY_HOST -Dhttp.proxyPort=YOUR_PROXY_PORT is enough.

3.6. Disabling Dynamic Proxy Un-wrapping

JBoss Portal uses the JBoss Microkernel for the service infrastructure. The JBoss Microkernel provides injection of services into other services, otherwise known as wiring. Due to the Microkernel being JMX based, it is only possible to inject dynamic proxies that talk to the MBeanServer. The overhead at runtime is minimal since the Microkernel implementation is highly optimized; however, when it is used with Java 5, a noticeable bottleneck occurs due to the fact that the implementation of the JMX API classes, javax.management.*, provided by the Java Platform, perform synchronization. This does not occur under JDK 1.4, since those classes are implemented by JBoss MX.

JBoss Portal services use a special kind of Model MBean called JBossServiceModelMBean, which allows the un-wrapping of injected dynamic proxies, and replaces them with plain old java object (POJO) services. This removes the bottleneck when using Java 5, and also provides a performance boost on JDK 1.4. By default this feature is enabled, but it is possible to disable. To do this on Linux systems, change into the $JBOSS_HOME/bin/ directory and run the following command:

sh run.sh -Dportal.kernel.no_proxies=false

On Microsoft Windows systems, run the following command:

run.bat -Dportal.kernel.no_proxies=false

Chapter 4. Upgrading JBoss Portal 2.4 to 2.6

Warning

Before performing any instructions or operations in this chapter, back up your database and the entire JBoss EAP or JBoss AS directory!

4.1. Manual Upgrade

The database schema has not changed since JBoss Portal 2.4; however, there are several differences when using a database created by JBoss Portal 2.4, that prevent simply deploying the latest version of JBoss Portal. For example, some portlets are no longer present in JBoss Portal 2.6, and certain existing portlets are now packaged differently. This chapter describes updating a MySQL database created by JBoss Portal 2.4, for use with JBoss Portal 2.6.

Users, roles, and pages created in JBoss Portal 2.4 should be accessible in JBoss Portal 2.6 deployments.

The upgrade procedure can be straightforward:

  1. If you are using the JBoss Portal binary, remove the $JBOSS_HOME/server/default/deploy/jboss-portal.sar/ directory. If JBoss Portal was built from source, remove the $JBOSS_HOME/server/default/deploy/jboss-portal.sar file.

  2. Update the data in the JBoss Portal database, as described in Section 4.1.2, “Updating the Database”.

  3. Deploy JBoss Portal 2.6.

4.1.1. Themes

In JBoss Portal 2.6, portal pages contain additional areas, such as the Login, Admin, and Dashboard links, on the top right-hand corner of portal pages:

Since portal pages now contain additional areas, certain themes have changed. If a default theme that exists in JBoss Portal 2.6 is used, such as renaissance, no configuration should be necessary. Using old themes from JBoss Portal 2.4 may make JBoss Portal 2.6 unusable, for example, not being able to log in. To update custom themes, refer to the bundled JBoss Portal 2.6 themes as an example.

4.1.2. Updating the Database

The following tables contain all references to portlets:

  • JBP_INSTANCE

  • JBP_WINDOW

  • JBP_OBJECT_NODE

All procedures described in the following sections can performed using the JBoss Portal 2.4 Admin portlet. Treat these directions as guidelines when migrating a large JBoss Portal deployment. Database data can be updated manually using the correct tools for your RDBMS. For example, if you are using a MySQL database, you can use the MySQL Query Browser.

During the upgrade process, legacy references have to be cleaned up, to either remove them, or to allow JBoss Portal 2.6 to recreate them correctly. Remove all references (instances and windows) to the portlets listed below, as they are not present in JBoss Portal 2.6. This can be done using the JBoss Portal 2.4 Admin portlet:

  • HeaderContentPortlet

  • URLPortlet

  • TestPortlet

  • PortletA

  • PortletB

  • SecuredTestPortlet

  • CharsetPortlet

  • CounterPortlet

  • CachedCounterPortlet

  • ExceptionPortlet

  • PortletSessionPortlet

  • EncodingPortlet

The following instructions refer to a standard JBoss Portal 2.4 deployment. If core portlets, portlet instances, or portlet windows were renamed, make the appropriate modifications. The following is an example of the MySQL Query Browser:

Requested Resource Error

When running JBoss Portal 2.6 with a database created by JBoss Portal 2.4, a non-existing portlet will try to be displayed, resulting in a 404, The requested resource() is not available error.

4.1.3. Portlet Names

Names of certain core bundled-portlets have changed. Destroy the following instances and use the Admin portlet to recreate them, or edit the JBP_INSTANCE table as follows:

  • Change local.samples.JSPPortlet in the PORTLET_REF column to local./portal-jsp-samples.JSPPortlet.

  • Change local.portal.CMSPortlet in the PORTLET_REF column to local./portal-cms.CMSPortlet.

  • Change local.portal.CMSAdminPortlet in the PORTLET_REF column to local./portal-cms.CMSAdminPortlet.

  • Change local.portal.ManagementPortlet in the PORTLET_REF column to local./portal-admin.AdminPortlet.

Some portlets are no longer present in JBoss Portal 2.6, and certain existing portlets are now packaged differently. Remove the following entries in the JBP_INSTANCE table, so that JBoss Portal 2.6 can recreate them:

  • rows containing NewsPortletInstance2 in the ID column.

  • rows containing local.portal.NavigationPortlet in the PORTLET_REF column.

  • rows containing local.samples.HeaderContentPortlet in the PORTLET_REF column.

  • rows containing local.samples.WeatherPortlet in the PORTLET_REF column.

  • rows containing local.samples.NewsPortlet in the PORTLET_REF column.

  • rows containing local.samples.URLPortlet in the PORTLET_REF column.

  • rows containing local.samples.TestPortlet in the PORTLET_REF column.

  • rows containing local.samples.PortletA in the PORTLET_REF column.

  • rows containing local.samples.PortletB in the PORTLET_REF column.

  • rows containing local.samples.SecuredTestPortlet in the PORTLET_REF column.

  • rows containing local.samples.CharsetPortlet in the PORTLET_REF column.

  • rows containing local.samples.CounterPortlet in the PORTLET_REF column.

  • rows containing local.samples.CachedCounterPortlet in the PORTLET_REF column.

  • rows containing local.samples.ExceptionPortlet in the PORTLET_REF column.

  • rows containing local.samples.PortletSessionPortlet in the PORTLET_REF column.

  • rows containing local.samples.EncodingPortlet in the PORTLET_REF column.

Remove the following entries in the JBP_WINDOW table, so that JBoss Portal 2.6 can recreate them:

  • rows containing NavigationPortletInstance in the INSTANCE_REF column.

  • rows containing URLPortletInstance in the INSTANCE_REF column.

  • rows containing PortletAInstance in the INSTANCE_REF column.

  • rows containing PortletBInstance in the INSTANCE_REF column.

  • rows containing EncodingPortletInstance in the INSTANCE_REF column.

  • rows containing PortletSessionPortletInstance in the INSTANCE_REF column.

  • rows containing CachedCounterPortletInstance in the INSTANCE_REF column.

  • rows containing CounterPortletInstance in the INSTANCE_REF column.

  • rows containing CharsetPortletInstance in the INSTANCE_REF column.

  • rows containing SecuredTestPortletInstance in the INSTANCE_REF column.

  • rows containing SecuredTestPortletInstance in the INSTANCE_REF column.

  • rows containing ExceptionPortletInstance in the INSTANCE_REF column.

  • rows containing HeaderContentPortletInstance in the INSTANCE_REF column.

  • rows containing TestPortletInstance in the INSTANCE_REF column.

  • rows containing MissingPortletInstance in the INSTANCE_REF column.

Remove the following entries in the JBP_OBJECT_NODE table, so that JBoss Portal 2.6 can recreate them:

  • rows containing NavigationPortletWindow in the NAME column.

  • rows containing URLPortletWindow in the NAME column.

  • rows containing PortletAWindow in the NAME column.

  • rows containing PortletBWindow in the NAME column.

  • rows containing MissingInstanceWindow in the NAME column.

  • rows containing EncodingPortletWindow in the NAME column.

  • rows containing PortletSessionPortletWindow in the NAME column.

  • rows containing CachedCounterPortletWindow in the NAME column.

  • rows containing CounterPortletWindow in the NAME column.

  • rows containing CharsetPortletWindow in the NAME column.

  • rows containing SecuredTestPortletWindow in the NAME column.

  • rows containing ExceptionPortletWindow in the NAME column.

  • rows containing MissingPortletWindow in the NAME column.

  • rows containing HeaderContentPortletWindow in the NAME column.

  • rows containing TestPortletWindow in the NAME column.

4.1.4. CMS

In JBoss Portal 2.6 versions, the way the CMS content is displayed changed significantly. For further information, refer to Chapter 9, Content Integration and Chapter 21, CMS Portlet. Currently there is no need to have more than one instance of the CMSPortlet. The portlet window displays CMS content, not by referring to that portlet instance, but by having the proper content-type defined. The following configuration is in the jboss-portal.sar/conf/data/default-object.xml file:

<window>
	<window-name>CMSWindow</window-name>
	<content>
		<content-type>cms</content-type>
		<content-uri>/default/index.html</content-uri>
	</content>
	<region>center</region>
	<height>1</height>
</window>

The following example uses the MySQL Query Browser. Open the JBP_OBJECT_NODE table in your database schema. Look at the PATH column to identify any occurrences of CMS in your JBoss Portal deployment. Identify any row referring to CMSPortletWindow, and remember the number in the PK column. The PK number is needed in the following steps:

Go to the JBP_WINDOW table and find a row with the same PK value from the JBP_OBJECT_NODE table. In such a row, replace CMSPortletInstance with a path to your CMS resource. For example, by default, JBoss Portal displays /default/index.html.

Add a row containing the following to the JBP_PORTAL_OBJECT_PROPS table:

  • The PK number remembered from the OBJECT_KEY column.

  • portal.windowContentType in the NAME column.

  • cms in the jbp_VALUE column.

As well, the CMS can be migrated by backing up the jbp_cms_* tables, and recreating them in a JBoss Portal 2.6 database. There were no schema changes for the CMS between JBoss Portal 2.4 and JBoss Portal 2.6.

Portlet Content-type and the path to the CMS Resource