-->
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: Can't bind to SessionFactory
PostPosted: Sun Sep 11, 2005 1:54 pm 
Newbie

Joined: Sun Sep 11, 2005 12:16 pm
Posts: 1
3.0:
Oracle 9i:
JBoss_4_0_3_RC1:

I am having some problems getting started with Hibernate. First, I am not sure if my configuration is correct. Second, when I start JBoss, I am not able to find the session object.

I have a hibernate-service.xml and jboss-service.xml file located in the following directory:
C:\jboss403\server\default\deploy\jboss-hibernate.deployer\META-INF

I also have a Test.hbm.xml file to handle the database mapping, but I am just trying to link to my session for now. Once that is working, I will worry about the mapping. Is this the correct placement for these two files, or should I put hibernate-service.xml in C:\jboss403\server\default\deploy? Do I need both hibernate-service.xml and jboss-service.xml in the deployer directory?

Here is my hibernate file:
hibernate-service.xml
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:OracleDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.HSQLDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
</mbean>
</server>

Here is my jboss-service.xml file:
jboss-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<server>
<mbean code="org.jboss.hibernate.har.HARDeployer" name="jboss.har:service=HARDeployer">
<attribute name="ValidateDTDs">false</attribute>
</mbean>
</server>

When I start JBoss, I get the following NameNotFoundException message:

Code:
09:11:52,375 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.naming.NameNotFoundException: SessionFactory not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:701)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at org.apache.jsp.Test_jsp._jspService(org.apache.jsp.Test_jsp:61)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:534)
09:13:14,656 INFO  [STDOUT] Session [339375A223DD5EE5F31D5E3B217CBBE7] has been created.
09:13:14,671 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.naming.NameNotFoundException: hibernate not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
        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:347)
        at org.apache.jsp.Test_jsp._jspService(org.apache.jsp.Test_jsp:61)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:534)


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.