-->
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.  [ 5 posts ] 
Author Message
 Post subject: Jndi name error? HibernateFactory not bound.
PostPosted: Thu Sep 15, 2005 2:29 am 
Newbie

Joined: Tue Sep 06, 2005 4:12 am
Posts: 16
    [list=][/list][quote][/quote][/i]


    Top
     Profile  
     
     Post subject: Question not understood
    PostPosted: Fri Sep 16, 2005 10:11 am 
    Newbie

    Joined: Fri Sep 16, 2005 8:02 am
    Posts: 2
    Can you please describe your problem with a little more details?


    Top
     Profile  
     
     Post subject:
    PostPosted: Mon Sep 19, 2005 9:48 am 
    Hibernate Team
    Hibernate Team

    Joined: Tue Aug 26, 2003 3:00 pm
    Posts: 1816
    Location: Austin, TX
    ;)


    Top
     Profile  
     
     Post subject:
    PostPosted: Mon Sep 19, 2005 11:54 pm 
    Newbie

    Joined: Tue Sep 06, 2005 4:12 am
    Posts: 16
    Hi all,

    I get error "javax.naming.NameNotFoundException: HibernateFactory not bound" when run to this statement:
    Code:
       Properties env = new Properties();
       env.put(Context.INITIAL_CONTEXT_FACTORY,
             "org.jnp.interfaces.NamingContextFactory");
       env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
       InitialContext ctx = new InitialContext(env);
       SessionFactory sessionFactory = (SessionFactory)ctx.lookup("java:HibernateFactory");

    But when I deploy jboss-service.xml, JBoss console gave me feedback:
    Code:
    ...
    12:59:44,351 INFO  [SessionFactoryImpl] building session factory
    12:59:44,351 WARN  [Configurator] No configuration found. Configuring ehcache fr
    om ehcache-failsafe.xml found in the classpath: jar:file:/C:/jboss-4.0.2/server/
    default/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
    12:59:44,382 INFO  [SessionFactoryObjectFactory] Factory name: java:HibernateFac
    tory
    12:59:44,382 INFO  [NamingHelper] JNDI InitialContext properties:{}
    12:59:44,382 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: jav
    a:HibernateFactory
    12:59:44,382 WARN  [SessionFactoryObjectFactory] InitialContext did not implemen
    t EventContext
    12:59:44,382 INFO  [NamingHelper] JNDI InitialContext properties:{}
    12:59:44,398 INFO  [SessionFactoryImpl] Checking 0 named queries

    It seems for me that the service is started already.

    I tried it in a two tier environment only. That means I just lookup the context outside the EJB Container. Isn't it wrong operation?

    Thank you very much.

    --
    Best regards,
    Diviner.


    Top
     Profile  
     
     Post subject:
    PostPosted: Mon Oct 17, 2005 4:25 pm 
    Newbie

    Joined: Mon Apr 18, 2005 5:53 pm
    Posts: 6
    I had the same problem and solved by changing the JNDI service name:

    here is my jboss-service.xml
    <server>

    <mbean code="org.hibernate.jmx.HibernateService"
    name="jboss.jca:service=HibernateFactory,name=HibernateFactory">

    <!-- Required services -->
    <depends>jboss.jca:service=RARDeployer</depends>
    <depends>jboss.jca:service=LocalTxCM,name=InformixDS</depends>

    <!-- Bind the Hibernate service to JNDI -->
    <attribute name="JndiName">hibernate/SessionFactory</attribute>

    <!-- Datasource settings -->
    <attribute name="Datasource">java:InformixDS</attribute>
    <attribute name="Dialect">org.hibernate.dialect.InformixDialect</attribute>

    <!-- Transaction integration -->
    <attribute name="TransactionStrategy">
    org.hibernate.transaction.JDBCTransactionFactory
    <!-- org.hibernate.transaction.JTATransactionFactory -->

    </attribute>
    <attribute name="TransactionManagerLookupStrategy">
    org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
    <attribute name="FlushBeforeCompletionEnabled">true</attribute>
    <attribute name="AutoCloseSessionEnabled">true</attribute>

    <!-- Fetching options -->
    <attribute name="MaximumFetchDepth">5</attribute>

    <!-- Second-level caching -->
    <attribute name="SecondLevelCacheEnabled">true</attribute>
    <attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
    <attribute name="QueryCacheEnabled">true</attribute>

    <!-- Logging -->
    <attribute name="ShowSqlEnabled">false</attribute>

    <!-- Mapping files -->
    <attribute name="MapResources">imb/logix/database/vdp/Cliente.hbm.xml</attribute>
    </mbean>

    </server>


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