-->
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.  [ 2 posts ] 
Author Message
 Post subject: Unhandled event loop exception (newbie)
PostPosted: Thu Jun 30, 2005 3:51 pm 
Beginner
Beginner

Joined: Fri Mar 04, 2005 7:12 pm
Posts: 34
Am trying to use an Eclipse wizard in a RCP application to create a new record for a persisted entity; the mappings work well and I have verified correct persistence between the POJO and database in unit tests using the code shown below. However, I am trying to put the update action into the performFinish() method of the wizard:

public boolean performFinish() {
//try {
Session session = HibernateUtil.getSession();
HibernateUtil.beginTransaction();
trial = new Trial();
trial.setDccNumber(page.getDccNumberText());
trial.setShortName(page.getShortNameText());
trial.setLongName(page.getLongNameText());
trial.setInvestigator(page.getInvestigatorText());
session.save(trial);
HibernateUtil.commitTransaction();
HibernateUtil.disconnectSession();
//} catch (HibernateException e) {
// TODO Auto-generated catch block
//e.printStackTrace();
/* } catch (InfrastructureException e) {
// TODO Auto-generated catch block
e.printStackTrace();*/
//}
return true;
}

When I uncomment the try-catch portions of this code, the wizard simply fails to initialize, indicating a Hibernate exception. When I comment it as above, the wizard functions until I click the Finish button (which I can click several times as below), which invokes the above code, and the console says:

Unhandled event loop exception
Reason:
org/hibernate/HibernateException
Unhandled event loop exception
Reason:
org/hibernate/HibernateException
Unhandled event loop exception
Reason:
org/hibernate/HibernateException

No errors are posted in the error log, and though I have my logging file set at debug, there is no logging output shown.

I am using the HibernateUtil from the on-line version of the Caveat Emptor application, and it has worked well when I run in Eclipse as a Java application or unit test.

_________________
J. Michael Dean, MD


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 03, 2005 2:58 pm 
Beginner
Beginner

Joined: Fri Mar 04, 2005 7:12 pm
Posts: 34
Have made some minimal progress on this, and the program is failing to launch in the static initializer of my HibernateUtil class, which is nearly verbatim from HIA.

!SESSION 2005-07-03 12:39:59.532 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.5.0_02
java.vendor=Apple Computer, Inc.
BootLoader constants: OS=macosx, ARCH=ppc, WS=carbon, NL=en_US
Framework arguments: -application Utah_Toolbox.application -pdelaunch
Command-line arguments: -application Utah_Toolbox.application -data /Applications/eclipse/runtime-EclipseApplication(4) -dev file:/Applications/eclipse/workspaceRC4/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application (4)/dev.properties -pdelaunch -os macosx -ws carbon -arch ppc

!ENTRY org.eclipse.osgi 2005-07-03 12:40:02.345
!MESSAGE Application error
!STACK 1
java.lang.ExceptionInInitializerError
at edu.utah.cdmcc.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:48)
at edu.utah.cdmcc.application.View.createPartControl(View.java:73)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:305)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:180)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:283)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:512)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:126)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:391)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1102)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1051)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:576)
at org.eclipse.ui.internal.PartStack.createContro
ETC

It is dying in the following code

public class HibernateUtil {

private static Log log = LogFactory.getLog(HibernateUtil.class);

private static Configuration configuration;
private static SessionFactory sessionFactory;
private static final ThreadLocal<Session> threadSession = new ThreadLocal<Session>();
//private static final ThreadLocal<>
private static final ThreadLocal<Transaction> threadTransaction = new ThreadLocal<Transaction>();
private static final ThreadLocal<Interceptor> threadInterceptor = new ThreadLocal<Interceptor>();

// Create the initial SessionFactory from the default configuration files
static {
try {
configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
// We could also let Hibernate bind it to JNDI:
// configuration.configure().buildSessionFactory()
} catch (Throwable ex) {
// We have to catch Throwable, otherwise we will miss
// NoClassDefFoundError and other subclasses of Error
log.error("Building SessionFactory failed.", ex);
throw new ExceptionInInitializerError(ex); //<-- LINE 48
}
}

Unfortunately, I remain very lost - these routines work in the IDE, but not when launched as a plugin. I have added every plugin to the classpath, I think, and need help if possible. Thank you.

_________________
J. Michael Dean, MD


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.