By BrunoBorges-Oracle on Mar 03, 2014
WebLogic is Oracle's strategic application server for the Java EE Platform. Since Oracle decided to focus on it for commercial support, and decided to leave GlassFish free of any ties with commercial decisions, I decided to bring this type of content to help GlassFish customers as well users to experiment, try, and evaluate Oracle WebLogic 12c (Java EE 6 certified).
But before getting down to the migration part, first thing you should learn is How to Install WebLogic 12c. For this migration tutorial in a developer environment, we will be using the Developer installation, but for production environments, we recommend the Full installation.
Developer Installation of WebLogic 12c
- Download WebLogic 12c ZIP Distribution for Developers (latest version: 12.1.2)
- Unzip it somewhere, for example:
$ unzip wls1212_dev.zip -d /opt
- Go into the newly created directory
$ cd /opt/wls12120
- Let's unpack the JAR files that were optimally compressed with pack200
$ sh configure.sh // for Windows, call configure.cmd
- After the uncompression, configure script will ask you if you want to create a new domain. Say "yes" by pressing 'y', then [enter]
- Provide a username, a password, and then confirm again the password
- Wait for the domain to be created and started
Test your WebLogic 12c Developer Installation
You may also find very useful to know you can manipulate all domain settings through the WebLogic Scripting Tool, a command-line interface for you to code in Python, and issue commands to view and edit all settings. In an upcoming version of WebLogic we will also provide a REST interface.
I will use WLST in the next posts in this series, so maybe you want to read more later.
How to Start/Stop WebLogic 12c
The Beauty of Java EE 6
JPA and Database setup
- $ mysql -u root -p
- mysql> create database gf2wls;
- mysql> grant all privileges on gf2wls.* to gf2wls@localhost identified by 'gf2wls';
Import project to NetBeans, setup MySQL driver, and run it on GlassFish 220.127.116.11
Download the project 'bookmark-javaee6' to your local machine by either cloning the GitHub repository locally, or by downloading the zip and extracting somewhere. This is an Apache Maven project, so don't worry about environment. Just make sure you have this project up and running on a GlassFish domain.
Import the project bookmark-javaee6 into your NetBeans environment. Right click on bookmark-javaee6 project and select Run. Test the application by going to http://localhost:8080/bookmark-javaee6.
You should by now looking at the following screen:
Test the Bookmark WebService with a simple clientThe sample Bookmark application comes with a JAX-WS WebService.
Running the sample Java EE 6 application in WebLogic 12c
- Go to your WLS installation. It is probably located here:
- Now change to the following directory:
$ cd oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.2
- Issue the following command to sync WLS Maven Plugin into your local repository:
$ mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=/opt/wls12120/oracle_home/.
- Open the POM file of bookmark-javaee6 project
- Uncomment the WebLogic Maven Plugin definition
- Make sure to enter the same username and password as your domain when you installed and configured WebLogic
- Make sure WebLogic is running
- Make sure there's no other bookmark-jaavaee6 project deployed on your WebLogic instance
- Execute the following command:
$ mvn package pre-integration-test
- Check your logs and try http://localhost:7001/bookmark-javaee6!
And by the way, WebLogic is not that heavyweight and unproductive application server developers thought it still is. For more information about Developer Productivity with WebLogic 12c, read my entry "WebLogic in Comparison: RebelLabs and the Java App Server Debate".