4

When deploying my application to Weblogic 12.2.1, I get this error:

weblogic.application.ModuleException:
weblogic.utils.compiler.ToolFailureException: Neither prefer-application-packages  
nor prefer-application-resources can be specified when prefer-web-inf-classes  
is turned on in weblogic.xml

In weblogic.xml, I have set prefer-web-inf-classes to true.

I use JDeveloper to deploy the application. Nowhere in my application's deployment descriptors (web.xml and weblogic-application.xml) do I use prefer-application-packages or prefer-application-resources. Why is Weblogic showing this error?

Regards, Jeroen

Ulf Gjerdingen
  • 1,414
  • 3
  • 16
  • 20
Jeroen Bakker
  • 41
  • 1
  • 1
  • 2
  • Got the same error. Nowhere in my war are those options set, but weblogic keeps failling to deploy the war. Did you managed to get this sorted out? – isalgueiro Apr 21 '21 at 18:43

3 Answers3

1

If you have prefer-web-inf-classes to true so you can't use prefer-application-packages. You have to use one of them but not both....

I had the same issue migrating from WL11 to WL12 :

Weblogic 12c : Prefer-web-inf-classes and prefer-application-packages for Jersey

After all :

  1. Use just prefer-web-inf-classes to true.
  2. If you use this, you don't need to use prefer-application-packages ....BUT ENSURE that you have the correct libraries at war /ear level.
Community
  • 1
  • 1
Azimuts
  • 1,212
  • 4
  • 16
  • 35
0

Check carefully, based on the documentation over here: Deployment Descriptor Elements, A value specified in the Administration Console will take precedence over a value set manually. So it must have been set somewhere.

zulqarnain
  • 1,695
  • 1
  • 16
  • 33
0

can you export your application to an ear file and there verify if there is no weblogic-application.xml with prefer-application-packages or prefer-application-resources tags ?

Jdeveloper creates automatically those files when there are any shared libraries, and could be the case.

devwebcl
  • 2,866
  • 3
  • 27
  • 46