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

  • Home
  • SEARCH
  • 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 7962611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:23:11+00:00 2026-06-04T05:23:11+00:00

I have a problem with my school project. Im using hibernate,jsp and maven for

  • 0

I have a problem with my school project. Im using hibernate,jsp and maven for dependency management. Hibernate and maven works fine but when I try to make a simple jsp page with login screen. Its not working. I think problem is with maven and how he works with project structure, because if I make test class everything working. Im not able to find anything about how maven works with webapps.

Sorry for my mistakes in english :).

my project structure:

├── src
│   └── main
│       ├── java
│       │    │
│       │    pro3
│       │     ├── model
│       │     │   ├── dao
│       │     │   │   ├── DaoInterface.java
│       │     │   │   └── HibernateDao.java
│       │     │   ├── hibernate
│       │     │   │   ├── hibernate.cfg.xml
│       │     │   │   ├── hibernate.reveng.xml
│       │     │   │   ├── HibernateUtil.java
│       │     │   │   ├── mapping
│       │     │   │   │   ├── Meal.hbm.xml
│       │     │   │   │   ├── ...
│       │     │   │   │   
│       │     │   │   └── Test.java
│       │     │   └── pojo
│       │     │       ├── Meal.java
│       │     │       ├── ...
│       │     │      
│       │     │      
│       │     └── utils
│       │         └── LoginHandler.java
│       └── webapp
│           └── index.jsp

Index.jsp:

<jsp:useBean id="login" scope="page" class="cz.fim.pro3.utils.LoginHandler" />
...
login.verifyUser(request.getParameter("userName"), request.getParameter("password"));

LoginHandler.java:

public class LoginHandler {
    DaoInterface dao = new HibernateDao();


    public boolean verifyUser(String userName,String password){
        return dao.verifyUser(userName, password);
    }
}

HibernateDao.java:

public boolean verifyUser(String userName, String password)

In my test class everything works fine, when I run it as java application.

Test:

public static void main(String[] args) {
    new Test();
    LoginHandler login = new LoginHandler();
    login.verifyUser("sdf", "asda");
}

pom.xml:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                    </manifest>
                </archive>
                <webResources>
                    <resource>
                        <!-- this is relative to the pom.xml directory -->
                        <directory>src/main/webapp</directory>
                        <targetPath>/</targetPath>
                        <!-- enable filtering -->
                        <filtering>false</filtering>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.7</source>
                <target> 1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<packaging>war</packaging>

error trace:

Stacktrace:] with root cause
java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/Session;
    at cz.fim.pro3.model.dao.HibernateDao.verifyUser(HibernateDao.java:11)
    at cz.fim.pro3.utils.LoginHandler.verifyUser(LoginHandler.java:11)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:83)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
  • 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-04T05:23:12+00:00Added an answer on June 4, 2026 at 5:23 am

    The first thing i can recommend is to change the locations of your files, cause in Maven you have to follow some conventions:

    The Java files should be put into src/main/java plus the appropriate package name.
    The hibernate.cfg.xml file and the hibernate.reveng.xml do NOT belong to src/main/java they have to be located into src/main/resources plus the appropriate package name you like to put them into. Furthermore in hibernate the mapping should be handled by annotations and not by hbm files anymore. But if you have to stuck with the mappings files they have to be put into src/main/resources as well.

    If you have some kind of tests (usually unit tests) like Test.java they have to be put into src/test/java any kind of resources which belong to the unit tests only have to be put into src/test/resources plus the appropriate package name.
    The jsp file have been located correctly into src/main/webapp.

    Apart from the above you have to call the correct method in your HibernateDao.java line 11 where you are trying to call a method openSession which obviously does not exists.

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

Sidebar

Related Questions

I have problem with base classes in WPF. I try to make a base
greeting all i am working on school project and i have a problem with
I'm currently working on a school project in Eclipse (We have just started using
I'm currently working on a school (matrix multiplier) project and I have a problem.
I have to to game for my school project. I have a little problem
for a project for school I have decided to solve a problem by coding
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem getting the dropdown menu to work using Twitter's Bootstrap. Here's my
I'm doing a school project about maintaining a personal Database. but my tutors didn't
I'm nearing the end of a school project with programming in Xcode, but right

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.