Friday, July 14, 2006

Sometimes the Cutting Edge Hurts

I got lazy writing to work today.  The reason I didn't get it to work before was that I got frustrated with the meaningless error messages that I got while working with Hibernate.  It turns out that I was getting an error because an exception that was trying to be thrown couldn't be found.  Hibernate didn't include a necessary library with their deployment.  So, I got the latest stable version of ehcache.jar from the EHCache project and put it in my classpath.  However, when it tried to instantiate the exception, it found that it did not have access, so it threw another error.  It turns out that I needed version 1.2.1.RC1 instead of 1.2.0 (which was the more stable one).  After this I discovered that I was trying to instantiate an EntityManagerFactory that was reliant on JTA, which requires JEE, while in JSE mode.  I had to create a Map to change the properties so I could create the proper entity management objects.

I'm not sure if this lazy writing is any good, since it create a new factory every time.  Perhaps I'll create it as a singleton, but I'll profile it first to see how long it takes.


0 Comments:

Post a Comment

<< Home