Common Category

What’s New in Middleware Magic

Today we have introduces few stuff which would surely help people like us who love’s to be in touch with the technologies in Middleware application servers as well as get an access to do the same stuff using a social network site. Let’s face it today Social Network is growing rapidly and what would be best if you mix these Social sites with technologies to learn more stuffs on Middleware technologies. Thus Middleware Magic team has created Middleware Magic Facebook Page , Facebook Group.



To join our Middleware Magic Facebook Page follow below steps

– Login on Facebook site.
– Then click here -> Middleware Magic Facebook Page
– Once you are on the above page, you just have to click “Like” button as shown below.

Middleware Magic Facebook Page

Middleware Magic Facebook Page

– That’s it !


– You just click “Like” button on the Middleware Magic facebook widget.

The main reason we have come up with this new idea is to bring all the Middleware folks together  at one place and to build a strong community to face any kind of issue or any challenges. Also you would see more stuffs on Middleware Magic coming, to make your life much easier.

Hope everyone has got a Facebook account 😉

Update: 30/12/2010

As promised above we have also added ourself on twitter so now you can also join us and get our updates on twitter.

To join Middleware Magic on Twitter follow below steps

– Login on Twitter site.
– Then click on the twitter icon show below

– Once you are on the above twitter page, you just have to click “Follow” button as shown below.

Middleware Magic on Twitter


Jay SenSharma & Ravish Mody

Steps to Configure SNMP agent on Weblogic Server

Ravish Mody

Simple Network Management Protocol (SNMP) is a type of an application layer protocol which governs the exchange of management information between network devices. Now in webLogic server SNMP agents can be configured to collect data  from the webLogic server management system and communicate the results over the SNMP protocol. In this example we will see “How to Configure SNMP Agent in WebLogic Server?”

This could be a very useful tool for the administrators to keep a watch of what exactly is going on with the servers and take an actions accordingly. As weblogic server supports SNMP protocol like SNMPv1, SNMPv2 and SNMPv3 from weblogic server version 10 MP-3 we can do lot of things with it.


Some Advantages of Weblogic  SNMP Agents

  • Send notifications when any servers starts or has been shuts down.
  • Monitor any specific log messages or error message and send notifications when weblogic server generates them.
  • You can even use JMX monitors to poll weblogic server MBeans periodically and send notifications when the MBean attributes change in what ever way you want.
  • And lot more can be done with it.

Steps to Configure SNMP agent

1.  Start your WebLogic Server and Login to the Admin Console.

2.  Create a SNMP agent from the following console path

Domain Structure -> expand “Diagnostics” -> “SNMP”


Creating SNMP Agent


Giving SNMP Name


Selecting SNMP Agent


Configuring SNMP Agent


Targeting SNMP Agent

3. Once you target the SNMP agent on the running server then you will get the following output on the prompt which makes sure that our configuration is taken properly.


Output After SNMP is Targeted

4.  Now we will configure an Attribute changes on our SNMP agent to keep an eye on the changes done at an applications deployment order.


Selecting SNMP Agent


Creating Attribute Changes


Giving Attribute Changes Name


Selecting MBean Attribute - DeploymentOrder


Selecting Attribute Changes


Configuring Attribute Changes


Targeting Attribute Changes

5. After configuring Attribute changes now we will configure Trap destinations on our SNMP agent to send the notifications.


Selecting SNMP Agent


Configuring Trap Destination


Configuring Trap Destination

6.  Now open a new command prompt/shell and run the following command after running setDomainEnv.cmd /

java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 165

Where -p is having the post given to the Trap Destination

7.  SNMP side configuration has been completed, now its time to test if everything is working fine as it should be. So from the Deployment  page go the application which you have chosen in the step 4 and from the configuration tab change the deployment order as shown below.

Console Path:

Deployment –> (YOUR APPLICATION) –> Configuration tab –> change Deployment Order


Deployment Page

8.  You can now notice that if you change the deployment order parameter you get the following output, which would indicate the the order has been change as shown in the below snap-shot.


Trap Result

You can monitor lot more by using the same steps and also configure log filtering, monitor particular string and many more things. Hence this way you can get alerts and keep knowing what is going on in your production environment.


Ravish Mody

Steps to configure a Singleton Service from Application side

Ravish Mody

Ravish Mody

A singleton service is a service that can only run on a single managed server in a cluster at a time. Weblogic Server lets you automatically monitor and migrate singleton services from one server to another. This can be done by implementing the “weblogic.cluster.singleton.SingletonService” interface and by using activate () and deactivate () methods in a class.

For Application level demo you have download a simple application “MySingletonServiceEar.ear” which has a class in it called “MySingletonService.class” which implements the “weblogic.cluster.singleton.SingletonService” interface and has both activate () and deactivate () methods in it which is under APP-INF -> classes. And in “weblogic-application.xml” has the singleton service name and class name which necessary for this configuration because here we are configuring a singleton services from application side.

Steps To Follow:

1.    Create 2 managed Servers say MS-1 and MS-2 and assign a Machine & a Cluster to these Managed Servers.


2.    We would be using NodeManagers (Consensus) for clustered singleton services migration, hence we have to configure following things.

Console Path: Clusters —> Cluster —> Configuration [tab] —> Migration [sub-tab]

Candidate Machines For Migratable Servers: Machine

Migration Basis: Consensus


3.    Now you just have to deploy “MySingletonServiceEar.ear” targeted on Cluster which we had made.

4.    Start both the managed servers with the help of nodemanager.

5.     If you want to check on which server is Singleton Service might be running then you can confirm this from the managed servers .out file, as from console we did not make any Singleton Services. In my case following was the output.


MS-1.out file was having the active () method called.


But MS-2.out file was not having the active () method.


This states that the service is running only on one server.

6.    Now shutdown MS-1 and then check the managed server’s .out files.


You will notice that the MS-1.out would have now called deactivate () method and has got shutdown.


However MS-2.out file will have the active () method as when MS-1 was brought down and during that time our service had migrated to the MS-2.


This states that the service has got migrated properly and is still running only on one server.

NOTE: Here service can be running on any server for the first time, as we did not mention the Preferred Server for the service anywhere in application level.


Ravish Mody

Copyright © 2010-2012 Middleware Magic. All rights reserved. |