Oracle Coherence with WebLogic 12c

Collecting material for the next edition of my WebLogic 12c book I began writing a primer about Oracle Coherence from a WebLogic perspective. Coherence is part of the WebLogic Suite and you can start using it right away.

Many WebLogic professionals still consider Coherence as something complicated and challenging to get started with, so I made a number of hands-on Coherence primer screencasts available – also more blog postings with best practices will follow.

Make sure to subscribe to WebLogic book YouTube channel: http://www.youtube.com/weblogicbook

 

Basic Introduction

Coherence is a coherent data grid that provides a number of different cache implementations, which are well described here. The following figure illustrates how data A. B, C is stored into different nodes with the same put(key, value) method.

coh_cache impl

Oracle Coherence Basics, Multicast Test and Firewall Issues

Oracle Coherence Command Line, Replication and Availability

 

 

Development with NetBeans Introduction

Oracle Coherence NetBeans API and NamedCache

 

 

Coherence ActiveCache with WebLogic

Coherence ActiveCache can be used to offload session data from WebLogic into Coherence cache nodes. These cache nodes can be managed with WebLogic Nodemanager. A detailed explanation can be found here.

coh_wlsdomain

 

Oracle Coherence ActiveCache for WebLogic 12c configuration

 

Oracle Coherence ActiveCache Demo for WebLogic 12c

 

Oracle Service Bus (OSB) for the Busy IT Profesional

Audience

Oracle Service Bus is one of these software products that haven’t changed much in their core since many years. These days I tend to see more and more OSB projects and one reason certainly is that license wise OSB is included with Oracle SOA Suite.

Compared to SOA Suite, OSB is conceptually different though. Even with a good understanding of SOA Suite (which I will cover in one of the following posts), there will be a slightly steep, but rather short learning curve for OSB.

The following recipes tries to motivate and explain the usage of OSB without the usual marketing hype. Make sure to read the previous posting about getting started with SOA in general and Oracle Fusion Middleware.

Technology

OSB is virtualizing service calls from clients to the service implementation. By using so called proxy and business services (both are components within OSB) incoming and outgoing requests can be arbitrarily connected and protocols can be converted. Proxy services contain the processing logic (validation, enrichment, transformation etc.).

Oracle Service Bus OSB Architecture

Download

If you are trying to get started with OSB, here is the link to download Oracle Service Bus Overview and Getting Started (PDF).

Enjoy!

PS. Actually this recipe is taken out of my book Oracle WebLogic Server 12c – Distinctive Recipes.

SOA and Oracle Fusion Middleware for the Busy IT Professional

Audience

Not everybody is starting up JDeveloper first thing in the morning in order to work with Oracle SOA Suite. Let’s face it: Instead of being an SOA expert, any given IT specialist is more likely a certified DB admin, a Java developer or somebody who was just told by his manager to take care of that Oracle Service Bus installation. In case you are one of them and looking into SOA and the related Oracle products this posting is written for you.

Technology and Oracle

The following two recipes provide firstly a no-nonsense explanation of Service Oriented Architecture (the first part is not related to Oracle at all !) and secondly an overview of Oracle’s Fusion Middleware (OFM) product stack.

ofm stack

The description is deliberately easy to read and I intentionally didn’t reuse any fancy marketing slides since they are often too generic and contain too many buzzwords.

Download

For everybody trying to get started and reading a 101, here is the link to download SOA and Oracle Fusion Middleware for busy IT professionals (PDF).

Enjoy!

PS. Actually these two recipes are taken out of my book Oracle WebLogic Server 12c – Distinctive Recipes.

Oracle WebLogic Server 12c in 7 Cities of Australia!

AUSOUG Workshop Series 2013 with Frank Munz

 

This independent workshop is run by Frank Munz, Oracle Technologist of the Year 2011 and published author of WebLogic 12c: Distinctive Recipes and Middleware and Cloud Computing. Frank was running the popular Oracle and Amazon Cloud Workshops in 2012 and now presents a 3h workshop based on his new WebLogic 12c book in 2013.

wls12book3d_lying

Workshop Details

Duration: 3h including a short coffee break

Content: In the workshop we will cover worthwhile WebLogic 12c features, best practices (also applying  to earlier version of WebLogic), default settings that you should better change, security glitches, useful open source tools and other stuff Oracle doesn’t tell you about.

The workshop will be centered around the core WebLogic technologies. We will examine the interesting new features of Java EE 6, the merged JVM, configuration management, debugging of memory leaks, stuck threads, deployment of configuration settings with application modules, performance tuning tools and mistakes, custom JMX MBeans, etc.

Format: The workshop will contain lots of live presentations. An Oracle Virtual Box Image with all the examples will be provided at the end, so you take them away and use them any time you like on any computer. (Note: The Virtual Box Image won’t contain Oracle WebLogic Server which can be installed in a couple of minutes.)

Target Audience: Ideally you have some hands-on experience with WebLogic, but even if you are just starting and looking for an overview of the exciting parts you are most welcome. The workshop is suited for architects, administrators and those developers interested in more than just Java EE standards.

Links:

Frank’s WebLogic 12c book: http://www.amazon.co.uk/dp/0980798019

twitter:         @frankmunz
blog:              http://www.munzandmore.com/blog

Subscribe to the WebLogic 12c webcast channel on YouTube with over 30 free WebLogic 12c videos available online: www.youtube.com/WebLogicBook

Registration:

For registration check the AUSOUG site first.

$95.00 (inc GST) for members

Dates and Venues:

Broome Western Australia (c) F. Munz

Seats are still available for the following venues:

Apr 8, 2013: Brisbane

Apr 10, 2013: Sydney

Apr 15, 2013: Hobart

Apr 17, 2013: Adelaide

Apr 19, 2013: Perth

Apr 11, 2013: Canberra

Apr 12, 2013: Melbourne

3h are too short? You’d rather prefer an in-house WebLogic 12c workshop? Feel free to drop me an email! All my workshops include course material, all lab applications to take away. Also typically a VirtualBox image is provided so you can ran any example at any time and anywhere.

About Frank:

fm_test3Dr. Frank Munz has over 15 years’ global experience with top middleware vendors such as Sun and Oracle. A middleware and distributed-computing expert, Frank has a Ph.D. in computer science and has published more than 20 peer-reviewed scientific papers and over 200 articles.

Frank’s consultancy, munz & more, focuses on Oracle middleware and cloud computing, offering a high-end training program worldwide.

Oracle rewarded Frank with the Oracle Technologist of the Year award in 2011.

Frank loves to talk about features and showstoppers at conferences all over the world.

 

Reviews and Attendee’s Opinions

Click here for the reviews of the WebLogic training course (Brisbane, Adelaide, Perth events)

New Book WebLogic Server 12c: Distinctive Recipes (Architecture, Development and Administration)

writers

My new WebLogic book is published now!

  • Over 40 videos replacing the boring screenshots used in typical cookbooks.
  • No “Click here. Click there.” instructions
  • Useful recipes
  • Download deployment modules: Web Services, EJB 3.1, Timer EJBs etc
  • Q&As
  • Best Practices
  • Default parameters that you should better change
  • Performance glitches you should be aware of
  • Open source projects you have to know
  • Stuff Oracle doesn’t tell you about…
  • Published in Australia. Click on the book image to buy.

 

WebLogic 12c Book: Distinctive Reciopes (Architecture, Development and Administration)

Check out the book’s homepage.

 

 

DevOps Basics II: What is Listening on Open Ports and Files – WebLogic Essentials

Situation

who_is_listeningCan you easily find out which WebLogic servers are listening to which port numbers and addresses?

Imagine a multi-project machine with a dozen IPs and tens of domains. When trying to start WebLogic another process has already bound to the address and port so you get the following Java exception:

java.net.BindException: Address already in use

What is listening to a particular port on a certain IP?

Is it a WebLogic? If so, what is its domain name and directory?

Solution

There is a helpful UNIX command lsof (the name means “list open files”).

Description

Actually lsof is very versatile. Here are some examples of its usage.

Find what is listening on localhost and port 7001 on the local machine.

$ lsof -i @localhost:7001

COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

java    2802 oracle  397u  IPv6  37417      0t0  TCP ccloud:afs3-callback (LISTEN)

You can tell from the output it is a Java process with PID 2802. To find out more about the Java process, (is it really WebLogic or maybe the Derby database or node manager using a weird port number?) narrow it down with ps.

 

$ ps -ef | grep 2802

 

oracle    2802  2746 18 10:40 pts/2    00:03:10 /usr/java/jdk1.7.0_04/bin/java -client -Xms256m -Xmx512m … .
-Dweblogic.Name=AdminServer … weblogic.Server

Looking at -Dweblogic.Name=AdminServer in the output above tells you it is a WebLogic admin server running. Now if you’d followed recipe 7 you could determine from the username the name of the WebLogic domain. Then you could conclude the domain directory from the domain name.

Discover Domain Name and Directory

Even if you didn’t follow recipe 7 with regard to users and names, there is still a solution. Here comes another trick with lsof (this is why I mentioned that it is so versatile!).

You can still find out what domain the WebLogic instance belongs to by looking at the files it has opened. In particular, you want to see the log files it has opened, because they belong to the domain and unveil the domain directory.

$ lsof -p 2802 | grep ‘\.log’

The last line in the output looks as follows:

java    2802 oracle  348w   REG      253,0        0 261838 /u01/domains/surfandconsulting/servers/AdminServer/logs/access.log

You can easily narrow down the grep command above if you know that your domain directory contains e.g. the word “domain”.

 

Process holding a file

You can also do it the other way around. Find out which process has a particular file opened.

$ lsof /domains/surfandconsulting/servers/AdminSrv/logs/access.log

COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME

java    2802 oracle  348w   REG  253,0        0 261838 /domains/surfandconsulting/servers/AdminServer/logs/access.log

The output is telling you it is a Java process with process ID 2802, so you could use ps again to find out what exactly this Java process is.

 

 

Binding  to name

Check if WebLogic is listening to a particular name, e.g. the host name of the machine.

$ lsof -i @ccloud:7001

 

COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

java    2802 oracle  397u  IPv6  37417      0t0  TCP ccloud:afs3-callback (LISTEN)

From the output you can tell it does!

Binding to IP address

Check if WebLogic is listening on the local machine to the address 192.128.9.1

$ lsof -i @192.128.9.1:7001

There is no output, so WebLogic is not listening to this address.

 

 

Hands-on Webcasts

I recorded a hands-on webcast available that walks you through the usage of lsof.

 

Oracle WebLogic Server 12c: Distinctive Recipes

Many more recipes are contained in my new WebLogic 12c book.

How-to: Starting with Oracle Service Bus

I will use this posting to collect my own recommendations for everybody starting with Oracle Service Bus (OSB).

- Get a formal training. Unlike SOA Suite, where 5 days of training merely scratch the surface, a good OSB training can cover most things you have to know in a week. There is a rather steep learning curve and the official documentation is slightly less brilliant than let’s say Weblogic documentation. “SOA” generally speaking involves more marketecture.

- If you are really new to OSB, then create a simple project with pipeline pairs and stages and find out the order how the actions are executed in the response pipeline. An easy challenge with at least two different approaches, yet sometimes the solution is not that obvious.

- After the training try it yourself. Develop a super simple web service, then call it through OSB, e.g. using SOAPUI or even the WebLogic admin server as a client.

Books

- Get the OSB cookbook from Schmutz and colleagues for further assistance. It’s a cookbook as it says in the title, so don’t expect a lot of explanation or too much background information. Yet it will support you doing more difficult tasks. According to an Amazon review the ebook has some problems (which well be fixed soon I hope!). I recommend it for everybody who is not working everyday with OSB. All examples worked for me so far.

- You may consider the OSB book from Davies, but I personally don’t recommend it for anybody who is not a real expert (then, why would you need a book?). At least don’t expect any simple explanations in the book.

Build

Check out Biemond’s blog posting for deploying OSB and OFM with Puppet.

 

Underlying Tech

If you need a refresher for XPath or XQuery I recommend the free and brief tutorials at w3schools.

Very readably introductions to XSD, XML Namespaces, WSDL and versioning of web services can be found in Thomas Erl’s book about web service contract design and versioning.

 

Links

- Check the following link on slideshare for the new OSB 11g features.

- Calling custom code: Java callouts and custom XPath.

Limitations of OSB

Understand the current OSB 11g limitations. It’s still using Eclipse but all the rest of Oracle SOA Suite has changed to JDeveloper already. So working with OSB and SOA Suite is a bit cumbersome at the moment (you need 2 IDEs when deploying an JCA adapter, XQuery functions differ etc.).

 

Make sure you have a good start with OSB – I personally think it’s a great product of the Oracle SOA stack!

 

DOAG 2012 Konferenz: WebLogic and Cloud Talk

WebLogic Talk

I will hack a WebLogic password live at DOAG 2012 conference ;)
… and explain 9 more things you should know about WLS12c. Mostly stuff out of my WebLogic Advanced Recipe book.

There will also be some chocolate and a book to win!

My WebLogic 12c talk on Tuesday.

Cloud Talk

Don’t miss my cloud talk! I will demonstrate live a couple of things you won’t be able to with the Oracle cloud ;)  Public Cloud talk on Wednesday. More chocolate and of course another book to win!

WebLogic 12c JMX DevCast

I was doing a DevCast on behalf of the Oracle WebLogic team.

Learn about the WebLogic 12c JMX ecosystem: JMX clients, WebLogic scripting tool, JConsole, Jolikia JMX shell with syntax highlighting and tab completion, developing MBeans for your own applications with Spring and Java EE 6.

The slides can be accessed from here as PDF. They are just supporting the presentation, so I recommend to grab a coffee and watch it instead.

It’s a free DevCast, sign up by clicking on the image below.

Enjoy ;) You’ll find many more recipes in my WebLogic 12c book.

Using Apache Derby Database with WebLogic (the express way)

this is more a note to myself, because I keep forgetting the details and then I get angry about myself when I am in a hurry ;)

If you quickly require a database with WebLogic 12.1.1 (or some other version 10.3.3 or later, because since then WLS comes with Derby) and some content (e.g. to try some monitoring tool or a WLST script or something), do the following:

- make sure you have the WebLogic samples and the sample DB installed.

- create a new domain.

- in the domain’s setDomainEnv.sh under DOMAIN_HOME/bin
change the DERBY_FLAG from false to true.

- start the Admin server which will start the Derby database as well.

- Create a data source using the following values:

 DBName: medrec
 Host: localhost
 Port: 1527
 Username: medrec
 Password: medrec

- Test the connection pool after creating it. It should work right away.

Done!

 

 

more details, recipes and discussions …

DevOps Basics I: Track Down High CPU Thread with ps, top and the new JDK7 jcmd Tool.

I captured the following webcast last night. I was writing about how a clever combination of simple tools like ps, top and jcmd can help to track down the Java code that is causing a thread to consume a high amount CPU time.

The approach is very generic and works for WebLogic, Glassfish or any other Java application. UNIX commands in the example are run on CentOS, so they will work without changes for Oracle Enterprise Linux or RedHat.
Creating the thread dump at the end of the video is done with the jcmd tool from JDK7.

The webcast uses the StuckThreadForFree sample application which is specific for WebLogic 12c and can be downloaded from my stuck thread recipe.

Oracle Database as a Service in the Amazon Cloud: Now with APEX, Oracle XML DB and your Data Center’s IPs.

Amazon Web Services improved its Relational Database as a Service (RDS) for Oracle. It now supports APEX (finally, see the lengthy APEX discussion here), the OracleXMLDB and Virtual Private Cloud (VPC).

For more information:

 

IOPS Quality of Service for Amazon EBS Cloud Storage

Define the pipe!

You can now have EBS optimized EC2 instances with e.g.  500 or 1000 Mbit/sec throughput to EBS.

According to AWS a standard EBS volume will cope with 100 IOPS on average allowing some burts. As I mentioned before there was plenty of complaints and discussion about EBS performance workarounds though. Here is the news: AWS is offering provisioned IOPS EBS volumes. You can create up to 20 TB of provisioned IOPS volumes with a total of 10,000 IOPS per AWS account (but apply to extend your AWS account for more).

Seems like a lovely idea for a db data file, doesn’t it?

Does that make you run your EBS I/O benchmark again? Let me know about the results!

Simple Custom JMX MBeans with WebLogic 12c and Spring

Using the Spring framework bundled with WebLogic 12 the programming of JMX MBeans becomes as easy as writing a simple POJO within a web application. After coding the MBean as a POJO all that is left to do is creating the Spring configuration file and editing the web.xml deployment decriptor:

- Firstly you have to add the Spring <listener> to the web.xml deployment descriptor with the web.xml to get Spring started.

- Secondly create the applicationContext.xml for Spring in the WEB-INF subdirectory. Declare the Spring bean and let Spring export it to the platform MBean server.

- Thirdly deploy the web application and test it with JConsole, WLST or j4psh.

For your convinience I already built an example. You can download the deployable SimpleJMX.war file or the complete NetBeans project.

You can see the application in action, including the involved files and the deployment in the following screencast:

How to access custom MBeans from WLST is shown in the second part:

The third part is showing how to retrieve MBean attributes from a JSP:

Amazon / Oracle Cloud Workshops: Mission Completed

I am just back from a successful, long and intensive trip to Australia. If you are waiting for a reply to an email there is a good chance you will get it soon now.

I delivered an  Amazon and Oracle public cloud workshop series on behalf of AUSOUG, based on my cloud computing book: 6 cities, 6 workshops of 4 h each, almost 200 attendees, hands-on, live development in the cloud (WebLogic with 61 GB heap deployed live on 3 continents, cloud storage, auto scaling, transformation of a classical Java EE app in the cloud), 16 flights (including a 1 week trip to the outback, flying 2,5 h north of Perth and driving 2200 km for shooting the cover image for my upcoming WebLogic 12c: Advanced Recipes book).

Check out the flattering reviews for the event.

 

 

thanks to everybody who attended!

 

Amazon Web Services (AWS) EC2 Autoscaling

 

How many blog posts have you read that were written on a ferry? Well this is post makes it one more. Live from famous Manly ferry since I am currently offering a number of Amazon and Oracle Cloud Computing Workshops in Australia.

Elasticity is a key criteria for cloud computing. Autoscaling is automated elasticity. Interesting enough is widely unknown how this will be implemented on the Oracle Public Cloud for the Java Service.

Autoscaling on AWS can only be configured with lengthy commands from the command line but not from the web cased AWS console. Getting all the parameters right can be tricky, so here is one of the easiest examples and a hands-on screen cast using it:

 

 

[shell]

as-create-launch-config surfLaunch –region ap-southeast-1 –key access –image-id ami-b83374ea –instance-type t1.micro
as-create-auto-scaling-group surfScale –launch-configuration surfLaunch –region ap-southeast-1 -availability-zones ap-southeast-1a,ap-southeast-1b –min-size 2 –max-size 4
as-describe-auto-scaling-groups –headers –region ap-southeast-1

as-describe-auto-scaling-instances –headers –region ap-southeast-1
as-put-scaling-policy ScaleDown -auto-scaling-group surfScale –adjustment=-1 –type ChangeInCapacity –region ap-southeast-1
as-put-scaling-policy ScaleUp -auto-scaling-group surfScale –adjustment=+1 –type ChangeInCapacity –region ap-southeast-1

 

as-execute-policy ScaleUp –auto-scaling-group surfScale –region ap-southeast-1

as-describe-scaling-activities -g surfScale –region ap-southeast-1 –show-long

 

as-execute-policy ScaleUp –auto-scaling-group surfScale –region ap-southeast-1

 

mon-put-metric-alarm HighCPUAlarm –comparison-operator GreaterThanThreshold –evaluation-periods 1 –metric-name CPUUtilization –namespace “AWS/EC2″ –period 600 –statistic Average –threshold 80 –alarm-actions “XXX” –dimensions “AutoScalingGroupName=surfScale” –region ap-southeast-1

 

mon-put-metric-alarm LowCPUAlarm –comparison-operator LessThanThreshold –evaluation-periods 1 –metric-name CPUUtilization –namespace “AWS/EC2″ –period 600 –statistic Average –threshold 20 –alarm-actions “XXX” –dimensions “AutoScalingGroupName=surfScale” –region ap-southeast-1

 

REMOVE ALL:

as-update-auto-scaling-group surfScale –min-size 0 –max-size 0 –region ap-southeast-1
as-delete-auto-scaling-group surfScale –region ap-southeast-1

as-delete-launch-config surfLaunch –region ap-southeast-1

 

[/shell]

The comments section is open now for your suggestions how this will be done with the Oracle Public Cloud.

EJB 3.1: Stateless Session Bean Deployed as .war, Dependency Injection, Asynchronous Methods

Development of an EJB 3.1 stateless session bean has become incredibly simple. You add an annotation, there is no XML required at all, no need to implement an interface anymore, and you can easily implement asynchronous methods that decouple your client calls from the method execution. Then, at the end you deploy the EJB as a simple .war file – no need to warp it in an .ear file.

 

The following screencasts explain you how to do it. You can also download the whole NetBeans project  or just a deployable .war file exactly the sources created in the screencasts.

 

Simple Stateless Session Bean with asynchronous method, developed with NetBeans 7.1 and deployed as .war file:

Asynchronous Methods with Stateless Session Bean:

Inject Stateless Session Bean into Servlet:

 

Here is a tough question at the end:

Imagine you have to add a WebLogic specific settings for your stateless session bean. There is no annotation for that. These settings have to be put in the deployment descriptor which typically used to be the weblogic-ejb-jar.xml file within an .ear file. But what if you have already build a .war file which is perfectly possible now (and neither an .ear nor an ejb.jar file).

Where do you put these settings then? Post your answer here.

Oracle DB with OEM in Amazon Cloud

Since today Oracle EM is available with the Relational Database Service in Amazon Web Services.

RDS instances come with a free trial for 60 days and there is no additional cost for OEM.

I recommend to read my Cloud Databases whitepaper to get started, follow the discussion of Oracle DB instances in this previous posting and give it a try yourself.

Here is a screencast that explains how to create an Oracle DB instance in AWS, how to enable OEM (just in case you are an admin) and how to connect to your cloud instance with a local installation of NetBeans (in case you are a developer).

 

AWS Cloud: Use Same Access Key in Different Regions (or in All Regions)

In the Amazon cloud you require an access key to connect to your instances. This key is can be generated when you create your first instance. It’s then downloaded to your client and you specify it when connecting to the instance. Typically you need one key per AWS region.

However, you can use the same key also for different or all regions. You have to connect to a running instance and then copy it from the instance’s authorized_key file under .ssh/and import it as a key pair in the new region as shown in the following video.

Web Service Development with NetBeans and Testing with WebLogic Admin Console

Developing of SOAP based web services for WebLogic 12c (or any other application server) with NetBeans is a breeze. You can do it without using any templates or IDE wizards, no XML is required, no modification of deployment descriptors.

The following screencast shows how to develop the most simple web service pobbislbe, how to test it entirely with WebLogic admin console, and how modifying the web service will work without redeployment.

WebLogic 12c Configuration Management: Change Your Defaults to Track What Happens

Good morning. I just finished the chapter about configuration management for my new WebLogic book. Here is a very short summary of it.

There is a number of default configuration settings that I recommend to change to better keep track of configuration changes. The screencast showing you hands-on how to do this is still rendering and will be available once you are reading this (you can subscribe to all of them here).

After creating a WebLogic domain, consider the following:

 

1.) User personalized administration users.

2.) Audit WebLogic configuration changes (including usernames) so you will know who changed what.

3.) Enable the configuration archiving so you will be able to revert to a previous set of configuration files.

 

None of these settings are enabled per default. All of this you should think about for your environment.

Here is the three-part screencast how to enable it (switch to HD quality and full screen).

Another Myth Debunked: More than 200 Continuous Redeployments with WebLogic

The other day I overheard the myth that you simply cannot redeploy several times with WebLogic because inevitably you would end up having an out of memory error. Since I am currently writing on an WebLogic 12c book I decided to verify that.

Certainly this depends a lot on your heap settings and what your application is doing, eg. it is easier to get it wrong if you are writing your own classloaders etc. I certainly admit that these problems, if they occur, are particularly hard to sort out.

Hands-on Test

More important you should detect them early. So go and test it! It’s a simple 10 line WLST script. I have done it for you to verifiy if there is a general problem with redeployment in WebLogic.

I redeployed the MedRec application over 200 times. MedRec comes with the WebLogic 12c installation (only if you decide to install the samples). It consists of  over 20 EJBs, a web part and a few web services.

The sample domain can be found in the WL_HOME/samples/domains/medrec directory.

Download

A little WLST script that you can download does the trick (it’s a quick hack, you can certainly beautify and add error handling to it!). Download it (it comes zipped) and unzip it to the domain directory. It even contains comments about how to run it.

The script deploys the MedRec application (so undeploy it first!), waits for 30 seconds, undeploys, waits again and deploys again. At the same time it prints the number of loaded classes, heap and non-heap runtime values.

Results

I was running this experiment for 200 redeployments. Apart from the output of the program, I recorded some data plots with jconsole.

The non-heap usage after 200 redeployments is shown on the following screenshot.

Everything was fine. I guess I could also do 1000 redeployments. I just stopped it because I got bored. I believe it would go on forever and I needed to shut down my computer.

 

Also here is the heap usage:

 

So test your own application deployment! It’s an easy test. IMHO it should be run for every important application. Add it to your tests when load testing the application.

Also I recommend to create some load for the app while it’s deployed. You may want shorten the interval between the deployments to a few seconds to get more deployments done faster.

Let me know if it breaks in your case ;)

Also stay informed about other exciting topics covered in the my WebLogic 12c book. I just created a Youtube channel with many WebLogic 12c screencasts (more to come every week).

 

WebLogic 12c and JDK7 with jcmd Tool

WebLogic is still bundled with JDK6 yet changing to JDK7 is a piece of cake.

  • Install JDK7u2 or later
  • Update the setDomainEnv.sh script of your domain for the new JDK
  • Restart your domain

You can follow the steps in the video below and also see the new jcmd tool in action. jcmd unifies the command-line tools (jhat, jstack, etc.) from previous versions.

 

WebLogic Startup Mode: Development or Production? The (hopefully) Complete List of Differences

Let me quickly summarize the all differences between development and production startup mode for WebLogic 12c and previous versions. Information about it is scattered across the Oracle documentation and several blog postings but non of those I checked were complete.

Differences

Startup Mode

Development                     Production

Auto deployment
(to admin server only)

Yes No

Automatically created
boot.properties for Admin server only under
$DOMAIN_HOME/servers/$SERVER_NAME/security 

Yes No

Nodemanger username and password

default admin
credentials
randomly
generated

SSL demo certificates cause warning in log files

No Yes

Log file are rotated at server startup

Yes No

On demand deployment of internal applications as default

Yes No

Availability of web service test client

Yes No

Availability of Classloader Analysis Tool

Yes No

Availability of Fast Swap

Yes No

Change Center Enabled

No Yes

Default start parameters
when using Sun JDK and the default
startWebLogic script 

java
-client
-Xms256m
-Xmx512m
-XX:CompileThreshold=
8000
-XX:PermSize=128m
-XX:MaxPermSize=256m

java
-server
-Xms256m
-Xmx512m
-XX:MaxPermSiz=256m

The following settings in the weblogic.xml deployment descriptors default to -1:

pageCheckSeconds

servlet-reload-check-secs

servlet-reload-check

resource-reload-check-secs

No Yes

 

 

Differences in previous WebLogic versions:

Up to WebLogic 11:

Default JDK used for new domain

Sun JRockit

Up to WebLogic 8 only:
Default number of execute threads

15 25

Up to WebLogic 8 only:
maximum number of JDBC connections default setting

15 25

 

Configuration

There is different ways to configure the WebLogic startup mode:

  1. The startup mode can be configured with the admin console, as shown on the screenshot below (requires a restart). Once it’s set to production mode it cannot be reverted with the admin console.
  2. Supply the -Dweblogic.ProductionModeEnabled=true switch as startup parameter
  3. Set the PRODUCTION_MODE variable in the setDomainEnv script in the directory DOMAIN_NAME/bin.

What you should know

Some issues to be aware of:

  • The differences between the two settings depend on the WebLogic version. This can be a bit confusing when you are running different environments with different versions. See the table above: For WebLogic 8 the maximum number of connections in a JDBC connection pool defaults to 25 in production mode (but 15 in development mode); for WebLogic 12c it defaults to 15 in both cases.
  • You cannot revert to development mode from the WebLogic admin console. It’s like the child-proof lock in the back of your car. I understand that is makes sense to protect the children in the back seat your car from themselves but you are are logged with the admin role – still you cannot revert to development mode using the admin console.
  • Autodeployment is not used that much anymore since it only deploys to the admin server – so it doesn’t make sense for a production domain. What if you are a developer? Then your IDE is deploying to the admin server, that is correct – but your IDE is typically not using autodeployment.
  • Note, that there will be a randomly set user and password for nodemanager when creating your domain in production mode with config.sh (see comments from Jacco).
  • You cannot disable the change center in production mode

 

Something I forgot? I appreciate your feedback.

 


[A more detailed discussion with directions will be part of my upcoming WebLogic 12c book]

WebLogic Scripting Tool on Capsaicin: j4psh JMX Shell with Syntax Highlighting, Wildcards and Tab-Completion

[This posting will be a part of my upcoming WebLogic 12c book]

Kudos Oracle! Over a year ago I mentioned in my Oracle Middleware and Cloud Computing book that developing WebLogic Scripting Tool (WLST) scripts with vi or Notepad++ is so 80′ies. It took you only a couple of months to respond with an Eclipse facet. Now everyone can use the bundled Eclipse with OEPE for WLST scripting . Thanks for that – even if you had it on your to-do list anyway ;)

WLST itself is a fantastic tool to interactively explore WebLogic MBean world with all their attributes, operations, and relationships (it’s described here - did I mention that this post is not for the beginners?). WLST is using its own proprietary syntax to navigate to MBeans though.

Are you willing to look beyond your own backyard? Ready to move to real MBean names? Then let’s spice it up.

 

j4psh JMX Shell

j4psh is a JMX shell which is using standard MBean names, provides syntax highlighting together with code completion and even wildcard patterns! In j4psh you will be using similar command as in WLST. Here is an incomplete list of the most useful commands:

  • connect, to connect to an Java EE server with the jolokia.war deployed or using the Java agent
  • pwd, to find out the current MBean name or domain
  • cd, to navigate to an MBean or domain
  • ls, to list MBean details (works with * and can be restricted as “ls -a” for attributes and “ls -o” for operations).
  • cat, to display attribute values

Unlike WLST, where every command is basically a Python method, the j4psh syntax is as easy as it gets.

 

 

For the bigger picture how j4psh can be downloaded, installed and how nicely it fits into the  Jolokia open source project see my previous posting.

 

Screencasts

In my opinion j4psh is easiest to understand when seen in action, so here are two examples of j4psh sessions.

 

1.) Basic usage of j4psh with WebLogic. The JMX “HelloWord”: enabling verbose garbage collection without server restart.

 

2.) Advanced Usage of j4psh with WebLogic: How to find the right MBean for a JDBC connection? Retrieve JMX attributes from JDBC connection pool, then use the MBean Name for the same RESTful request.

 

Give it a try! It’s free anyway. And let me know what you think!
And by the way, after writing about open source Jolokia, I am now determined to grow a real Jolokia plant myself…

Update: Many thanks to the Jolokia team ;) for the plant!!