JAR Hell with XFire 1.2.6
I discovered something somewhat disturbing last week. As part of AppFuse 2.0 M5, we added "xfire-all" as a dependency so web services could be supported out-of-the-box. What I didn't know is that xfire-all has transitive dependencies to 40 other libraries, which total 13.4 MB in size. Yikes!
Does XFire take the cake for the most bloated library you can use or are we just including too much (xfire-all vs. fine-grained dependencies)? I tried changing to the recommended Maven configuration and there's still 28 JARs added by XFire.
The WEB-INF/lib directory of a basic Struts 2 + Spring + Hibernate AppFuse application is already 19.2 MB to start. Adding XFire for web services increases the size to 29.2 MB. While disk space may be cheap, some users have noticed "mvn jetty:run" is much slower with XFire (presumably from the JAR processing that happens at startup). Is there an uber XFire JAR we can use instead?
Here is the eclipse .userlibraries file for the xfire stack we use (jaxb implementation):
Here is their dependency page, also: http://xfire.codehaus.org/Dependency+Guide.
Cheers,
jt
Posted by jt on June 04, 2007 at 07:48 PM MDT #
Posted by Mark Hatham on June 04, 2007 at 08:19 PM MDT #
Posted by Dan Diephouse on June 04, 2007 at 11:20 PM MDT #
Posted by Don Brown on June 05, 2007 at 12:33 AM MDT #
Posted by Tim O'Brien on June 05, 2007 at 03:21 AM MDT #
Are there more JARs I can eliminate for an optimized Java 5 + Tomcat setup? Do I need commons-attributes-api-2.1.jar, xercesImpl-2.6.2.jar, xfire-aegis-1.2.6.jar, xmlParserAPIs-2.6.2.jar and XmlSchema-1.1.jar?
Posted by Matt Raible on June 05, 2007 at 01:27 PM MDT #
I almost always exclude xercesImpl, xmlParser etc. from my wars. Assuming everyone sticks to the the javax.xml APIs you should be able to get away with the ones bundled in the JVM.
Another constant irritation for me with Maven/dependencies is when different projects depend on essentially the same API but where it has a different groupId/artifactId. I usually try and figure out which jars are really the same and eliminate the spurious ones.
I've had this problem with cglib, commons-logging, stax parsers, jaxb libraries etc. etc.
Posted by Tim Morrow on June 05, 2007 at 09:05 PM MDT #
Now XFire only adds 15 JARs to my resulting WAR and increases the size by 4 MB. Most of the size increase seems to be caused by xbean-2.2.0.jar, which is a whopping 2.5 MB. I find it funny that a library to make Spring's XML simpler is almost as big as spring.jar. ;-)
If any of the libraries I'm excluding are needed for some reason, please let me know.
Posted by Matt Raible on June 06, 2007 at 06:22 PM MDT #
I have to admit, that I've only used the spring config stuff either... :-)
Posted by Stefan Kleineikenscheidt on June 07, 2007 at 09:23 AM MDT #
Posted by Stein Kåre Skytteren on June 09, 2007 at 07:36 AM MDT #
Posted by vic on June 11, 2007 at 01:43 AM MDT #