-->
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.  [ 3 posts ] 
Author Message
 Post subject: null sessionFactory
PostPosted: Sun Apr 04, 2004 4:42 am 
Newbie

Joined: Sun Apr 04, 2004 4:29 am
Posts: 2
I'm using jboss 3.2.3 and hibernate 2.1.2, the deploy it's ok... at least it's what jboss says, the problem is in the client. when i make the lookup the sessionFactory comes null, any ideas??

Thanks, Aldo.

Code:
   public static void main (String[]args){
      try {
         System.setProperty( "java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
         System.setProperty( "java.naming.provider.url","jnp://localhost:1099");
         System.setProperty( "java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
         Context ctx = new InitialContext( );
         SessionFactory sessionFactory= (SessionFactory)ctx.lookup("HibernateFactory");
       }
       catch (Exception ex) {
       System.out.println(ex.getMessage());
       }
   }


Code:
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
    <depends>jboss.jca:service=RARDeployer</depends>
    <depends>jboss.jca:service=LocalTxCM,name=prueba</depends>
    <!-- Make it deploy ONLY after DataSource had been started -->
    <attribute name="MapResources">mappings/prueba.hbm.xml</attribute>
    <attribute name="JndiName">HibernateFactory</attribute>
    <attribute name="Datasource">java:/prueba</attribute>
    <attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
    <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
    <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
    <attribute name="UseOuterJoin">false</attribute>
    <attribute name="ShowSql">false</attribute>
    <attribute name="UserTransactionName">UserTransaction</attribute>
</mbean>
</server>


Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
   PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
       
<hibernate-mapping>
        <class name="Prueba" table="prueba" >
         <id name="id" type="int" column="id" unsaved-value="null">
            <generator class="identity"/>
         </id>
           <property name="nombre" type="java.lang.String" column="nombre" not-null="true"/>
        </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 04, 2004 4:49 am 
Newbie

Joined: Sun Apr 04, 2004 4:29 am
Posts: 2
i forgot to say that i get this message:

04-abr-2004 5:47:53 net.sf.hibernate.impl.SessionFactoryObjectFactory getInstance
ADVERTENCIA: Not found: 40289681fbb491b800fbb49e8f860001

Aldo


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 05, 2004 7:46 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Are you using SessionFActory from the client side.
Don't, SessionFactory has to be used on the side having the JTA manager, the conenction pool etc...

_________________
Emmanuel


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