- This topic has 3 replies, 2 voices, and was last updated 15 years, 11 months ago by Loyal Water.
-
AuthorPosts
-
gowgowMemberThis post refers to the following hibernate tutorial:
http://www.myeclipseide.com/documentation/quickstarts/hibernate/Hello, I believe I followed the HIbernate demo closely, but I had 2 different issues:
1. When I first ran the project, it complained about log4j not being set up propertly. To fix, I needed to create a log4j.xml file within the src folder.
log4j.xml:
<?xml version=”1.0″ encoding=”UTF-8″?><!DOCTYPE log4j:configuration SYSTEM “log4j.dtd” >
<log4j:configuration>
<appender name=”stdout” class=”org.apache.log4j.ConsoleAppender”>
<layout class=”org.apache.log4j.PatternLayout”>
<param name=”ConversionPattern” value=”%d{ABSOLUTE} %5p %c{1}:%L – %m%n”/>
</layout>
</appender>
<root>
<priority value=”debug”></priority>
<appender-ref ref=”stdout”/>
</root>
</log4j:configuration>The second (stranger) problem is that when I would run the application, I’d get a NullPointerException. I tracked the problem down to the
getSession method of the BaseHibernateDAO class. When it was generated, this method was set to return null with a comment “FIXME: Implement this method”.Here is the corrected method:
public Session getSession() {
//FIXME: Implement this method
//return null;
return HibernateSessionFactory.getSession();
}Why was this BaseHibernateDAO class generated in this manner?
It’s working fine now, but what gives?? Did I do something wrong that caused both of these problem to happen? It wasn’t very difficult to track down and fix these issues, but I still think the example should just work without having to make any fixes first.
Other than these issues, it’s a very very good tutorial.
Loyal WaterMembergowgow,
Im sorry you ran into this issue. This is a known issue that has already been filed for the dev team and we will fix this asap.
gowgowMemberThanks for your reply. Can I ask for another favor? The blue background in this forum is unnecessary. It’s too much color. I understand that the intent is to have the forum match
the myeclipse website, but it’s just not appropriate for a forum and makes the messages difficult to read. My suggestion would be to display the messages using black text on a white background and you can keep everything else the same. Just my opinion, but I’m sure I’m not the only one who thinks this.
Loyal WaterMemberThank you for your feedback. I’ll make a note of this request as well.
-
AuthorPosts