NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
I wrote a post a few days ago about using Jersey 2.x as a shared library with WebLogic 12.1.2
. In that post I suggested the following: In weblogic.xml the prefer-application-packages element needs to have entries added for ALL OF THE PACKAGES in the Jersey 2.x shared library JAR files. That means you need to go through every jar file in WEB-INF/lib for the shared library that was created with Maven and make sure the packages it defines are included in this element.
Now that is a tedious process and I thought that is something that could be automated. I spent a bit of time on the weekend putting together a script just for that. The script will go through all JAR files in a directory specified on the command line and will generate a list of unique <package-name>
elements that can be used in weblogic.xml
The script can be found on GitHub: ikromin/j2ee/weblogic_xml_cpgen/gencp.sh
Here's a sample output of this script:
The actual usable output of this script is saved to a temporary file. The name of the file is displayed as the last message from the script before it exits.
Below is what a sample output file will look like:
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
If you spot something out of place, please do let me know.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...