0

I am a beginner and trying to run first simple code.

Please help me resolve the following issue.

Error on line 11 of document  : The element type "session-factory" must be terminated by the matching end-tag "</session-factory>". 
Nested exception: The element type "session-factory" must be terminated by the matching end-tag "</session-factory>".
        at org.dom4j.io.SAXReader.read(SAXReader.java:482)

config file

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
 <session-factory>
        <property name="connection.driver_class">org.postgresql.Driver</property>
        <property name="connection.url">jdbc:postgresql://localhost:5432/hibernatedb</property>
        <property name="connection.username">postgres</property>
        <property name="connection.password"/>shaher</property>
        <property name="connection.pool_size">1</property>
        <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
        <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
        <property name="show_sql">true</property>
        <property name="hbm2ddl.auto">create</property>
        <mapping class="org.shaher.hiber.dto.UserDetails"/>
 </session-factory>
</hibernate-configuration>

2 Answers 2

1

You need to close the tag <session-factory>

<session-factory>
  ...
</session-factory>
Sign up to request clarification or add additional context in comments.

4 Comments

@shaher So does it work now? If no update your question.
It is not working... closed with </session-factory> </hibernate-configuration>
@shaher Please, update your question with closed tags and add the new stack trace with an error.
@shaher Replace the last </session-factory> with <session-factory> from begin and add / to it.
0

you have problem with your config file see this <property name="connection.password"/>shaher</property>

please update it to below <property name="connection.password">shaher</property>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.