When you get this Error "error while initializing hibernate: An AnnotationConfiguration instance is required to use
"
This error comes when we are using annotation instead of hibernate mapping xml file to create the table.
First check to make sure these two packages are importes
[java]import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;[/java]
And check the mapping class="filename.java" is correctly assigned in struts-config.xml
After checking these Go to your hibernate file where you are going to build the sessionFactory
And change the "Configuration configuration=null;
configuration = new Configuration().configure(configFileURL);" To
"AnnotationConfiguration configuration=null;
configuration = new AnnotationConfiguration().configure(configFileURL);" where configFileUrl assigns the path of hibernate.cfg.xml file and then you can build the sessionFactory.Any doubts ask us.
Happy coding.