Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:20:48+00:00 2026-06-03T10:20:48+00:00

I want to create a simple web project app. I am using struts2 and

  • 0

I want to create a simple web project app. I am using struts2 and hibernate and I am new to both of this frameworks and I am getting this error:

Unable to instantiate Action, org.project.actions.UserAction,  defined for 'saveUser' in namespace '/'An AnnotationConfiguration instance is required to use 
    com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:306)
    com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:387)
    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
    org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
    com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
    org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)

root cause

org.hibernate.MappingException: An AnnotationConfiguration instance is required to use 
    org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1634)
    org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
    org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
    org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
    org.project.actions.UserAction.(UserAction.java:23)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    java.lang.Class.newInstance0(Unknown Source)
    java.lang.Class.newInstance(Unknown Source)
    com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:119)
    com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
    com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
    com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)
    com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:287)
    com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:387)
    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
    org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
    com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
    org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)

I have tried to use AnnotationConfiguration() to create SessionFactory, but the same error occurs. Please help. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:20:49+00:00Added an answer on June 3, 2026 at 10:20 am

    It was my silly mistake. I was using Full Hibernate Plugin. When you use this plugin you don’t have to create SessionFactory object for Session object. My mistake was that I forgot to delete SessionFactory object and Session object. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple web project using Tomcat in Java. In the
I want to create an extremely simple web server for development purposes in Ruby
help out a noob with a simple web development question?? I want to create
I want to create a simple transaction on my Web Site where after the
I have created a simple web browser using c# and I want to block
I have created a simple web-service using Java. i want to load jars related
JavaScript. I want to create simple script, that will be resize loaded image using
just simple question, recently i have setup a web server to build project using
This is pretty simple and straightforward. I want to throw a 503 error from
I want to create a simple bash script to launch a Java program on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.