-->
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: problem while initializing Session Factory
PostPosted: Tue Jun 21, 2005 8:51 am 
Beginner
Beginner

Joined: Tue Jun 21, 2005 2:21 am
Posts: 22
I'm facing some problem while initializing Session factory

my configuration file has this info
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database Connection Setting -->
<property name="connection.driver_class">org.hsqldb.jdbcDriver </property>
<property name="connection.url">jdbc:hsqldb:data/music</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>

<!-- JDBC Connection Pool -->
<property name="connection.pool_size">1</property>

<!-- SQL Dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="show_sql">true</property>

<!-- Drop and recreate schema on startup -->
<property name="hdm2ddl.auto">create </property>
<mapping resource="Event.hbm.xml" />
</session-factory>

</hibernate-configuration>

my ant target is having this info

<target name ="run" depends="compile" >
<java fork="true" classname="EventManager" classpathref="project.class.path">
<classpath path="${class.root}" />
<arg value="${action}"/>
</java>
</target>


but when try to run this command
$ant run -daction=state i'm facing this problem
[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg
Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Initial Session Factory Creation failed ...org.hibernate.HibernateEx
eption: problem parsing configuration/hibernate.cfg.xml
[java] java.lang.ExceptionInInitializerError

[java] at HibernateUtil.<clinit>(HibernateUtil.java:13)
[java] at EventManager.createAndStore(EventManager.java:15)
[java] at EventManager.main(EventManager.java:9)
[java] Caused by: org.hibernate.HibernateException: problem parsing configu
ation/hibernate.cfg.xml
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
:1173)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
112)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
098)
[java] at HibernateUtil.<clinit>(HibernateUtil.java:10)
[java] ... 2 more
[java] Caused by: org.hibernate.MappingException: invalid configuration
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
:1169)

ca anyone help me in solving this problem


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 3:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try to find out what the complete stack trace is. It seems to be some bug in your cfg.xml file.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 29, 2005 4:57 pm 
Newbie

Joined: Wed Jun 29, 2005 4:51 pm
Posts: 10
Location: Brazil
I´m having the same problem creating a hibernate session factory using the Hibernate Tools plugin 3.0.0.alpha4a through 'Hibernate Console Perspective'.

Here is the complete stack trace:

Code:
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2005-06-29 17:47:26.203
!MESSAGE duplicate import: br.CategoriaDocumento
!STACK 0
org.hibernate.MappingException: duplicate import: br.CategoriaDocumento
   at org.hibernate.cfg.Mappings.addImport(Mappings.java:105)
   at org.hibernate.cfg.HbmBinder.bindPersistentClassCommonValues(HbmBinder.java:541)
   at org.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:488)
   at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:234)
   at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:152)
   at org.hibernate.cfg.Configuration.add(Configuration.java:362)
   at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:400)
   at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
   at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:163)
   at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:129)
   at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:50)
   at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
   at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
   at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
   at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
   at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3070)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2703)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
   at org.eclipse.core.launcher.Main.run(Main.java:973)
   at org.eclipse.core.launcher.Main.main(Main.java:948)[code][/code]

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 29, 2005 5:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you added the mapping file twice probably.

one in cfg.xml and in the list of mapping files.

_________________
Max
Don't forget to rate


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.