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:
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...