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!
|
|