Wednesday, December 21, 2011

How to set EAR Version for ADF Application on WebLogic

If it happened to deploy ADF application on WebLogic, most likely you noticed that it assigns default version V2.0 for each ADF deployment. We would like to set our own specific version, instead of having V2.0 assigned by default:

This can be achieved by creating Manifest file inside root src/META-INF folder:

You must create Manifest file by yourself and it should be visible under META-INF descriptors from JDeveloper:

ADF application version is specified by Weblogic-Application-Version parameter inside Manifest file:

Register Manifest file with application deployment profile - include Manifest under EAR options:

Make sure to remove Manifest file from Application Descriptor filters - otherwise file will be included twice and deployment fail:

Application with our predefined version is deployed. Previos version is not removed, but is retired - we can remove it later or restore if needed:

Download sample application, it includes sample Manifest file -


Hasim said...

if there are multiple version running on weblogic then user request will be serviced by which deployment. I have seen issue ,if multiple version are deployed with different context then too it will show GUI of version 1 instead of version 2 on different context.

Andrejus Baranovskis said...

There must be always one version running at one time, other versions should be retired - as per screenshot...


Edwin Biemond said...


I do it all with ANT like this ( this is a war , but I also do it with a shared lib ,ejb, ear etc )

<war destfile="${workspace.dir}/deploy/${}.war" needxmlfile="false">
<lib dir="${workspace.dir}/deploy">
<include name="*.jar"/>
<attribute name="Extension-Name" value="${}" />
<attribute name="Specification-Version" value="${version.number}" />
<attribute name="Implementation-Title" value="${}"/>
<attribute name="Implementation-Version" value="${version.number}-b${build.number}" />
<attribute name="Implementation-Vendor" value="Enbridge" />
<attribute name="Weblogic-Application-Version" value="${version.number}-b${build.number}"/>
<attribute name="Built-By" value="${}" />
<attribute name="Built-Date" value="${}" />


Andrejus Baranovskis said...

Thanks for sample script.


Anonymous said...


both version run in parallel while there are session still valid.
Users already connected to old version will continue to use it as long as their session is valid.
New users will use the new version of the application.
Once all sessions on old version are no more, the old application will be retired.

Andrejus Baranovskis said...


I tested - app version goes to Retired state, even there is active user session. At least with default settings. Any specific configuration should be set?


Anonymous said...

This is the default behavior that while there are some active sessions the old application will have an intermediate 'stop running' status, so if your application was put to Retired all sessions must have been closed.

That's what i observe on all my applications

Andrejus Baranovskis said...

For my test case, I had couple of opened sessions. Most likely it just kills sessions attached with old application and sets Retired state.


Anonymous said...

ok, i understand why.
If you update the deployed application from the weblogic console at some point during deployment you have the choice between allowing the app. to finish the current sessions (it's the default behavior) or retire after a timeout (by default 1 in the console).
Jdev is probably using the later option.

Andrejus Baranovskis said...

I see, thats explains it.

Wendy Tromp said...

I tested this in JDeveloper and I needed another bogus line in the MANIFEST.MF file for it to work properly. Otherwise the file is simply ignored and the version stays 2.0. Has anyone else noticed this?

Andrejus Baranovskis said...

Please mention what line you needed?


WOzzie said...

Great concise post - thankyou Andrejus

Anonymous said...

Wendy mentioned:

"I needed another bogus line in the MANIFEST.MF file for it to work properly"

It is important that the last line in MANIFEST.MF be terminated properly with 0x0D 0x0A ( like all previous lines ) else it will be ignored.

Andrejus Baranovskis said...

Interestin - I didnt faced that. Thanks for update.


Micajah McGarity said...

Then is there a way to programmatically (in java) obtain the version number of this EAR?

Shahzad Ahmed Khan said...

Hello Andrejus,
I am new in adf and using jdev11.1.2.3.
I have followed all the steps as mentioned in your post. Application is deployed successfully but where can i found version information in weblogic console. There is no option for version of ear.
Please advice

Mohammed Tanveer said...


One issue I faced with this approach is that - Even for new session old code/ui is displayed. The code only refreshes once I restart managed server. This kills the HA concept.

Andrejus Baranovskis said...

Something is wrong with your deployment process. It should show new version for new session, without server restart.


Anonymous said...


Followiny your steps for ADF results in no version change. Deployment log doesn't show any artifact that the Manifest.MF file is even been considered. Can you confirm this still functions for



Andrejus Baranovskis said...


It works fine in and, probably mistype in your config.


Marco said...

Hi Andrejus,

I follow this post and all works fine in A question, how i can read MANIFEST.MF from my ViewController project? The goal is to show EAR version in the application UI.


Shrikant Kandkurwar said...

Its very very helpful post for the developer...thank you Andrejus. I tried it on version and getting expected result as stated.

José said...

I have generated the ear file with the versioned manifest, however I have doubts on how the file is uploaded to the weblogic. Do I have to upload the ear file with another name (myEar_version2) and then deploy it for both versions to work (myEar_version1)?

Garvit joshi said...

I am trying to make a Ear versioned, by palcing the manifest file directly in the Ear(path- xxx.EAR/META-INF/MANIFEST.MF) and deploying it.
The ear is Deployed on the weblogic sucessfully with version but i am facing issue on updating the next EAR with updated version.
Is there a entry i need to make in Ear xml's?
Do weblogic reads a XML file in EAR for deployment process?