SUJAN SHRESTHA
SUJAN SHRESTHA

Reputation: 1

Hibernate Mapping using maven || Eclipse IDE

I was trying to do mapping while creating a project.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.hibernate.Student" table="StudentInfo">
    
    <id name="sno" column="sno"/><!-- Primary Key -->
    <property name="sname" column="studentname"/>
    <property name="marks" column="marks"/>
    </class>
</hibernate-mapping>

This is how my code looks. I will write the error line by line.

When I type until this:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

Until here, it does not show any error.

Once I start writing:

<hibernate-mapping>
.......
</hibernate-mapping>

then it starts giving me error.

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

In the above line of code, the error shows in https://hibernate........ Given error:

Error while downloading 'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd' to 'C:
 \Users\raju4\.lemminx\cache\http\hibernate.sourceforge.net\hibernate-mapping-3.0.dtd' : 
 '[java.io.FileNotFoundException] http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd with code: 404 Not 
 Found'.
- Element type "hibernate-mapping" must be declared.
- Element type "class" must be declared.
- Element type "id" must be declared.
- Element type "property" must be declared.

I have already enable downloading from Maven.

I am trying to get rid of error and develop the project.

Upvotes: 0

Views: 27

Answers (0)

Related Questions