Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Getting Started with Oracle WebLogic Server 12c: Developer's Guide
Getting Started with Oracle WebLogic Server 12c: Developer's Guide

Getting Started with Oracle WebLogic Server 12c: Developer's Guide: If you've dipped a toe into Java EE development and would now like to dive right in, this is the book for you. Introduces the key components of WebLogic Server and all that's great about Java EE 6.

eBook
€24.99 €36.99
Paperback
€45.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Getting Started with Oracle WebLogic Server 12c: Developer's Guide

Chapter 2. Setting Up the Environment

In this chapter we're going to set up all the software required to implement and execute the code that we will be writing along the book. More specifically, we're going to:

  • Install JDK Version 1.7, which will be used by the application server and the development environment

  • Install Oracle WebLogic Server and Eclipse OEPE binaries

  • Install a MySQL RDBMS server and configure a database

  • Create and configure a WebLogic domain

  • Configure the Eclipse IDE to recognize the WebLogic Server

  • Install and configure an OpenLDAP server

About the directory structure


While writing this book, a couple of Unix-like operating systems were used, more specifically Mac OS X and Ubuntu. So, when referencing a directory path, the format adopted is /some/folder. If you are a Windows user, the equivalent path would be C:\some\folder.

The base folder used in the book is /opt/packt/. Inside it, we're going to add a few more folders to accommodate the necessary components. Here's the basic structure you have to create before moving on to the next section:

/opt/packt/
  |- domains
  |- etc
  |- install
  |- workspace

Of course, you don't need to follow the preceding definitions. If so, just remember to change the references accordingly, when mentioned.

Tip

Microsoft Windows users: Whenever asked to choose a directory name, remember to select or create one without spaces to avoid potential problems later on.

Installing JDK 1.7


Since Oracle WebLogic Server 12c offers support to both Java SE 6 and 7, we're going to use the newest version, so we can code using a few developer-friendly features, such as the diamond operator and multicatch statements, as outlined in the The Project Coin section in Chapter 1, Overview of WebLogic Server 12c and Related Technologies.

  1. Access the download page at http://www.oracle.com/technetwork/java/javase/downloads/index.html

  2. Click on the DOWNLOAD button at the top of the page, or the one in the JDK column inside the Java Platform, Standard Edition table. At the time of writing, the newest JDK version was 7u21.

    Note

    Remember that we need a JDK, not a JRE.

  3. On the next page, click on the Accept License Agreement option button and select the appropriate package for your system inside the Java SE Development Kit 7u21 table:

    Tip

    Downloading the example code

    You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com...

Installing Oracle WebLogic Server


Oracle WebLogic Server's installation is pretty straightforward; we just need to pay attention to the Java SDK selection in order to use the one we just installed.

  1. Navigate to the download page at http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html.

  2. Click on the Accept License Agreement option button.

  3. Right below the option box, there's a drop-down list with five entries. Select the entry Generic WebLogic Server and Coherence installer (880MB) and click on the Download File button.

    Note

    Another option is to download the zip distribution; with barely one fifth the size of the generic installer, it includes all core artifacts, leaving out samples, the Derby database, and web server plugins, among other features. Also, there's no way to apply patches to this installation.

    If bandwidth is a concern, go ahead and get this file instead of the generic one. Check the README.txt file inside the package for instructions on how to install and configure...

Installing Oracle Enterprise Pack for Eclipse (OEPE)


The installation package we got doesn't come bundled with a development environment (Oracle JDeveloper, NetBeans, or Eclipse/OEPE). To create the book's applications, we decided to use Eclipse along with Oracle's application server plugin, OEPE, which is a great tool for Java EE development, integrating the IDE with WebLogic Server and other Java EE application servers. Perform the following steps to install it:

  1. Navigate to http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html.

  2. Click on the option button for Accept License Agreement, choose the Eclipse version that runs on your system, and click on it to start the download.

  3. After the download completes, unzip the installer in the directory $MW_HOME/oepe and it's done.

    Tip

    OEPE's newest version, 12.1.2.1, is based on Eclipse 4.3 Kepler, the most up-to-date version of Eclipse.

Installing MySQL


In order to explore Java Persistence, we need to install and configure a database server, and MySQL is a logical choice, being widely adopted and lightweight.

The software is available to several operating systems: Microsoft Windows, Debian, SUSE Linux Enterprise Server, Red Hat, Solaris, Mac OS X, and so on.

Installing on Linux using a package manager

If you are using a Linux distribution such as Ubuntu or Red Hat, most likely you already have the software available, you just need to install it with a command like this (you may want to update your repositories and packages to be sure that your system is up-to-date):

sudo apt-get install mysql-server mysql-client

Note

The stable version at the time of writing is 5.5.27, but most likely the repositories have older versions, for instance, 5.1 on Ubuntu 11. This version is pretty much enough to run the code we're going to explore throughout the book, so you can go ahead and install it.

The system is going to suggest a lot of other...

Preparing PrimeFaces


PrimeFaces is a suite of components built on top of JSF 2.x, giving you lots of first-class widgets to use on a Rich Internet Application (RIA) solution, such as charts and mind maps. Its only requirement is to choose between Oracle Mojarra and Apache MyFaces, both JSF 2.0 implementations, and to reference the chosen one. The current implementation version at the time of writing is 3.5.

Tip

Oracle WebLogic Server 12c comes with a JSF 2.0 implementation (Oracle Mojarra) enabled at its classpath, so we don't need to download anything but PrimeFaces.

Downloading the binaries

To use PrimeFaces, we must download it from http://www.primefaces.org/downloads.html. You can choose between Binary, Source, and Bundle packages.

Tip

To follow the book, getting the binaries is enough, but if you plan to use PrimeFaces for real work, the Bundle option would be a good idea, since it includes the binaries, source code, API Javadocs, and taglib documentation.

The official documentation is a...

Setting up a WebLogic domain


As you may know, after finishing the installation of Oracle WebLogic Server, you have the necessary binaries to start a container, but there is no configured server to deploy your code yet (unless you installed the samples, but we're not going to use them). To accomplish this, you have to create a domain consisting of one or more server instances. Your code runs on these instances.

We're going to use a basic domain template, consisting of just one instance, since we don't have any scalability or high availability requirements for the time being.

Tip

Concepts related to how to configure an Oracle WebLogic Server environment—domains, clusters, machines, and so on—are covered in Chapter 10, Scaling Up the Application. For now, we only have to know that we need an instance to run the projects on, and it is part of a domain, which is the component that OEPE links to.

To create it, follow the ensuing steps:

  1. Start the Configuration Wizard script, config.cmd (Windows) or...

Configuring Eclipse and OEPE


The next step is to configure the Eclipse IDE so it knows about Oracle WebLogic Server's installation, the domain we created, and PrimeFaces' shared library.

Linking WebLogic's runtime environment

First, we're going to tell Eclipse where to find WebLogic's runtime environment:

  1. Launch the Eclipse IDE by running the following command:

    $MW_HOME/oepe/eclipse
    

    Or open the shortcut created by the installation process.

  2. Enter /opt/packt/workspace on the Workspace Launcher screen.

  3. Open the Preferences screen using the menu – Window → Preference.

  4. In the filter field, type server, click on the Runtime Environment entry and then the Add... button.

  5. In the new window, type 12c in the filter field, select the entry Oracle WebLogic Server 12c (12.1.2) and click on Next.

  6. Fill the field WebLogic home with the path where you installed the server—$MW_HOME/wlserver—and the other fields should be filled automatically:

  7. Click on Finish to close this window and return to the Preferences screen...

Referencing MySQL databases


The last step is to configure the data sources that the application is going to use at WebLogic, and create links to these databases at Eclipse. This kind of connection is a data source (DS) inside WebLogic Server.

Tip

In earlier versions of WebLogic Server, you were supposed to configure both a connection pool and a data source. Now, both concepts are contained within a data source, which is a logical move—sharing a pool of connections but not the link to it (the data source) may lead to problems, since no application could predict if others were using the underlying pool, and worst yet, how.

Creating WebLogic data sources

As we just finished enabling the domain at Eclipse, we can start the server from there:

  1. In the Servers tab, right-click on the domain name and then Start from the context menu, or if you prefer to start it manually, OEPE will synchronize to show that the server is up and running.

  2. The focus will switch to the Console tab. After 15 to 30 seconds,...

Using OpenLDAP


OpenLDAP is a cross-platform, free, and open source implementation of a Lightweight Directory Access Protocol (LDAP) server, released under a BSD license. It was started in 1998 and since then has had active development and constant releases, being widely adopted by many commercial-grade systems and applications.

Although WebLogic server includes its own embedded LDAP server for default security management, it's neither used nor recommended for application-specific security management. That's when third-party LDAP servers and products are recommended and offer much more flexibility and features for a real-world scenario.

Tip

Note that you can use WebLogic embedded LDAP for the examples in this book, although we do recommend the experience of creating and configuring an Authentication Provider outside WebLogic.

In this section we're going to provide general guidelines for OpenLDAP configuration, but due to the way different operating systems package the software, some configuration...

Summary


At this point, we have installed and configured the Oracle WebLogic Server, an IDE (Eclipse OEPE), and the additional pieces of software needed to develop our applications.

The following is a table with all paths and environment variables that you may have defined in your environment in this chapter:

Variable

Path

JAVA_HOME

/opt/packt/install/jdk1.7.0_21

DOMAIN_HOME

/opt/packt/domains/tickets

MW_HOME

/opt/packt/install

In the next chapter, we're going to set up the projects that will evolve throughout the book, develop the business entities, and use the libraries and packages we've just created. These projects will be deployed to the server and we will run a simple test to make sure everything is properly configured.

Left arrow icon Right arrow icon

Key benefits

  • Create a complete Java EE 6 application leveraging WebLogic features like JMS, SOAP and RESTful Web Services
  • Learn how to use Oracle WebLogic Server's key components and features
  • Step-by-step instructions with screenshots and code samples to help understand and apply concepts

Description

Oracle WebLogic server has long been the most important, and most innovative, application server on the market. The updates in the 12c release have seen changes to the Java EE runtime and JDK version, providing developers and administrators more powerful and feature-packed functionalities. Getting Started with Oracle WebLogic Server 12c: Developer's Guide provides a practical, hands-on, introduction to the application server, helping beginners and intermediate users alike get up to speed with Java EE development, using the Oracle application server. Starting with an overview of the new features of JDK 7 and Java EE 6, Getting Started with Oracle WebLogic Server 12c quickly moves on to showing you how to set up a WebLogic development environment, by creating a domain and setting it up to deploy the application. Once set up, we then explain how to use the key components of WebLogic Server, showing you how to apply them using a sample application that is continually developed throughout the chapters. On the way, we'll also be exploring Java EE 6 features such as context injection, persistence layer and transactions. After the application has been built, you will then learn how to tune its performance with some expert WebLogic Server tips.

Who is this book for?

Getting Started with Oracle WebLogic Server 12c: Developer's Guide is written for developers who are just getting started, or who have some experience, with Java EE who want to learn how to develop for and use Oracle WebLogic Server. Getting Started with Oracle WebLogic Server 12c: Developer's Guide also provides a great overview of the updated features of the 12c release, and how it integrates Java EE 6 and JDK 7 to remove boilerplate code.

What you will learn

  • Create and package applications and shared libraries that use Java EE resources such aspersistence layer, interceptors, and managed beans
  • Expose and consume Web Services using both SOAP (JAX-WS) and REST (JAX-RS) technologies
  • Utilize WebLogic Server s security providers to add authentication and authorization to an application
  • Publish and consume messages using JMS features, understanding and programming both server and standalone client pieces
  • Scale up your application using features such as session replication, caching and optimized data access
  • Unlock WebLogic full potential with expert performance tuning tips
  • Understand the concepts and usage of validators, events, and listeners

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 23, 2013
Length: 374 pages
Edition : 1st
Language : English
ISBN-13 : 9781849686976
Vendor :
Oracle
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 23, 2013
Length: 374 pages
Edition : 1st
Language : English
ISBN-13 : 9781849686976
Vendor :
Oracle
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 110.97
Getting Started with Oracle WebLogic Server 12c: Developer's Guide
€45.99
Securing WebLogic Server 12c
€22.99
Oracle WebLogic Server 12c Advanced Administration Cookbook
€41.99
Total 110.97 Stars icon

Table of Contents

11 Chapters
Overview of WebLogic Server 12c and Related Technologies Chevron down icon Chevron up icon
Setting Up the Environment Chevron down icon Chevron up icon
Java EE Basics – Persistence, Query, and Presentation Chevron down icon Chevron up icon
Creating RESTful Services with JAX-RS Chevron down icon Chevron up icon
Singleton Bean, Validations, and SOAP Web Services Chevron down icon Chevron up icon
Using Events, Interceptors, and Logging Services Chevron down icon Chevron up icon
Remote Access with JMS Chevron down icon Chevron up icon
Adding Security Chevron down icon Chevron up icon
Servlets, Composite Components, and WebSockets Chevron down icon Chevron up icon
Scaling Up the Application Chevron down icon Chevron up icon
Some WebLogic Internals Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(2 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Verda Brunkow Feb 02, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
My computer son requested this so thought it was a good book to get him. I didn't hear anything to the contrary that it wasn't a good book.
Amazon Verified review Amazon
Daniel Cicero Amadei Feb 13, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I was one of the tech reviewers for the book and I can say I learned a lot from it. The book touches a lot of technologies and uses all of them together to create a real world application. The book addresses Java EE 6: EJBs, CDI, Web Services, RESTful services, JavaServer Faces 2 along with prime faces, using these technologies in a way that makes sense. So, I definitely recommend it!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.