Saturday, March 14, 2015

My Study notes for Oracle WebLogic Server 12c: Advanced Administrator II (1z0-134)

I recently took the "Oracle WebLogic Server 12c: Advanced Administrator II".  I actually took the beta exam (1z1-134).  This is the exam that will eventually become 1z0-134.  I wanted to share some of my experience.  You will also find my notes down below. As a took, the beta exam, some of the questions I encountered on the test will not on the final production test, so take my advice with that caveat.
I assume that if you're reading this, you have already achieved the Weblogic OCA level certification, and therefore have basic knowledge.

  • Practice (a lot of) scripting For this test, practicing on a real Weblogic instance is a must.  Practice doing routine (and not so routine tasks) using WLST.  Things like monitoring running services, online and offline editing, deploying applications, creating some of the more esoteric Weblogic components. There are plenty of questions regarding scripting.
  • Learn your JMS Besides knowing how to setup the different JMS components in Weblogic, review some of the JMS internals, like persistence, acknowledgments, durable subscribers, etc. Review how these different operation methods are reflected in JMS headers. There's a significant focus on JMS. I found this post useful regarding JMS tuning.
  • The NodeManager and service migration There's plenty of questions on different scenarios and the interaction between the NodeManager and migration. I feel that this section requires plenty of work, since most people will only be exposed to only a few of these scenarios in their day to day work.
    • Service vs. whole server migration
    • Script vs. Java NodeManager
    • Consensus vs. Database leasing
  • WLDF For me, WLDF (Weblogic Diagnostic Framework), was a fairly weak area.  Make sure you play around with all of the pieces of the framework.
  • Coherence Coherence was another weak area for me, having never had practical experience with it.  However, the questions related to Coherence we fairly basic. If you need to get started, this post helped me a lot.
  • Linux I was surprised to find some basic linux questions.  I would say they were fairly strait forward, and anyone who had done some day to day troubleshooting will have no problem with them.  If you have only worked under Windows, some research will come in handy.
Below you will find my notes.  Most of my notes come the Weblogic documentation found here.

You can access my notes directly by using this link.

Now the wait is on for the beta period to finish, and to see how well I did. Regardless, this proved to be a very insightful experience, in which I was able to fill quite a few weak areas in my Weblogic knowledge.

Sunday, March 1, 2015

Stepping through the internal code of your JavaEE application server in IntelliJ IDEA

While while trying to container based authentication working with a JDBC realm, I had the need to step through the internals of GlassFish to get a better idea why my settings were not working. It seems that by default IntelliJ IDEA does not provide access to the class path of the application server.


To be able to step through the code, I had to follow a few steps:


1 - Increase the logging in GlassFish.  This is optional, but it gave me an idea of where to start looking for the issue.
2 - Download the GlassFish source code.  This is not an issue for an open source app server.  If you don't have access to the source of your particular proprietary app server, IntelliJ IDEA will still allow you to step through it, and will try to decompile the code, with various level of sucess.
3 - Add the jar that contains the actual compiled byte code.  I found two ways of doing this for Maven based project, one using the provided scope, and another way using the system scope. This step is critical, and at least for me counter intuitive.

Add the jar to your pom.xml using the provided scope:
<dependency>
    <groupId>org.glassfish.main.extras</groupId>
    <artifactId>glassfish-embedded-all</artifactId>
    <version>4.1</version>
    <scope>provided</scope>
</dependency>

This is the easiest solution, but you might not be able to find the required jar in any maven repo.  If you don't find the right jar, but find any jar that has the class, you can use.  For this to work you will have to attach the right source code, as downloaded in step #2.  Otherwise, IntelliJ will decompile the class and give you a nonsensical java file that does not match what you are running.  


Add the jar to your pom.xml using the system scope:
<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>glassfish</artifactId>
    <version>4.1</version>
    <systemPath>h:/servers/glassfish/modules/security-ee.jar</systemPath>
    <scope>system</scope>
</dependency>

If you don't have source code, I recommend this approach.  This will give you a lot of information, even if you lack access to the source code.

5 - Add the source to your new library. The easiest way is to open the class that you want to examine or add the break point to.  Once open you will see the source as decompiled by IntelliJ IDEA. If possible add the sources you downloaded in step #2 to make your life a bit easier.  Select "Choose Sources..." and navigate to your source directory.

You now have access to the class you need. Drop a break point, add a watch, step through it as you need!

6 - Make sure you remove the dependency after your done.  You don't want to have extra dependencies, and in the worst case the build will fail in other computers, if the system scoped library is not available in the same location.