ADF: How to find out which ADF version is installed on a manged WebLogic server

As a developer and architect I’m working with different version of JDeveloper and WebLogic servers. Sometimes I switch version multiple times a day. Most customers have multiple deployment targets (development, QS and production) on different Weblogic servers. This make it sometimes hard to keep track of the different versions.

I searched for a way to find out which ADF Runtime is installed on a given WebLogic server. If you look at the console application or the Enterprise Manager application you’ll see no difference. Sometimes you can guess which version is running if you know which other application version is running under which server version. Still there should be a better solution.
Searching (my friend Google) the only way I found was to check the MANIFEST.MF of a specific jar on the server. As I don’t have access to a command shell on all servers this method won’t work for me. Then I stumbled upon the PrintVersion class ( which prints the BC4J version. A bit more digging led to the class oracle.jbo.Version which was mentioned in a really old blog entry from 2003 ( This class is still available and hold information about the ADF version like the build label and BC4J version. Some of the info is stored in static final variables and only one public method Version.getAsAtring() is available.

This class is the solution I was looking for. As I couöd not build an ADF application, but needed a solution which is deployable to a managed server, I decided to implement a web service which returns the BC4J version and the build label of the ADF Runtime Library deployed ton the WebLogic server.
To make this work, I could not directly access the static final fields of the Version class. Doing this would compile the version information from the ADF Runtime Library at compile time into the web service. To access the build label which has no getter method I need to use reflection. Finally I wrote this Class


import java.lang.reflect.Field;
import java.lang.reflect.Method;

import javax.jws.WebMethod;
import javax.jws.WebService;

import oracle.jbo.Version;

public class AdfVersion
    public AdfVersion()

    public String getVersion()
        return Version.getAsString();
    public String getBuildLabel()
        Class<?> cl = null;
            cl = this.getClass().getClassLoader().loadClass("oracle.jbo.Version");
        catch (ClassNotFoundException e)
            return e.getMessage();

        Method[] lDeclaredMethods = cl.getDeclaredMethods();
        Field[] lDeclaredFields = cl.getDeclaredFields();
            Field lDeclaredField = cl.getDeclaredField("buildLabel");
            String y = (String) lDeclaredField.get(lDeclaredField);
            return y;
        catch (IllegalAccessException e3)
            return e3.getMessage();
        catch (NoSuchFieldException e)
            return e.getMessage();

To make the web service independent from the Jdeveloper ADF Runtime I reference the ADF Runtime Library which is deployed on the server as shared library ‘’. For this I created a weblogic-application.xml descriptor and add the library ref to it.

<?xml version = '1.0' encoding = 'UTF-8'?>
<weblogic-application xmlns:xsi=""

Now, after deployment of the EAR you can test the web service on different servers with different ADF Runtime Libraries deployed and see something like

WLS 10.3.5 with ADF Runtime Library

WLS 10.3.5 with ADF Runtime Library

WLS 10.3.5 + Sherman Patch and ADF Runtime

WLS 10.3.5 + Sherman Patch and ADF Runtime

The ear should be deployable on all 10.3.x WebLogic servers.

You can download the workspace (build with JDev from here: blogadfversoinws-zip.doc
Please rename the file to ‘.zip’ after downloading it! There in no DB connection needed.

About these ads

7 thoughts on “ADF: How to find out which ADF version is installed on a manged WebLogic server

  1. Hi Timo,
    Nice blog. I like to know the version of the ADF.

    But when I tried your code it given me bunch of errors. below is the strac trace. Can you please tell me what I need to do to resolve the issue.

    The selected operation getVersion could not be invoked.
    An exception occured while invoking the webservice operation. Please see logs for more details.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: oracle/jbo/Version

    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: oracle/jbo/Version at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation( at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation( at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation( at sun.reflect.GeneratedMethodAccessor2086.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at com.sun.el.parser.AstValue.invoke( at com.sun.el.MethodExpressionImpl.invoke( at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke( at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding( at org.apache.myfaces.trinidad.component.UIXCommand.broadcast( at$ at at at at$ at at at at javax.faces.component.UIViewRoot.broadcastEvents( at javax.faces.component.UIViewRoot.processApplication( at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication( at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase( at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute( at javax.faces.webapp.FacesServlet.service( at weblogic.servlet.internal.StubSecurityHelper$ at weblogic.servlet.internal.StubSecurityHelper.invokeServlet( at weblogic.servlet.internal.ServletStubImpl.execute( at weblogic.servlet.internal.TailFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter( at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter( at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter( at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl( at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter( at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at Source) at weblogic.servlet.internal.FilterChainImpl.doFilter( at oracle.sysman.emSDK.license.LicenseFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at oracle.adf.model.servlet.ADFBindingFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at oracle.adf.library.webapp.LibraryFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at at weblogic.servlet.internal.FilterChainImpl.doFilter( at at weblogic.servlet.internal.FilterChainImpl.doFilter( at at weblogic.servlet.internal.FilterChainImpl.doFilter( at at weblogic.servlet.internal.FilterChainImpl.doFilter( at oracle.dms.wls.DMSServletFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at weblogic.servlet.internal.RequestEventsFilter.doFilter( at weblogic.servlet.internal.FilterChainImpl.doFilter( at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt( at weblogic.servlet.internal.WebAppServletContext$ at at at weblogic.servlet.internal.WebAppServletContext.securedExecute( at weblogic.servlet.internal.WebAppServletContext.execute( at at at Caused by: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: oracle/jbo/Version at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke( at oracle.sysman.emSDK.webservices.wsdlparser.OperationInfoImpl.invokeWithDispatch( at oracle.sysman.emas.model.wsmgt.PortName.invokeOperation( at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation( … 68 more Caused by: oracle/jbo/Version at at at at at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke( … 71 more

    Thanks in Advance,

    • Udaya,
      can you please be a bit more specific?
      What exactly have you done?
      Have you recompiled the source code, build an EAR out of it and deployed it to a stand alone WebLogic server?
      Which jdev Version do you use?
      Which version has the WebLogic Server?


  2. Nice to have the version in the UI, but if you do have command line access the following approach also works:

    [oracle@iademo oracle_common]$ export ORACLE_HOME=/oracle/ofm_new/oracle_common
    [oracle@iademo oracle_common]$ OPatch/opatch lsinventory

    where, for example, amongst other things it displays the string: “Oracle Application Developer 11g″

    • Rashid, this is normal behavior. You can use SoapUI to test the web service or you use the WebLogic Servers test facility (like shown in the blog). Is you ask for the wsdl using a browser, you get the wsdl as xml data returned.
      The blog doesn’t come with an UI for the web service. This you have to do yourself. You can use jdev to create a WebService Data Control from the web service to show the returned value in an ADF UI. However, this will only work if you have the right adf runtime installed on the server (which you try to find out!).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s