Log In | Sign Up   View a printable version of the current page.
  Dashboard > [fleXive] > ... > How-Tos > Deploy in WebLogic 10.3

Added by Markus Plesser, last edited by Markus Plesser on Feb 23, 2009  (view change)
Labels: 
(None)

How to deploy [fleXive] on WebLogic 10.3

WebLogic support is currently exclusive to the 3.1 development branch and not supported in [fleXive] 3.0!
Currently only remote JNDI lookups are supported and deployment requires manual modification in the applications web.xml file as well as manually copying files to the servers lib directory.
It is doubtful that these restrictions can be removed until Oracle decides to release a version of WebLogic with a properly bundled JSF 1.2 environment.
A great help in achieving WebLogic compatibility was provided by the JBoss Seam documentation.
Please note that the instructions provided here are based on WebLogic version 10.3.0, tested using Windows and Linux!

Getting, installing and running WebLogic

WebLogic can now be downloaded at Oracles website - you need to register to be eligible for downloading.
Run the installer using the default options.
The installation directory will be referred to as <BEA home>.
The default samples server we will be using resides in <BEA home>/wlserver_10.3/samples/domains/wl_server.
If you choose to create your own domain replace samples/domains/wl_server with e.g. user_projects/domains/<your domain name>
If you want debugging enabled add the line

JAVA_OPTIONS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"

to <BEA home>/wlserver_10.3/samples/domains/wl_server/bin/startWebLogic.[sh|bat] and attach from your IDE of choice using port 5005

Preparing JSF 1.2 support

WebLogic comes with the option for JSF 1.x support, but unfortunately it is not enabled by default nor can it be initialized transparently (hence the need to add a com.sun.faces.config.ConfigureListener to web.xml).

In <BEA home>/wlserver_10.3/common/deployable-libraries you should find a file named jsf-1.2.war containing the Sun JSF-RI from a nightly build dating back to 2007.
Copy this file to a temporary directory and unpack it using jar xvf jsf-1.2.war.
A directory named META-INF/lib will be created containing two files that we need: javax.jsf_1.2.0.0.jar and glassfish.jsf_1.2.3.2.jar.

Copy these two files as well as jboss-common-core.jar (from the [fleXive] distribution or sources) to <BEA home>/wlserver_10.3/samples/domains/wl_server/lib.

Starting and stopping the server

Navigate to <BEA home>/wlserver_10.3/samples/domains/wl_server/bin and run startWebLogic.[sh|bat].
To stop the instance either use the administration web interface or run stopWebLogic.[sh|bat] found in the same directory.
A browser window should pop up with a link to the console web application.
The default credentials are user weblogic with password weblogic.

Deploying the JSF 1.2 library

Although already in the lib directory, the JSF 1.2 libraries need to be deployed manually:

In the console web application you will find a window at the left side titled Domain Structure.
Click on Deployments, which will load a main window titles Summary of Deployments.
Click Install and navigate to <BEA home>/wlserver_10.3/common/deployable-libraries.
Select jsf-1.2.war and click Next.
Make sure Install this deployment as a library is checked and click Next.
Accept the dafaults and click Finish to complete installation.
You should now find an entry named jsf(1.2,1.2.3.2) in the list of deployed applications of type Library.

Setting transaction timeouts

Since [fleXive]'s run-once scripts run within a single transaction, the default timeout (30s) is a bit too short.
Change it in Services|JTA in Domain Structure to a bigger value like 300.

Setting up H2 Datasources

WebLogic comes with no out-of-the-box support for H2.
Integration is simple (but not well documented):

  • Edit your domains setDomainEnv.[cmd|sh] file found in <BEA home>/samples/domains/wl_server/bin and add
    set EXT_PRE_CLASSPATH=<path to h2.jar>
  • Restart WebLogic if it is running

In the console web application navigate to Services|JDBC|Data Sources in Domain Structure.

flexiveConfiguration

Click New to create a new DataSource.
Name: flexiveConfiguration
JNDI Name: jdbc/flexiveConfiguration
Database Type: Other
Database Driver: Other
Click Next

Check Supports Global Transactions and Emulate Two-Phase Commit
Click Next

Database Name: flexiveConfiguration
Host Name: localhost
Port: 9092
Database User Name: sa (or your respective username)
Password: leave blank (or your respective password)
Confirm Password: leave blank (or your respective password)
Click Next

Driver Class Name: org.h2.Driver
URL: jdbc:h2:tcp://localhost:9092/~/flexiveConfiguration;SCHEMA=flexiveConfiguration;MVCC=TRUE
If you have a blank password (default) enter the following in Properties:
Properties:

user=sa
password=

Test Table Name: DUAL
Click Next (dont finish yet since we need to bind the DataSource to the server)

Check examplesServer (or how ever you named your server)
Click Finish

Now the DataSource should appear as flexiveConfiguration in the list of DataSources.
Click it and then click the tab Connection Pool. At the buttom of the page you will find a link labeled Advanced. Click the link and check Test Connections On Reserve. Click Save to persist the changes.
Now click the Monitoring tab and select the sub-tab Testing. Select your server and click Test Data Source.
If you get the message Test of flexiveConfiguration on server examplesServer was successful. everything is working fine.

Setting up MySQL Datasources

In the console web application navigate to Services|JDBC|Data Sources in Domain Structure.

flexiveConfiguration

Click New to create a new DataSource.
Name: flexiveConfiguration
JNDI Name: jdbc/flexiveConfiguration
Database Type: MySQL
Database Driver: MySQL's Driver (Type4) Versions:using com.mysql.jdbc.Driver
Click Next

Check Supports Global Transactions and Emulate Two-Phase Commit
Click Next

Database Name: flexiveConfiguration
Host Name: localhost
Port: 3306
Database User Name: root (or your respective username)
Password: a (or your respective password)
Confirm Password: a (or your respective password)
Click Next

Leave the fields as they are but enter DUAL in Test Table Name
Click Next (dont finish yet since we need to bind the DataSource to the server)

Check examplesServer (or how ever you named your server)
Click Finish

Now the DataSource should appear as flexiveConfiguration in the list of DataSources.
Click it and then click the tab Connection Pool. At the buttom of the page you will find a link labeled Advanced. Click the link and check Test Connections On Reserve. Click Save to persist the changes.
Now click the Monitoring tab and select the sub-tab Testing. Select your server and click Test Data Source.
If you get the message Test of flexiveConfiguration on server examplesServer was successful. everything is working fine.

flexiveDivision1

Click New to create a new DataSource.
Name: flexiveDivision1
JNDI Name: jdbc/flexiveDivision1
Database Type: MySQL
Database Driver: MySQL's Driver (Type4) Versions:using com.mysql.jdbc.Driver
Click Next

Make sure Supports Global Transactions is NOT checked!
Click Next

Database Name: flexive
Host Name: localhost
Port: 3306
Database User Name: root (or your respective username)
Password: a (or your respective password)
Confirm Password: a (or your respective password)
Click Next

Leave the fields as they are but enter DUAL in Test Table Name
Click Next (dont finish yet since we need to bind the DataSource to the server)

Check examplesServer (or how ever you named your server)
Click Finish

Now the DataSource should appear as flexiveDivision1 in the list of DataSources.
Click it and then click the tab Connection Pool. At the buttom of the page you will find a link labeled Advanced. Click the link and check Test Connections On Reserve. Click Save to persist the changes.
Now click the Monitoring tab and select the sub-tab Testing. Select your server and click Test Data Source.
If you get the message Test of flexiveConfiguration on server examplesServer was successful. everything is working fine.

flexiveDivision1NoTX

Click New to create a new DataSource.
Name: flexiveDivision1NoTX
JNDI Name: jdbc/flexiveDivision1NoTX
Database Type: MySQL
Database Driver: MySQL's Driver (Type4) Versions:using com.mysql.jdbc.Driver
Click Next

The rest of the steps is exactly like for flexiveDivision1.

Deploying [fleXive]

Before you deploy [fleXive] you must make sure to include the Sun JSF-RI Configuration Listener in your web.xml file! <flexive src home>/src/ui/jsf-backend/resources/web.xml containes a commented out snippet to include the Listener. See this pages FAQ section for an example.

In the console web application navigate to Deployments in Domain Structure.
Click Install and select the path where your flexive.ear file resides.
Check flexive.ear and click Next.

Make sure Install this deployment as an application is checked and click Next.

In the next screen you can accept the defaults and click Finish to deploy [fleXive].

You should (hopefully) get the following success messages:
All changes have been activated. No restarts are necessary.
Success The deployment has been successfully installed.

Now you can access [fleXive] using the URL http://localhost:7001/flexive/adm

FAQ

Some solutions to common problems:

Exception
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory

Solution
Include a listener in your web.xml:

<listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>

Exception
javax.faces.application.ViewExpiredException: viewId:/pub/login.jsf - View /pub/login.jsf could not be restored.

Solution
Clear your browsers cookies and cache.

Site running on a free Atlassian Confluence Open Source Project License granted to [fleXive] . Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.1 Build:#916 Nov 09, 2007) - Bug/feature request - Contact Administrators