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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:11:28+00:00 2026-05-23T20:11:28+00:00

when I try to run my project on Jetty I get this exception: java.lang.ClassNotFoundException:

  • 0

when I try to run my project on Jetty I get this exception:

java.lang.ClassNotFoundException: Default

The full stack:

Launching Jetty with port 8080, context / and webapp path src/main/webapp
2011-07-19 16:49:56.832:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2011-07-19 16:49:56.841:INFO::jetty-6.1.26
2011-07-19 16:49:57.181:WARN::EXCEPTION 
java.lang.ClassNotFoundException: Default
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:401)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
    at org.mortbay.util.Loader.loadClass(Loader.java:91)
    at org.mortbay.util.Loader.loadClass(Loader.java:71)
    at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:736)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:224)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at   net.sourceforge.eclipsejetty.launch.JettyLauncherMain.launch(JettyLauncherMain.java:67)
at     net.sourceforge.eclipsejetty.launch.JettyLauncherMain.main(JettyLauncherMain.java:50)
2011-07-19 16:49:57.184:INFO:/:Unavailable javax.servlet.UnavailableException: Default
2011-07-19 16:49:57.185:WARN::failed Default: java.lang.NullPointerException
2011-07-19 16:49:57.283:WARN::Failed startup of context     org.mortbay.jetty.webapp.WebAppContext@5f1eb199{/,src/main/webapp}
java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(Native Method)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:736)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:224)
   at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
   at     net.sourceforge.eclipsejetty.launch.JettyLauncherMain.launch(JettyLauncherMain.java:67)
at  net.sourceforge.eclipsejetty.launch.JettyLauncherMain.main(JettyLauncherMain.java:50)
2011-07-19 16:49:57.294:INFO::Started SocketConnector@0.0.0.0:8080

I says that it cannot load my class Default.java (the only class in my project).

Here is my structure (UPDATED):

enter image description here

And I deploy my project using the Jetty plugin.
To run it, I right click my project and select Debug As-> Debug Configurations… and I select the one that is setup below:

enter image description here

Here is also my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-   app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>ServletWeb-Test</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description></description>
    <display-name>Default</display-name>
    <servlet-name>Default</servlet-name>
    <servlet-class>Default</servlet-class>
  </servlet>
<servlet-mapping>
   <servlet-name>Default</servlet-name>
   <url-pattern>/Default</url-pattern>
</servlet-mapping>

I am running out of idea and I can’t find why I get this error.
I someone could help me, I would gladly appreciate it!

  • 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-23T20:11:29+00:00Added an answer on May 23, 2026 at 8:11 pm

    You want to put your Java class files in src/main/java, not src/main/resources. Files in resources are not compiled, as they are not supposed to be source code. Generally you’d put xml descriptor files, image files, etc in resources.

    The content of src/main/resources will be copied into your target folder when eclipse/maven will build your project.

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

Sidebar

Related Questions

Whenever i try to run sqlmetal, i get this: 'sqlmetal' is not recognized as
When I try to run a Silverlight project in Visual Studios 2008 I get
When i try to run jetty maven plugin(mvn jetty:run) I have received this error:
When I try to run my project (made with cakephp framework), I receive this
I try to run one program in myeclipse where after creating one web project
whenever I try to run something in Java, Eclipse changes into the PHP perspective.
When I try to run the following, I get an error back from ActiveRecord
We have our project build using maven. We try to run our unit test
When I try to run my project on LG Android Mobile then there is
got error when i try to run WebService in Debug this error: error while

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.