Share on Google+Share on Google+

prajula kottai
Reply to the mail(import files error)
2 Answer(s)      6 years and 6 months ago
Posted in : Hibernate

Hi! Thank you. That error has gone and i have worked out an example, but its giving a null pointer exception as

org.hibernate.MappingException: Error reading resource: contact.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:447) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1381) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1353) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1335) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1302) at org.hibernate.cfg.Configuration.configure(Configuration.java:1230) at org.hibernate.cfg.Configuration.configure(Configuration.java:1216) at roseindia.tutorial.hibernate.Wtc.main(Wtc.java:14) Caused by: org.hibernate.MappingException: duplicate import: roseindia.tutorial.hibernate.Contact at org.hibernate.cfg.Mappings.addImport(Mappings.java:100) at org.hibernate.cfg.HbmBinder.bindPersistentClassCommonValues(HbmBinder.java:538) at org.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:485) at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:231) at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:149) at org.hibernate.cfg.Configuration.add(Configuration.java:358) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395) at org.hibernate.cfg.Configuration.addResource(Configuration.java:444) ... 7 more Exception in thread "main" java.lang.NullPointerException at roseindia.tutorial.hibernate.Wtc.main(Wtc.java:21)

Ads

View Answers

October 19, 2010 at 4:36 PM


Hi,

In the Hibernate application is it necessary to place the contact.hbm.xml file in class path.

So, you can put the contact.hbm.xml in src directory or in bin directory of your eclipse project.

So, just try out both and try to fix the error.

Remember in mind that contact.hbm.xml must be present the classpath.

Thanks



October 19, 2010 at 5:54 PM











Related Tutorials/Questions & Answers:
Reply to the mail(import files error)
Reply to the mail(import files error)  Hi! Thank you. That error has...-to-the-mail(import-files-error).html Thanks... as org.hibernate.MappingException: Error reading resource: contact.hbm.xml
Reply to the mail(import files error)
Reply to the mail(import files error)  Hi Its already there in the bin. If its class path should be set , how can i do dat?   Hi, Wait for 20 minutes. I will send you link to download new project file. You should
Advertisements
Reply to ur mail(Hibernate Error)
Reply to ur mail(Hibernate Error)  Hi! Im using Eclipse. Steps : 1. Downloaded the example code and library from rose india and extracted the content in a directory. 2. Downloaded file contains the Eclipse project. 3. Started
reply to the mail
reply to the mail  Hi! which jar file needed to be added? Thanks   Question not clear
java mail error - JavaMail
java mail error  how to rceive emails using java mail api  Hi Friend, We can use Java Mail APIs to send and receive mails in Java.... Please visit the following link to know more about use of Java Mail API. http
mail
mail  I wrote a program to send mail using smtp. But there is an error message " could not connect to smtp.gmail.com port 465. what is the problem how can i solve it ...   Please visit the following link: Java Mail API
mail
mail  how to send mail using jsp   Please visit the following links: JSP Send Mail Java Mail Tutorials
please solve this error Warning: mail() [function.mail]:
please solve this error Warning: mail() [function.mail]:   please solve this error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing
reply must
reply must  is it critical to do a software job based on games(java) i know core java & advanced java basics only please give me answer
java mail
the working of java mail.plz help me. Reply so on. Thanks, mohit   Hi Friend... Mail API is now open source and you can download the source code and read. If you want to understand the working of Java Mail download the source code from here
Reply - Struts
net.roseindia; import com.opensymphony.xwork2.ActionSupport; import
java mail
(MailClient.java:90) help me clear this error..send suggestions to mail mail...java mail  import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; import java.util.Properties; public class MailClient
Introduction of Java Mail
with attached files. Introduction to Java Mail API... Introduction of Java Mail       In this section we will describe Java Mail examples to be used
Reply Me - Struts
Reply Me  Hi Friends, Please write the code using form element...because i got error in textbox null value  Hi Soniya Would you please explain, in which technology are you creating page? I promise
java mail
java mail  By Which code or function i can send E-mail to given E-mail Address   Hi Friend, Please visit the following link: Java Mail Thanks   Hi Friend, Please visit the following link: Java Mail
java mail
java mail example  how to download javamail software give one examples   Please visit the following link: Java Mail API
java mail
but with reference to apache mail server (james) tutorial i use the link... files are available for downloading and i have downloaded those 4 but afer... to install the AMS (JAMES).These files looks like as they are already installed any
php mail
php mail  how to send the submitted form to mail after 24 hours? pls help me
reply me - Java Beginners
reply me  Hi, user enter vend_id in text box ten open the addform.jsp In the addform.jsp have two button Update and delete... minutes User click update button then give the error plz chk my code what
mail problem
mail problem  Sir, I tried ur send mail example but it giveng follwing error "Could not connect to SMTP host: localhost, port: 25" ,tried sendind...; <title>Mail API</title> </head> <body><table
when sending the mail from java I am getting the below error - JavaMail
when sending the mail from java I am getting the below error   when sending the mail from java I am getting the below error : Exception... not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/mail/mail.jar,file
java mail
java mail  this code showing an error couldn't connect smtp host please help <%@ page language="java" import="javax.naming.*,java.io....(); out.println("Thanks for sending mail!"); } catch(Exception e
Confirmation Mail
Confirmation Mail  hi, i need the code.when we sign up it will send the confirmation mail to the e-mail right.how to do that part.....and also help me whether the AJAX is better or PHP better for the front design
java mail
java mail  how to download javamail software give one examples   Please visit the following link: Java Mail API
Reply Me - Java Beginners
Reply Me  Hi Amardeep I am sending database table name,code and db file please insert this data in this table its very urgent.... My project deadline is very near this code i am using then i got the some error
Reply Me - Java Beginners
Reply Me  Hi, This is not correct url please send me again coorect url
Reply me - Java Beginners
Reply me  Hi,   Hi Ragini please specify main problem. where are problem in your code. Thanks
Reply me soon.........
Reply me soon.........  Any body plzz help.....how to get d checked details from previous page to current page and den insert into table
Reply me - Java Beginners
Reply me  Hi Friends, Quest:- Tell em what is the difference between java and php, dotnet Quest:- what is the similar point of php and java... Please tell me its very urgent
reply - Java Beginners
reply  Hi friends I have a 255 fields i want to insert data in the table please let me know how to insert data in the database please reply me its very urgent
Tutorials   
Java Spring Hibernate Struts Training java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based! org.hibernate.validator cannot be resolved error java.lang.ClassNotFoundException: org.hibernate.cache.TimestampsRegion java.lang.ClassNotFoundException: org.hibernate.cache.TimestampsRegion property hibernate.cache.region.factory_class is not given Hibernate example step by step in Eclipse with MySQL How to make Struts Hibernate and Spring Based Login/Registration Application? What is the use of Hibernate Native SQL? What is the use of Hibernate is used? How to integrate Struts and Hibernate in an application? How to create the program in Java for getting the forgotten Password Form? How to write create JPA Many-to-Many Relationship in Java? What is the DAO Layer in any application? What is Spring Struts Hibernate DAO Layer? How to write Example code for CRUD application in hibernate annotation? Where to update the Hibernate tools? Query conversion convert into hql how to convert sql into hql package org.hibernate.util does not exist C3P0 with Hibernate What do you understand by JPA? Hibernate Query Checker Jpa many to many relationship What do you understand by Hibernate in Java? What are criteria Queries in Hibernate? How to use Associations and Joins in Hibernate? Hibernate 4 Example with Eclipse How to learn Hibernate? What is Hibernate Framework? hibernate faq 15/03/14 hibernate 15/03/2014 Hibernate Criteria Wildcard how to add mulitiple projections this is a hibernate question this is a hibernate question this is a hibernate question how to writw connection pool coding Hibernate 4.3 and JPA 2.1 support How to create Hibernate session factory name? Can you provide me Hibernate configuration tutorial? I want to build sessionfactory in hibernate 4. Need help. I want to learn Hibernate tutorial quickly How to create sessionfactory in Hibernate 4.1.1? How to create sessionfactory in Hibernate 4.1? Hibernate 4.3.0.Final get session How to learn hibernate in 24 hours? hibernate 4.3.0 I want to know how can I create sessionfactory in hibernate 4 (latest version) standard serviceregistrybuilder example

Ads

 
Advertisement null

Ads