Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
€32.99 €36.99
Paperback
€45.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781849686969
Vendor :
Oracle
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 23, 2013
Length: 374 pages
Edition : 1st
Language : English
ISBN-13 : 9781849686969
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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.