Are we going to jar hell in a java platform similar to hell dll?

Last night I tried to create a simple tutorial on creating an application using the stack - Spring (2.5) + JPA (1.0) + Hibernate (loading for the first time, so I don’t know which version to use), Unfortunately, I didn’t want to use Maven. since the participating members were on ANT build. As usual, we got into the search engine and somehow made steps in appcontext, persistence.xml and in java classes. At that moment, when I started to get the necessary libraries, I lost in the JAR-hell. Fortunately, there are not many problems on the Spring side, since all the dependent JARs are packaged together for my Spring 2.5.6.

When it came to sleep mode, I had no idea that all banks should be included in the first place. On the next call, I don’t know which version to add for each.

Finally, I got everything that worked, but I am so scared to enter this JAR hell if I do not go through the sky Maven.

With a lot of interceptors and weaving, it is becoming more and more difficult for a regular Java programmer who once loved Java, above all, for greater transparency of what my code does.

Am I right in the process of thought?

+7
source share
3 answers

You still have dependency management when using Ant, use Ivy . See the detailed tutorial here for more or less exactly the stack you want to use. (Does not include Hibernate, but I think you can find how to add this pretty quickly)

And one more thing: if you are referring to spring.jar, which has the full Spring 2.5.6 package, I highly recommend not using it, you will probably need no more than 20% of the libraries included in it. (Take time to see exactly which libraries you need, and just select them.)

Also, consider using Spring 3 if you can, and also Hibernate, if you can choose a version, I would use the latest version.

+9
source

I used to use other JPA implementations, but I used Hibernate for the first time this year. Of course, this is more complicated than others in terms of jar dependencies, but in the Getting Started Guide , in Chapter 1 , in the section Getting Sleep Mode, I found the details that I need and why.

Subsequently, I suffered from problems with hellish problems, and not because I don’t know which banks to use, but because we are in a really big program, and other subprojects have already used older versions of the Hibernate classes, and this caused I had a lot of problems at runtime, and it took me a few days to diagnose and fix.

I think this is still a reality, and tools like Maven or frameworks like OSGi are trying to mitigate this problem.

Perhaps the biggest hope we have is Project Jigsaw , which should become part of JDK 8 in the future and which is trying to solve the problems of Java modularity we currently have. It will be similar to OSGi with steroids and built into the JDK itself.

But before that happens, all I can tell you is the famous quote from Whiston Churchill

If you go through hell, keep going

+1
source

This is one of the problems associated with Grails - by combining a specific set of banners (Spring, Hibernate, etc.). who work together and upgrade these banks as Grails evolves.

0
source

All Articles