-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate name not bound error
PostPosted: Sun Dec 26, 2004 1:33 am 
Newbie

Joined: Sat Dec 25, 2004 11:03 am
Posts: 8
Hibernate version: 21.

Hi i am using .HAR file for Creating SessionFactory:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
<depends>jboss.jca:service=LocalTxCM,name=jdbc/JbpmDS</depends>
<attribute name="SessionFactoryName">java:/HibernateSessionFacotry</attribute> <attribute name="DatasourceName">java:/jdbc/JbpmDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.Oracle9Dialect</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
<attribute name="Hbm2ddlAuto">update</attribute>
</mbean>
</server>
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
It shows in the jmx console under java namespace.
In my code i get that in this way
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Context ctx = new InitialContext();
Object obj = ctx.lookup("java:/HibernateSessionFacotry");
sessionFactory = (SessionFactory)obj;
System.out.println("SessionFactory >>>>>>>>"+sessionFactory);
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Sometime i got that without any error but sometime it gives me following error.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
10:45:26,689 INFO [STDOUT] javax.naming.NameNotFoundException: hibernate not bound
10:45:26,689 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
10:45:26,689 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
10:45:26,689 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
10:45:26,689 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
10:45:26,689 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:529)
10:45:26,689 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
10:45:26,689 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)
10:45:26,689 INFO [STDOUT] at iclaims.testhibernate.actions.HomeAction.execute(HomeAction.java:55)
10:45:26,705 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
10:45:26,705 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
10:45:26,705 INFO [STDOUT] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
10:45:26,705 INFO [STDOUT] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
10:45:26,705 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
10:45:26,705 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
10:45:26,705 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
10:45:26,705 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
10:45:26,705 INFO [STDOUT] at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
10:45:26,705 INFO [STDOUT] at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
10:45:26,705 INFO [STDOUT] at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
10:45:26,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
10:45:26,720 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
10:45:26,720 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
10:45:26,720 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
10:45:26,720 INFO [STDOUT] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
10:45:26,720 INFO [STDOUT] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
10:45:26,720 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
10:45:26,720 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
10:45:26,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
10:45:26,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
10:45:26,720 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
10:45:26,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
10:45:26,720 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
10:45:26,736 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
10:45:26,736 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
10:45:26,736 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
10:45:26,752 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
10:45:26,767 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
10:45:26,767 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
10:45:26,767 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
10:45:26,767 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
10:45:26,767 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
10:45:26,767 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
10:45:44,155 WARN [RequestProcessor] Unhandled Exception thrown: class java.lang.NullPointerException
10:45:44,186 ERROR [Engine] ApplicationDispatcher[/final] Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at iclaims.testhibernate.actions.HomeAction.execute(HomeAction.java:64)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
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.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
10:45:44,186 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at iclaims.testhibernate.actions.HomeAction.execute(HomeAction.java:64)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
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.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

By debugging i got to knoe that when i get initialcontext then it gives this problem.can any one tell me what am i doing wrong.

regards
Puneet


Top
 Profile  
 
 Post subject: Hibernate name not bound error
PostPosted: Wed Feb 02, 2005 11:48 am 
Newbie

Joined: Wed Feb 02, 2005 11:41 am
Posts: 1
Hi,

I've a similar problem.
In my SessionBean I've a method which throws a RemoteException
If I call this method twice - the second time causes an unbinding
of my HibernateFactory.

The next time I want to create a Hibernate - Session, I get a
NameNotFoundException

Did you solve your problem ?


Top
 Profile  
 
 Post subject: Post subject: Hibernate name not bound error
PostPosted: Wed Oct 12, 2005 10:44 am 
Newbie

Joined: Wed Oct 12, 2005 10:25 am
Posts: 1
Hi, i have the same problem and I dind't find an answer yet.
I'm getting the exception when I'm invoking the lookup("") method in the "client". Can anybody help me, plz?!

<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:/DefaultDS</attribute>
<attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="CacheProviderClass">
org.hibernate.cache.HashtableCacheProvider
</attribute>
<!-- <attribute name="Hbm2ddlAuto">create-drop</attribute> -->
</mbean>
</server>

-------------------------------------------------------------------------------------

Hashtable props = new Hashtable();

props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");

InitialContext ctx = new InitialContext(props);
SessionFactory sessionFactory = (SessionFactory) ctx.lookup("java:/hibernate/SessionFactory");


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 5:11 pm 
Newbie

Joined: Mon Apr 18, 2005 5:53 pm
Posts: 6
try to use
<attribute name="SessionFactoryName">hibernate/SessionFactory</attribute>
instead of
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>


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