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 6021961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:47:23+00:00 2026-05-23T03:47:23+00:00

I have an AuthorizationServlet which is called when user click button in login page.

  • 0

I have an AuthorizationServlet which is called when user click button in login page. Here is a piece of code of servlet’s doPost method:

        AuthorizationBean bean = new AuthorizationBean();
        String login = (String) request.getSession().getAttribute("login");
        String password = (String) request.getSession().getAttribute("password");
        try {
            UserType type = bean.getRoleOfUser(login, password);
            switch(type) {
                ...
            }
        } catch (DaoException ex) {
            throw new ServletException(ex.getMessage());
        }

I have omited some code, because it is doesn’t apply the problem. Actually, DaoException can be thrown only in this line UserType type = bean.getRoleOfUser(login, password);
In method getRoleOfUser I do the connection to the database using tomcat’s connection pool(Description of how I get the connection is in the first post here)

Also here is my context.xml which creates the resource of db connection:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/Project">
    <Resource name="jdbc/Project" auth="Container"
        type="javax.sql.DataSource" maxActive="100"
        maxIdle="30" maxWait="10000"
        username="name"
        password="password"
        driverClassName="oracle.jdbc.driver.OracleDriver"
        url="jdbc:oracle:thin:@127.0.0.1:1521:XE"/>
</Context>

When the AuthorizationServlet is called I get such error:

javax.servlet.ServletException: Error instantiating servlet class com.tspp.common.AuthorizationServlet
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
    org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
    java.lang.Thread.run(Thread.java:662)
root cause

java.lang.NoClassDefFoundError: com/tspp/dao/exceptions/DaoException
    java.lang.Class.getDeclaredConstructors0(Native Method)
    java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    java.lang.Class.getConstructor0(Class.java:2699)
    java.lang.Class.newInstance0(Class.java:326)
    java.lang.Class.newInstance(Class.java:308)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
    org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
    java.lang.Thread.run(Thread.java:662)
root cause

java.lang.ClassNotFoundException: com.tspp.dao.exceptions.DaoException
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    java.lang.Class.getDeclaredConstructors0(Native Method)
    java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    java.lang.Class.getConstructor0(Class.java:2699)
    java.lang.Class.newInstance0(Class.java:326)
    java.lang.Class.newInstance(Class.java:308)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
    org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
    java.lang.Thread.run(Thread.java:662)

I have tried to debug it, but the debugger even didn’t get to the servlets doPost method.
Actually last 2 exceptions are thrown when I start the program(before the servlet activation)

How can I solve this problem?

  • 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-05-23T03:47:23+00:00Added an answer on May 23, 2026 at 3:47 am

    Make sure you have all your classes in WEB-INF/classes

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

Sidebar

Related Questions

I have a login.jsp page which contains a login form. Once logged in the
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have a look at the menus on this page: http://www.pieterdedecker.be/labs/vspwpg/?page_id=96 They look okay in
I have a snippet to create a 'Like' button for our news site: <iframe
i have a input tag which is non editable, but some times i need
Have following Java code,that creates StringBuilder with \n,i.e. carriage return delimiters: while (scanner.hasNextLine()){ sb.append(scanner.nextLine()).append(\n);
Have the following code. The height is variable so the height of the floating
Have such a problem, hope you'll help me.. Can't find anywhere. Here is the
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()

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.