Wednesday, December 13, 2006

Reset OC4J Admin Password

Seems like a rash of questions recently about how to reset Oracle Application Server/OC4J's administrator password and for whatever reason Google doesn't index our doc (as per the feedback below, due to our robot.txt disallowing this - I don't know why this is the policy) and as a result isn't finding the entry in our doc on how to do this here:

Reproduced in its entirety below [1] and hopefully this will help Google point people to the right information.

One of the "tricks" you have to be aware of when doing this is that if you are using Application Server Control to manage a cluster of OC4J's, there is a default assumption that all the OC4J's use the same administrator password (you can override) - if you are doing this, step 5 of the instructions, which talks about removing the ASControl cached security file (passwords encrypted!) to re-enable cluster management, is important to heed when you do this.


Reset the oc4jadmin password using the following procedure while you are logged in as the user who installed the Oracle Application Server instance:

  1. Stop OC4J and the Application Server Control.

    Enter the following command in the Oracle home of the application server instance:

    (UNIX) ORACLE_HOME/opmn/bin/opmnctl stopproc ias-component=OC4J
    (Windows) ORACLE_HOME\opmn\bin\opmnctl stopproc ias-component=OC4J

  2. Locate and open the following file in a text editor:


  3. Locate the line that defines the credentials property for the oc4jadmin user.

    The following example shows the section of system-jazn-data.xml with the encrypted credentials entry in boldface type:


    OC4J Administrator
    OC4J Administrator

  4. Replace the existing encrypted password with the new password.

    Be sure to prefix the password with an exclamation point (!). For example:


    The password for the oc4jadmin user should conform to following guidelines:

    • Must contain at least five characters, but not more than 30 characters.

    • Must begin with an alphabetic character. It cannot begin with a number, the underscore (_), the dollar sign ($), or the number sign (#).

    • At least one of the characters must be a number.

    • Can contain only the following characters; numbers, letters, and the following special characters: US dollar sign ($), number sign (#), or underscore (_).

    • Cannot contain any Oracle reserved words, such as VARCHAR.

    See Also:

    "The oc4jadmin User and Restrictions on its Password" in the Oracle Application Server Installation Guide

  5. Delete cached password data by deleting the contents of the following directory:

    ORACLE_HOME/j2ee/oc4jinstance /persistence/ascontrol/ascontrol/securestore/

  6. Start OC4J and the Application Server Control.

    After the restart, the Application Server Control will use your new Administrator (oc4jadmin) password, which will be stored in encrypted format within the system-jazn-data.xml file.

Sunday, December 03, 2006

OracleAS JVM Analysis in Application Server Control

Sometimes you are pleasantly surprised by some of the technologies your colleagues put out. I was in a meeting with the Application Server Control folks last week and was reminded that a fair bit of work was done around JVM analysis in OracleAS 10.1.3 Application Server Control.

Check these screen shots below out:

1. Starting with a quick look at how your heap is doing on your OracleAS instance (remember if you browse my blog, I am running a 6 instance OC4J OracleAS cluster on my laptop). On this one I have two JVMs running this OC4J:

2. At the bottom of this page, there is a more detailed link to look at the 2 JVM's that that summarized heap usage represents taking me down to statistics summarizing each JVM:

3. Then I can click on that JVM and see more breakdowns on CPI, active threads, response and load. At the bottom of this page there is one more button which asks me whether I am using Java SE 5.0 which in turns I can turn on specific MBeans to monitor it. Before clicking that I have to configure OracleAS to monitor those Mbeans as an optional performance monitoring option.

4. In the server properties, it is a one click option to start up monitoring of the Java SE 5.0 Mbeans:

5. And when I return to the last page I couldn't show before I see more detailed analysis of the threads, memory pools, resource usage, number of classes loaded amongst others:

Would be very interested in other metrics and performance issues you would like to see - my personal area of interest that I see customers facing is capturing this kind of information sensibly for analysis in a cluster versus on a per JVM basis ... which one of my JVMs is misbehaving and how can I now get a sensible thread dump to do the analysis.

Your views on the utility of this in your management console and what you really need versus surfacing well known metrics would be great. Thanks!

Saturday, December 02, 2006

OC4J HTTP Server on OracleAS

Here's a deep in the muck kind of post for those who want to know the gory internals of Oracle Application Server and two ways of having an HTTP server set up on it.

Oracle provides an HTTP server out of the box if you download OC4J stand-alone - the 80M download here - If you choose the second download (470M) along with what we call the SOA Suite (BPEL PM, Web Services Manager, Oracle Rules and our new ESB), you will get the managed environment owned by Oracle Process Manager and Notification Service (OPMN) and Oracle HTTP Server - a slight derivate of Apache HTTP Server packaged with Oracle DB RSFs amongst other things.

Sometimes people like to use the OC4J HTTP server which is extremely lightweight, written in Java and does great for high performance smaller environments or even popular in larger environments if you throw a hardware load balancer in front of several OC4J containers - emulating what OHS does out of the box. We have an install option for this lighter weight approach, shown here, where you get our J2EE server with the OC4J HTTP server rather than OHS (the OHS one been the first and second choices, OC4J HTTP being the highlighted choice):

But of course what almost invariably happens is that you choose the first and second choice and then realize you don't want the OHS listener - maybe too much to manage or in production you expect to use generic Apache, SunOne or IIS ... whatever it is - and decide to revert back to the OC4J HTTP server. While it isn't exactly hard, it isn't exactly perfectly intuitive either. So here's how to do it:

1. Shut down your application server:

$ORACLE_HOME\opmn\bin\opmnctl stopall

2. Go to your $ORACLE_HOME\opmn\conf\opmn.xml and find the line:

<ias-component id="HTTP_Server">

and replace it with:

<ias-component id="HTTP_Server" status="disabled" >

What you have done here is turned off the Oracle HTTP Server

3. Now lets turn on the OC4J HTTP Listener. Go to $ORACLE_HOME\opmn\conf\opmn.xml and find the line:

<port id="default-web-site" range="12501-12600" protocol="ajp"/>

and change it to

<port id="default-web-site" range="80" protocol="http"/>

I am assuming you want it on port 80 here; choose the appropriate HTTP port for your machine. You can also do this in Application Server Control screen shown below but you have to make sure OracleAS is running and then after making the change, bounce the OC4J instance you are doing this on. Frankly speaking, it is probably easier just to edit the file when the server is stopped for this kind of surgery.

4. Lastly, edit the file $ORACLE_HOME/j2ee/config/default-web-site.xml and you will see a line like this:

<web-site xmlns:xsi="" xsi:noNamespaceSchemaLocation="" protocol="ajp13" port="0" display-name="OC4J 10g (10.1.3) Default Web Site" schema-major-version="10" schema-minor-version="0" >

Noted the bolded lines here - we need to make the default web site wire up to the ports and protocol in opmn.xml as follows:

<web-site xmlns:xsi="" xsi:noNamespaceSchemaLocation="" protocol="http" port="80" display-name="OC4J 10g (10.1.3) Default Web Site" schema-major-version="10" schema-minor-version="0" >

5. Re-start the server:

$ORACLE_HOME/opmn/bin/opmnctl startall

Now your server should be happily using the Java based OC4J HTTP listener and not using the Apache based Oracle HTTP Server.

Thursday, November 23, 2006

Job Statistics - Product and Technology Choices for the Future

As a result of looking at Rick Hightower's blog on jobs for Spring and Hibernate - - it seemed like playing with Indeed Jobs could almost be as entertaining as a video game (for about 5 minutes!).

It has some practical bearing on IT professionals because if you are working with a technology or product where jobs are rapidly going to zero and you have a family to feed or rent/mortgage to pay, it is good to think ahead. It is also a way to identify up and comers as Rick did with Spring.

One problem I had with Indeed engine was how easy it was to come out with misleading results - using "Spring" brought back jobs in places named Spring versus "Spring Java" which brought back jobs more relevant to Spring developers. "Oracle AS" brought back jobs using Oracle in places named or abbreviated "AS". You yourself may have an opinion or two on whether my take here is valid :-)

Trying to get something that seemed to bring back meaningful jobs by product, framework and open source, I have several possibly interesting graphs to share. I have my particular bias, like Rick did in his survey, of seeing how healthy the technologies and products I work on are from a job creation perspective.

The first is "Oracle Application Server", "WebLogic", "WebSphere", "Tomcat", "JBoss" and "Geronimo". I also wanted to transpose the size of the developer market that these server infrastructures represent against the job requirements for some of the commonly used frameworks and technologies so I added in "Spring Java", "Hibernate", "TopLink", "ADF", "BC4J". Here is what I got:

and inline:

I was happy to see that Oracle Application Server came out on top, followed by WebSphere, WebLogic and Tomcat. JBoss was next and Geronimo at the bottom. Admittedly this is somewhat problematic for all products - e.g. WebSphere is a huge brand encompassing more than the application server and the jobs showed this - calling out WebSphere Application Server like here:

makes Oracle Application Server and WebLogic the two dominant application server job generators out there. Correspondingly, I could see a slight DBA bias in the Oracle jobs though in general they were pretty reasonably reflective of middleware jobs, frequently being Oracle Application Server Administrators or developers.

The large size of Oracle Application Server users did match what I also have seen at our own events, as skewed as our own event obviously will be. The data point I compare to is unlike 4 years ago, at OpenWorld where we would have 100 people per room on Oracle Application Server sessions, now, this year depending on the topic you could see 300-400 people sometimes many more, particularly if the topic was SOA oriented. While this may have been an unusual event - it was an almost overwhelming event in terms of attendance (I believe about 40,000 people!) literally shutting down streets in San Francisco - it was pretty clear there is a huge community of folks asking about and working with Oracle middleware and naturally there is a matching set of jobs out there backed up by this graphic. An Oracle middleware economy so to speak!

One reason I did the breakout above is to show in terms of job opportunity, it appears the bulk of the jobs still fall into knowing the overall product offering versus just the technology. It is one thing to know JSF or EJB, it is another to be successful on a specific application server. Clearly you will be miles ahead knowing the technology, particularly standards based or defacto standards (ala Spring) but employers will frequently hire you on your specific product domain experience (e.g. I know how to cluster Oracle Application Server in a highly available infrastructure, versus I know how to build a servlet that does state replication - two related but different tasks).

Let's dig down in the mess of technologies at the bottom of the above graphic, hidden by the jobs in the server space, so like Rick, we have a better sense of job requirements in the underlying technologies that the upper level application servers support. Here the same thing can be illustrated but I added in JSP, JMS, servlet and EJB to see where these old stalwarts live in the minds of job recruiters:

The interesting thing here is those old fashion baseline technologies of Java EE - JSP (the top orange line -- by far above all others), EJB (purple) and JMS (yellow)- still are the largest job requirements out there beyond these emerging frameworks - they are, so to speak, the meat and potatoes you need as a developer (the SQL of middleware).

Going one level deeper into Rick's analysis, there is absolutely no doubt that Spring, Hiberate and JSF, while the next level down, seem to be emerging into baseline requirements for developers to know for technology jobs. I think it is reasonable to conclude they are the meat and potatoes of the future:

The next one I thought I would check out as EJB 3.0, JPA, OpenJPA, TopLink Essentials (the reference implementation for JPA persistence in the Java EE 5.0 Sun reference implementation as well as the JPA persistence provider in Oracle Application Server). They were hidden in the noise in the above graphic, possibly indicating they are still battling it out for mindshare and job requirements:

The numbers are substantially smaller but it is pretty clear since EJB 3.0 finalized several months ago and JPA has become a recognized term for persistence, there is a clear upswing. I suspect in 6 months to a year - particularly if I judge by the volume of e-mail and customers I get around EJB 3.0/JPA, we will see EJB3.0/JPA merge with the other three technologies - Hibernate, JSF, Spring.

It wouldn't be fair if we didn't do the old fashion .NET versus Java survey so here it is. I never know what is more valid in terms of comparing because recruiters lump languages with runtimes but for reference I did .NET, J2EE, Java, C# and PHP.

My personal conclusion based on reading the job descriptions from this query is that they tend to ask for "Java" when they mean "J2EE" or "Java EE" and it appears ".NET" is a great big catchall for all things Microsoft and perhaps not representative of the equivalent in Java/J2EE. You can make up your own mind and decide what the heck recuiters think when writing job descriptions by looking here ...

To me the reality of .NET versus Java/J2EE is developers have to know both rather than one or the other. Our recent Microsoft Office Interoperability documentation book which focuses on how Oracle Application Server components integrate with and interoperate with Microsoft, I think more closely represents most developers' reality, though clearly many organizations still like to strategically align with one community or the other.

Interested in Hibernate on Oracle Application Server? Check out some of these articles:

Interested in JSF on Oracle Application Server? Check out some of these articles:

Interested in EJB 3.0 and JPA on Oracle Application Server? Check out some of these articles:

Interested in Spring on Oracle Application Server? Check out - many of these articles and how-tos recently arrived also on

Friday, November 03, 2006

Java Process and Instance Data From OracleAS

In the Oracle Application Server it is standard practice to set up a cluster with multiple application server instances hosting multiple OC4J instances each run atop of multiple JVMs.

Frequently when executing a specific application instance (servlet/EJB/Web service), it can be useful to have the exact location you are running - which Application Server instance, which specific OC4J instance and sometimes even the exact JVM instance. Sometimes you need this for your application to make some application centric decision, but more often it is useful for debugging when working in large clusters.

This blog is inspired by Steve Button's work where he built a very cool utility for session tracking in a cluster which implicitly revealed this information - he needed it himself while building it to debug as well to show to the user.

So how do you determine this on Oracle Application Server? There are several system properties that will help you out, specifically:

  • oracle.home - the physical directory in which your application server is installed
  • oracle.oc4j.instancename - the name of your OC4J instance
  • oracle.ons.instancename - your OracleAS instance name
  • oracle.ons.indexid - a combination of your OC4J instance name, the group it belongs to and the actual JVM executing it (for example if there is > 1 JVM you have configured as per my previous post on this topic)
On my cluster - I have a lot of AS and OC4J instances running :-) ... but in the picture below you can see that for this sample, I have highlighted the pieces of interest. In particular, one of the Oracle Application Server instances is named is soa_javaee.MLEHMANN-LAP. In that instance I have several OC4J instances, one in particular called javaee_1 that is configured to run on top of 2 JVMs. That OC4J instance is grouped together with several others in a synchronized group called javaee_group. If you look to the bottom of the graphic below, you will see this:

To try out these properties, I deploy a servlet to that OC4J instance javaee_1 and within that servlet I have the following code:


Oracle home name: " + System.getProperty("oracle.home"));

OC4J Instance name: " + System.getProperty("oracle.oc4j.instancename"));

AS Instance name: " + System.getProperty("oracle.ons.instancename"));

Instance:Group:JVM PID: " + System.getProperty("oracle.ons.indexid"));

What it spits out the other side in my browser is:

Oracle home name: D:\oracle\product\soa_javaee
OC4J Instance name: javaee_1
AS Instance name: soa_javaee.MLEHMANN-LAP
Instance:Group:JVM PID: java_ee1.javaee_group.2

Pretty useful information ... try it out :-)

Friday, October 06, 2006

Process Management in ASControl

In OracleAS, there wasn't any gui for editing the process management settings of Oracle Application like there was in 10.1.2.x. In OracleAS - a patch to - this part of the release gives you that editability back and more. The underlying OPMN.xml is surfaced via JMX so it is fully programmable as well as surfaced in ASControl.

This screen shows how you can view and click down to edit port allocation:

This screen shows the OC4J port management and JDK options:

This screen shows the network and process management port configuration:

This tends to be a little less humbling for those who aren't familiar with the underlying XML files that I faithfully subject you to in my various posts :-)

Like before, download and try it here:

Thursday, October 05, 2006

Creating OC4J Instances in ASControl

In OracleAS the OC4J instance creation was available as a command line option as documented here:

In OracleAS the instance creation, like with OracleAS 10.1.2.x, is available in ASControl again. Below is a screen shot sequence of what it looks like:

1. Within Application Server Control instance click on the instance link:

2. Click on create OC4J instance:

3. Name it and determine which group of OC4J instances it will join:

And you are done. Nice and easy :-)

Try it yourself at: