Monday Apr 07, 2014

How to debug a WebLogic Server Windows Service?

Debugging WebLogic Server Windows Services can be a hard time. Sometimes it is difficult to collect debug information and in other cases, you can't even start it.

So here is my super hero "beasvc -debug"!

You can try :
beasvc -debug "Windows Service Name"

That will really show you the real error when you are not even able to start your windows service.


You can read more information about installing weblogic server as windows service in this My Oracle Support(MOS) documents(*):

How to Install MS Windows Services For FMW 11g WebLogic Domain Admin and Managed Servers (Doc ID 1060058.1)

Other useful documents that are useful when you need to collect debug information when you are using a Windows Service
How Do I Get A Java Heap Dump When Running Weblogic As A Windows Service? (Hotspot JVM) (Doc ID 1264826.1)

Enabling stdout Logging and Generating Thread Dumps When Running WebLogic Server as a Windows service (Doc ID 858746.1)

How to connect to a remote JRockit Java Virtual Machine using JRockit Mission Control (Doc ID 1075329.1)

How to Monitor using JRockit Mission Control a WebLogic Server instance on top of JRockit JVM running as a Windows service (Doc ID 1329897.1)

(*) Links will work if you are logged to MOS.

Thursday Mar 20, 2014

Why do I need to collect several thread dumps?

I used to work with samurai to read thread dumps

But I don't miss him any more after I met thread logic :).

You can read more and download about Threadlogic here:

It also provide excellet guidelines on what is happening in the environment.

But, again Why do I need to collect several thread dumps?

One question for you, Do you understand a video when you see just one screenshot? probably no, even if you have one picture from 'The End'.

Even if you don't see the movie, if you see several screenshots, you can get a better idea of what happened at some time.

Lets say that the most important part of the film for you was the end, if you have several pictures from that time, you will have a very good idea of how the movie finished.

The same is for weblogic server. If we see five thread dumps 10 or 20 seconds apart from each other when one issue occurs, we can have a very good idea of what methods were being executed when one issue occurs.
We can see what weblogic server is waiting for. This helps to identify slowness in subsystems like databases, web services or bugs in weblogic server or other products that were being executed at the time of the issue.


Wednesday Mar 12, 2014

I am configuring a weblogic messaging bridge. What is a member's JNDIName?

As per oracle documentation:

"Messaging bridge can send to and receive from distributed destinations. Oracle recommends the following configurations:

  •  If the source is distributed destination, the bridge is pinned to one of the members when it connects to the destination. It stays connected only to that member until it reconnects. This means that the bridge will not receive messages from the other members of the distributed destination. Therefore, the best practice is to configure one bridge for each member of a distributed destinations using the member's JNDIName.

  •  If the target is a distributed destination, the best practice is to send to the distributed destination using the distributed destination's JNDIName and disable server affinity.
This allows the distributed destination to load balance incoming messages."

When you configure Uniform Distributed Queue, you can see in weblogic console:

Services > Messaging > JMS Modules > <My JMS Module> > <My Uniform DistributedQueue>  > Configuration > Members > Member Name

You will see here all member's JNDIName for each member of your Uniform Distributed Queue.



Friday Feb 14, 2014

How to install weblogic Administration Console after it is uninstalled?

As per security purposes, you might need to uninstall your WebLogic Administration Console, or perhaps by mistake.
I would say that this is a very uncommon scenario, but one of my customer's faced it recently.

So,  How do I uninstall WebLogic Administration Console?

1. To uninstall WebLogic Administration Console, execute uninstall script, and select Administration Console to be uninstall it.


For Windows Environments


For Linux/Unix Environments


2. Hit Next

You have Administration Console Uninstalled it.

Admin Server will start normally, but you won't have access to admin console e.g.: http://localhost:7001/console

What if you just did it by mistake and you need to access it again?

So, How do I install it again ?


1. Use the installer you used to re install the components uninstalled, e.g:

java -d64 -jar wls1036_generic.jar

2. Start Admin Server

3. Access Administration Console at http://localhost:7001/console


Tuesday Feb 04, 2014

Do I need to run WebLogic Server in a certified platform?

Well, the answer is Yes. But, Why is it important to be in a certified platform?

We have faced several issues which customers in a non certified platforms where after a long time and huge
 troubleshooting efforts we concluded that the issue was fixed after moving to a tested configuration.

WebLogic Server might run in any other non certified platform like any flavor of Linux, but we can not assure that it will work correctly.

So, What if you have a problem when running a non certified configuration?  If you don't find a known issue in the net or in My Oracle Support, try to reproducing the issue in a certified configuration. That will save a lot of time because as per out experience, the most probably cause of the issue is that the configuration where you are running WebLogic Server is causing the issue.

Eventually, if the issue still occurs, that will help to focus on the real issue and not in the noise added by the environment used to run WebLogic server.

It is also recommended to be in the latest JDK, that will help you to include in your environment the latest security fixes and patches for known issues already faced by other customers.

Another thing to consider is that you are upgrading your WebLogic Server. Then, you will probably need to upgrade your JDK as well. Always check certification matrix

Here you can find the supported configurations of Fusion Middleware products:

If you are in 12.1.1 or 12.1.2, make sure you pick the correct link. WebLogic Server 12.1.2 is very different from 12.1.1.

If you are in 11g, you will need to pick the document depending on your configuration.

You can see more information here:


Friday Dec 27, 2013

How to Connect to WebLogic DataSource from a Java Client?

Some time ago, one of my customers had issues connecting from a client to a WebLogic Datasource.
I provided the sample code to try the functionality, here are the steps:

1. Save the code below as in /myfolder

import java.sql.*;
import javax.sql.DataSource;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.*;
import oracle.jdbc.OracleConnection;

public class DataSourceClient {
  public static void main(String [] args) {
    OracleConnection conn=null;
    javax.sql.DataSource ds=null;
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
    env.put(Context.PROVIDER_URL, "t3://localhost:7001");

      Context context=new InitialContext( env );
      //you will need to have create a Data Source with JNDI name testDS
      ds=(javax.sql.DataSource) context.lookup ("testDS");
      conn=(OracleConnection) ds.getConnection();
      java.util.Properties prop = new java.util.Properties();
      System.out.println("Connection object details : "+conn);
    }catch(Exception ex){
      //handle the exception

2. Modify PROVIDER_URL if needed. The value is set to t3://localhost:7001
3. Add to WebLogic Server JAVA_OPTIONS -Dweblogic.jdbc.remoteEnabled=true
4. Start WebLogic Server
5. Open a UNIX console. In the same console run:
    i. cd <domain>/bin
    ii. . ./ (Notice the '.' before './')
    iii. CLASSPATH="/myfolder:${CLASSPATH}"
    iv   cd /myfolder
    v.   javac
    vi.  java DataSourceClient

If you succeeed, you will see something like this:

Connection object details : weblogic.jdbc.rmi.SerialConnection_weblogic_jdbc_rmi_internal_ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_Logic

This means, you sucessfully connected to your WLS Datasource.

Do you need further help?

Please check WebLogic Documentation:

Tuesday Nov 26, 2013

How to enable Weblogic Server debugs using WebLogic Console?

This is a very useful topic for those that would like to have a first insight on why an issue is occuring.

1. The easiest way to enable debug flags in WebLogic Server is to use weblogic console. This is done in:

Environment > Servers > MyServer > Debug > weblogic

Then, enable the level of debug you need, e.g.: security, servlet, jdbc.

This change does not require weblogic Server Restart.

2. You need Make sure the severity is set to debug in weblogic console:

Environment > Servers > MyServer > Logging >Advanced > Minimum severity to log: Debug

This change requires server restart.


Wednesday Oct 30, 2013

How to get Messages Pending Count from a Queue using WLST?

WLST is a scripting Language that helps to achieve similar functionality as the ones you have in WebLogic console, but in a command line fashion.

You can develop your WLST Scripts using Eclipse OEPE, read more here:

Finally, here is an example to get Messages Pending Count using WLST:

 . ./
 java weblogic.WLST
 jms= getMBean ('ServerRuntimes/MyManagedServer/JMSRuntime/MyManagedServer.jms/JMSServers/MyJMSServer/Destinations/MyModule!MyQueue')


WLST documentation:

Monday Oct 21, 2013 Error opening file When Deploying an Application to Weblogic Server

The latest weeks we had a hard time trying to solve a deployment issue.

* WebLogic Server 10.3.6
* Target: WLS Cluster

<21-10-2013 05:29:40 PM CLST> <Error> <Console> <BEA-240003> <Console encountered the following error
        at weblogic.servlet.internal.WarDeploymentFactory.findOrCreateComponentMBeans(
        at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(
        at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(
        at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.compatibilityProcessor(
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.setupPrepare(
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$
Caused by: Error opening file - C:\Oracle\Middleware\user_projects\domains\MyDomain\servers\MyServer\stage\myapp\myapp.war Message - error in opening zip file
        at weblogic.servlet.utils.WarUtils.existsInWar(
        at weblogic.servlet.utils.WarUtils.isWebServices(
        at weblogic.servlet.internal.WarDeploymentFactory.findOrCreateComponentMBeans(

So the first idea you have with that error is that the war file is corrupted or has incorrect privileges.        

We tried:
1. Unzipping the  war file, the file was perfect.
2. Checking the size, same size as in other environments.
3. Checking the ownership of the file, same as in other environments.
4. Checking the permissions of the file, same as other applications.

Then we accepted the file was fine, so we tried enabling some deployment debugs, but no clues.

We also tried:

1. Delete all contents of <MyDomain/servers/<MyServer>/tmp> a and <MyDomain/servers/<MyServer>/cache> folders, the issue persisted.
2. When renaming the application the deployment was sucessful
3. When targeting to the Admin Server, deployment was also working.
4. Using 'Copy this application onto every target for me' didn't help either.

Finally, my friend 'Test Case' solved the issue again.

I saw this name in the config.xml


So, it turned out that customer had created a DataSource with the same name as the application 'myapp' in the above example.

By deleting the datasource and created another exact DataSource with a different name the issue was solved.

At this point, Do you know Why ' Error opening file' was occurring?

Because all names is WebLogic Server need to be unique.

"Assigning Names to WebLogic Server Resources
Make sure that each configurable resource in your WebLogic Server environment has a unique name. Each, domain, server, machine, cluster, JDBC data source, virtual host, or other resource must have a unique name."


Tuesday Oct 01, 2013

Getting Started with Weblogic Server

The best way to get started with Weblogic Server is by reading WebLogic Documentation. Sometimes you can say think is too long, I will never finish this!!!

However, that is the best way to understand How to use the product an What are the Best Practices and features.

You can take a quick look and read the details of what you really need.

Also "Admin Console Help" shows detailed steps of how to apply any changes in WebLogic console.

Finally, you can find in My Oracle Support Documents related to known issues or documentation gaps to fix issues you might be experiencing.



My name is Luz Mestre. I work as Principal Technical Support Engineer at Oracle Support. I'll post here the most interesting challenges I have in my daily work. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.


« April 2014