11 August 2011

weblogic.xml and prefer-application-packages

Short and sweet this one, purely for my own future simple reference.

To use prefer-application-packages in weblogic.xml, it looks like this:
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">





Anonymous said...

From oracle document http://docs.oracle.com/cd/E21764_01/web.1111/e13712/weblogic_xml.htm#i1075205, I didn't find prefer-application-packages under container-descriptor, is this officially supported?

Buttso said...

gday --

Yes it is -- we added it specifically to support war level filtering since it's a common deployment model.

It's in the XSD, so must be a doc oversight.

I'll log a doc bug, thanks for pointing it out.


Buttso said...

I covered this a little yesterday:


The WLS 10.3.6 documentation shows it as well now:



Anonymous said...


coudl you please help wm with a sample on how I could use prefer-application-packages for a ear .I tried so many options nothing seem to work to take JPA2 on weblogic 10.3.5. I don't want to amke any changes to PRE-CLASSPATH rather manage this at application level .Appreciate your help .

Many thanks,

Buttso said...

gday Sree -

I had something on this topic a while back, have a look at this:


That seems like it covers what you are looking for.

Have a look anyway and post back if you still are having trouble.