-->
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: Deploment problem with JBoss (the dialect was not set)
PostPosted: Sun Feb 29, 2004 4:46 am 
Newbie

Joined: Wed Oct 22, 2003 5:24 am
Posts: 5
hi

i tried to implement an example to integrate hibernate with jboss.
i always get an exception message after this statement:

    Configuration cfg = new Configuration();
error message:
    net.sf.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.

i see the service in the cmx-console and that the dialect is set?!

any ideas, where i missed something
regards pascal

here the hibernate-service.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <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=DefaultDS</depends>
    <classpath codebase="C:\Programme\jboss-3.2.3\server\hibernate\deploy\lib\hibernate2.jar"
    lib="C:\Programme\jboss-3.2.3\server\hibernate\deploy\hibernate.jar"/>
    <attribute name="CacheProvider">net.sf.ehcache.hibernate.Provider</attribute>

    <!-- Make it deploy ONLY after DataSource had been started -->
    <attribute name="MapResources">hibernate/Kunde.hbm.xml</attribute>
    <attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
    <attribute name="Datasource">java:/DefaultDS</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>


and the lookup, that seems to work:
[list] Context ctx;
try
{
ctx = new InitialContext();
factory = (SessionFactory) ctx.lookup("java:/hibernate/HibernateFactory");
} catch (NamingException e)
{
e.printStackTrace();
}[/list


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 29, 2004 8:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
If you are running hibernate via JMX, you do NOT need to create your own Configuration. The MBean does that. Simply obtain the SessionFactory via JNDI.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 29, 2004 11:54 am 
Newbie

Joined: Wed Oct 22, 2003 5:24 am
Posts: 5
hi Gavin

thanx that was the point. but how can i get the configuration for the SchemaExport?

    Configuration cfg = new Configuration();
    new SchemaExport(cfg).create(false, true);


..or is a SchemaExport not possible in an EJB?

regards pascal


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 29, 2004 12:29 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Create a configuration.properties file that you use just for the SchemaExport.


Sherman


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.