null pointer exception at org.hibernate.tuple.AbstractEntityTuplizer.createProxy
- by saurabh
I am using hibernate 3.2 with struts 1.2 framework
I got this exception when i m trying to load the object
I am using this code to load the object
public Currentprofile findById(java.lang.String id) {
log.debug("getting Currentprofile instance with id: " + id);
try {
Currentprofile instance = (Currentprofile) getSession().get(
"com.hibermappings.Currentprofile", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
my hbm file is this
<one-to-one name="referenceDb" lazy="proxy" class="com.hibermappings.ReferenceDb" cascade="all" constrained="false" />
<one-to-one name="registration" lazy="proxy" class="com.hibermappings.Registration" cascade="all" constrained="false" />
<one-to-one name="jobseekerpackagedetails" lazy="proxy" class="com.hibermappings.Jobseekerpackagedetails" cascade="all" constrained="false" />
<property name="keyWords" type="java.lang.String">
<column name="keyWords" length="5000" />
</property>
<property name="totalExp" type="java.lang.String">
<column name="totalExp" length="100" />
</property>
<property name="hqualification" type="java.lang.String">
<column name="hQualification" length="100" />
</property>
<property name="preferedLocation" type="java.lang.String">
<column name="preferedLocation" length="100" />
</property>
<property name="functionalArea" type="java.lang.String">
<column name="functionalArea" length="1000" />
</property>
<property name="expSalary" type="java.lang.String">
<column name="expSalary" length="100" />
</property>
<property name="designation" type="java.lang.String">
<column name="designation" length="100" />
</property>
<property name="resumeTitle" type="java.lang.String">
<column name="resumeTitle" length="500" />
</property>
<property name="profileDetails" type="java.lang.String">
<column name="profileDetails" length="65535" />
</property>
<property name="requiredProfile" type="java.lang.String">
<column name="requiredProfile" length="65535" />
</property>
<property name="activatedOn" type="java.util.Date">
<column name="activatedOn" length="0" />
</property>
<set name="resumes" inverse="true" cascade="save-update">
<key>
<column name="jobseekerId" length="50" />
</key>
<one-to-many class="com.hibermappings.Resume" />
</set>
</class>
the same code runs well when I m using in a simple java class within main method ..
full stack trace of exception is
java.lang.NullPointerException
at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372)
at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:781)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:774)
at com.DAOs.CurrentprofileDAO.getLoad(CurrentprofileDAO.java:71)
at com.action.JobSekeerManage.viewProfile(JobSekeerManage.java:447)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.filter.HibernateFilter.doFilter(HibernateFilter.java:24)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Error::null