UPDATE January 2016 - We now officially certify and support WebLogic 12.1.3 and WebLogic 12.2.1 on Docker Containers! For more information see this blog post and this whitepaper on OTN. The Docker configuration files are also now maintained on the official Oracle GitHub Docker repository. WebLogic 12.2.1 is also Java EE 7 and JDK 8 certified. Links in the Docker section of this article have also been updated to reflect the latest updates and changes.
For more up to date information on Docker scripts and support, check the Oracle GitHub project docker-images.
was released and with it the support for perhaps the most important Java EE 7
APIs for database-backed Web Applications development. These are the specifications supported in this release:
As you can see above, WebLogic is bundled with the same implementations used by GlassFish 4.0, which gives you a compatible application server if you have already started developing Java EE 7 applications (well, of course limited to these APIs) and now seek for a commercially supported environment.
There are also some improvements in the Apache Maven Plugin, which makes developers' life much easier, allows for much better automated testing (Arquillian!), Continuous Integration and Delivery. IDEs that support Maven-based projects also benefit from this.
Getting started with WebLogic 12.1.3, Java EE 7, Maven, and Docker
Installing WebLogic 12.1.3 without Docker (easy)
WebLogic ZIP is very easy to install:
- Extract the content in a folder where you want to hold the wls12130 directory that comes inside the ZIP file. On my Linux machine, I use /home/bruno/Work/tools/.
- Go to the wls12130 folder and run the configure.cmd (Windows) or configure.sh (Unix).
- Creating the domain may take too long and may be seen as the installer is freezed. Make sure to configure this if you are on Linux:
$ export CONFIG_JVM_ARGS=-Djava.security.egd=file:/dev/./urandom
- When the installer asks you if you want to create a domain, type [Y]
- Installer will ask you for username/password. On dev environments, I usually use weblogic/welcome1
- Installer will start WebLogic right away and you can check it running at http://localhost:7001/console
Installing WebLogic 12.1.3 with Docker (easier)
If you work on a Linux-based machine as your development environment and you aren't familiar with Docker
yet, check the What is Docker
, then give it a try
. Long story short: Docker is a Linux container; it is like
a virtual machine, but it is not (there are people running Docker on top of Vagrant virtual machines, for example). The most important thing for us here is that it will create a virtual network interface with a virtual IP address.
- Download the ZIP or checkout the docker-images Git repository and extract somewhere on your computer. I will use $DOCKER_HOME as a reference to that location.
- Copy the wls12130_dev.zip you download previously into $DOCKER_HOME/docker-images/dockerfiles/12.1.3
- Call the ../buildDockerImage.sh script (as sudo) and wait for Docker to do its magic
- Call docker run -p 8001:8001 oracle/weblogic:12.1.3-developer and see WebLogic going up and running on a Docker container.
- It will attach port 8001 to your host interfaces
- Open http://localhost:8001/console. Username/password are weblogic/welcome1
Configuring your local Maven repository
It is now possible to use Maven without a local installation of WebLogic, which is perfect for CI environments (Hudson/Jenkins). You will still require a installation though to set up the Maven Plugin initially, but as soon you install this to your remote Maven repository for example, other developers and CI envs won't need to have WebLogic installed locally, if deploying to a remote server. For local development, you can also point to WebLogic as a "remote" server, of course.
The steps to configure Maven are well documented and it is done by the Maven Synchronization Plug-in
. After installing it to your local repository, you can call the sync goal
to populate a local or remote repository. Here are the steps for a local environment:
- Go to the WebLogic home installation directory. For example:
$ cd /home/bruno/Work/wls12130/
- Go to the subdir
$ cd oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/
- Execute the following command:
$ mvn install:install-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-sync-12.1.3.jar
- Finally you call the push command to upload all Maven artifacts (plugins, archetypes, etc) to your repository (local in this case)
$ mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=/home/bruno/Work/wls12130/
Create Java EE applications with WebLogic Maven Archetypes
Now of course you can open this Maven project on your NetBeans
, IntelliJ IDEA, Eclipse, and then setup WebLogic in your IDE. Or you can just issue the command below to build, package, and deploy this WAR artifact to the WebLogic server you have running on your computer (either using Docker or the normal installation):
mvn package pre-integration-test
Here we make sure to use -Dupload=true since I'm not sure if you are using Docker or not. If you are, then upload
is required since the container has no access to your local file system (although possible