-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: hibernate migration (Very very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 7:54 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
Am migrating my application from hibernate 2.0 to 3.0 and in my HibernateUtil helper class i have changed all my net.sf into org.hibernate and when i execute i am getting this error.

plz help me.. It s urgent.. I tried like anything for the past four days.. But i don know what is the root cause of the error..

Thanks in advance..

Here is my HibernateUtil java class

package com.wamu.dashboard.security.permission;

import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
import org.hibernate.classic.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import java.net.URL;

public class HibernateHelper {

private static final SessionFactory sessionFactory;

static {
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}

public static final ThreadLocal session = new ThreadLocal();

public static Session getSession() throws HibernateException {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}

public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
}


Here is the error that throws when i execute

<Jan 10, 2007 3:47:14 AM PST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=11524579,name=/,context-path=)] Root cause of ServletException.
java.lang.ExceptionInInitializerError
at com.wamu.dashboard.util.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:43)
at com.wamu.dashboard.util.hibernate.HibernateCommandExecutor.getSession(HibernateCommandExecutor.java:76)
at com.wamu.dashboard.util.hibernate.HibernateCommand.this(HibernateCommand.java:26)
at com.wamu.dashboard.util.hibernate.HibernateCommand.<init>(HibernateCommand.java:31)
at com.wamu.dashboard.security.permission.GetUserTargetedContentCommand.<init>(GetUserTargetedContentCommand.java:30)
at com.wamu.dashboard.security.permission.web.GetUserTargetedContentServlet.myService(GetUserTargetedContentServlet.java:49)
at com.wamu.dashboard.util.web.BaseServlet.service(BaseServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:626)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:412)
at jsp_servlet._admin._hotlinks.__index._jspService(__index.java:276)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6456)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: org.hibernate.HibernateException: Errors in named queries: getHotLinksByPermissionCode
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:300)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at com.wamu.dashboard.util.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:39)
... 25 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 10, 2007 8:00 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 9:53 pm
Posts: 31
Location: Brisbane, Australia
what's line 43?


Top
 Profile  
 
 Post subject: hibernate migration (Very very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 8:05 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
wookie2u wrote:
what's line 43?



static {
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure
().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
line no . 43 throw new ExceptionInInitializerError(ex); }
}


line no 43 is throw new ExceptionInInitializerError(ex);


Top
 Profile  
 
 Post subject: Re: hibernate migration (Very very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 8:11 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
thangadangi wrote:
wookie2u wrote:
what's line 43?


here is my complete HibernateUtil class and the line no 43 is bold... I think its clearer to u.. please help me..

public class HibernateHelper {

private static final SessionFactory sessionFactory;

static {
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
line no:43 throw new ExceptionInInitializerError(ex);
}
}

public static final ThreadLocal session = new ThreadLocal();

public static Session getSession() throws HibernateException {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}

public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
}


Top
 Profile  
 
 Post subject: Re: hibernate migration (Very very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 8:14 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
Please tell me what u r asking..? I dont know what u r asking...?

Sorry for asking again n again.. Its urgent


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 10, 2007 8:27 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 9:53 pm
Posts: 31
Location: Brisbane, Australia
As has been made abundantly clear you previously... Your urgency is your problem, unless of course considerable renumeration is involved, in which case it's still your problem, but you will have my undivided attention, until the money runs out. Now calm down and think for yourself!

Errors in named queries: getHotLinksByPermissionCode

Keith.


Top
 Profile  
 
 Post subject: Migration to Hibernate 3.0(Very Urgent!!!!!!)
PostPosted: Wed Jan 10, 2007 8:51 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
Thanks.. The real error is in the Hotlink.hbm.xml file and its in the named query and it given below

<query name="getHotLinksByPermissionCode"><![CDATA[select link, userTargetedContent.displayName from HotLink link, UserTargetedContent userTargetedContent where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode order by link.userPermissionCode, link.displayName]]></query>

I dont know what change i have make in this query inorder to get working in Hibernate 3.0.

Note:Its working fine in hibernate 2.0


Top
 Profile  
 
 Post subject: Query is not correct?
PostPosted: Wed Jan 10, 2007 10:49 am 
Regular
Regular

Joined: Wed Aug 24, 2005 11:49 am
Posts: 63
It looks like your query is not in the correct syntax.

The last part reads like this:
Code:
... and link.linkUserCode order by ....


Should probably be something like :
Code:
... and link.linkUserCode='somevalue' oder by ...

_________________
Edwin van der Elst
Finalist IT Group


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.