-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate and Quartz - javax.naming.NameNotFoundException: S
PostPosted: Wed Sep 27, 2006 10:52 am 
Newbie

Joined: Wed Sep 27, 2006 10:35 am
Posts: 1
Hi

I'm using Hibernate 3 within JBoss 4.0.3SP1 and SpringMVC. Lately we've added Quartz to our project.

The problem is that when I try creating an hibernate Session object from within my class that implements org.quartz.Job I get the following exception:

javax.naming.NameNotFoundException: SessionFactory not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
at org.jnp.server.NamingServer.lookup(NamingServer.java:255)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.setyx.utils.HibUtils.getHibSession(HibUtils.java:16)
at com.setyx.webserver.services.quartz.QrtzMeetingScheduler.execute(QrtzMeetingScheduler.java:32)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

The thing is that creating Session objects outside Quarts context works just fine (means from my other classes invoked directly in the servlet context), the code I'm using to create the session is:

InitialContext ctx = new InitialContext();
SessionFactory SessionFactory = (SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
Session hibSession = SessionFactory.openSession();
[/i]

Thanks in advance!


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

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.