-->
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: please help me solve the problem
PostPosted: Sat Apr 28, 2012 12:08 am 
Newbie

Joined: Sat Apr 28, 2012 12:03 am
Posts: 3
2012-4-28 11:17:59 org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
2012-4-28 11:17:59 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.2.Final}
2012-4-28 11:17:59 org.hibernate.cfg.Environment <clinit>
INFO: HHH000205: Loaded properties from resource hibernate.properties: {hibernate.c3p0.timeout=1800, hibernate.connection.driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver, hibernate.c3p0.max_statements=50, hibernate.dialect=org.hibernate.dialect.SQLServerDialect, hibernate.c3p0.max_size=20, hibernate.c3p0.min_size=5, hibernate.connection.username=sa, hibernate.connection.url=jdbc:sqlserver://localhost:1433;DatabaseName=stu_sys, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****}
2012-4-28 11:17:59 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
2012-4-28 11:17:59 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
2012-4-28 11:17:59 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
Exception in thread "main" org.hibernate.MappingException: invalid configuration
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2009)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1926)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1905)
at DAO.gradeManager.main(gradeManager.java:14)
Caused by: org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:250)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2006)
... 3 more


Top
 Profile  
 
 Post subject: Re: please help me solve the problem
PostPosted: Mon Apr 30, 2012 1:06 am 
Newbie

Joined: Sat Apr 28, 2012 2:48 pm
Posts: 6
Hi please Tell us which you have in this problem.

_________________
designer sunglasses


Top
 Profile  
 
 Post subject: Re: please help me solve the problem
PostPosted: Tue May 01, 2012 5:29 am 
Newbie

Joined: Sat Apr 28, 2012 12:03 am
Posts: 3
sam01 wrote:
Hi please Tell us which you have in this problem.


OK,this is the first time i use Hibernate.i just want to use it to Connect the DB(SQL Server 2005) and select something from a table-grade_table.i also code to test it.
all things have bean done,but when i run the program the console always show me the problems above.i donnt know what's wrong with it.


Top
 Profile  
 
 Post subject: Re: please help me solve the problem
PostPosted: Tue May 01, 2012 5:32 am 
Newbie

Joined: Sat Apr 28, 2012 12:03 am
Posts: 3
this is my hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>

<hibernate-configuration
        xmlns="http://www.hibernate.org/xsd/hibernate-configuration"
        xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-configuration hibernate-configuration-4.0.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <session-factory>
    <!-- Database connection settings -->
    <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
    <property name="connection.url">jdbc:sqlserver://localhost:1433;DatabaseName=stu_sys</property>
    <property name="connection.username">sa</property>
    <property name="connection.password">123456</property>

    <!-- JDBC connection pool (use the built-in) -->
    <property name="connection.pool_size">1</property>

    <!-- SQL dialect -->
    <property name="dialect">org.hibernate.dialect.SQLServer2005Dialect</property>

    <!-- Enable Hibernate's automatic session context management -->
    <property name="current_session_context_class">thread</property>

    <!-- Disable the second-level cache  -->
    <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>

    <!-- Echo all executed SQL to stdout -->
    <property name="show_sql">true</property>

    <!-- Drop and re-create the database schema on startup -->
    <property name="hbm2ddl.auto">update</property>
    <mapping resource="DAO/grade.hbm.xml"/>
  </session-factory>
</hibernate-configuration>


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.