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

The Archive Base Latest Questions

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

I am a university student working on a research project that involves migrating a

  • 0

I am a university student working on a research project that involves migrating a web application to Amazon’s cloud. I spent the last semester working with servlets and was able to get the majority of the app’s functionality working using a java servlet running in Tomcat.

I am now trying to integrate Amazon Web Services such as the SimpleDB and E-mail service. I develop using the Eclipse Java EE for Web Developers Indigo IDE. I have the AWS plugin installed and am able to run sample code that Amazon provides to call SDB and SES successfully.

However when I attempt to call a service like simpleDB from the servlet either directly or through a separate class I receive the following error:

HTTP Status 500 –

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class
org.comtor.cloud.api.APIservlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:680) root cause

java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials
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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:680) root cause

java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentials
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:680) note The full stack trace of
the root cause is available in the Apache Tomcat/7.0.23 logs.

Apache Tomcat/7.0.23

My code looks like this:

package org.comtor.cloud.api;

import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;

import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.simpledb.AmazonSimpleDBClient;
import com.amazonaws.services.simpledb.model.CreateDomainRequest;

import java.io.IOException;

@SuppressWarnings("serial")
public class APIservlet extends HttpServlet {
  public void doGet (HttpServletRequest request,
                     HttpServletResponse response)
    throws ServletException, IOException
  {
      doPost(request, response);
  }
  public void doPost(HttpServletRequest request,
          HttpServletResponse response)
                  throws ServletException, IOException {
        PrintWriter out = response.getWriter();

        // AWS Credentials
        String sAccessKey = "myAccessKey";
        String sSecretKey = "mySecretKey";

        // Authenticate AWS account
        BasicAWSCredentials oAWSCredentials = new BasicAWSCredentials(sAccessKey, sSecretKey);
        AmazonSimpleDBClient awsSimpleDBClient = new AmazonSimpleDBClient(oAWSCredentials);

        // Try to access simpleDB
        try 
        {
            System.out.println("Connecting to Simple Database");
            // Create a domain
            String myDomain = "MyStore";
            System.out.println("Creating domain called " + myDomain + ".\n");
            awsSimpleDBClient.createDomain(new CreateDomainRequest(myDomain));
            System.out.println("Connection Made");

        } 
        // Print Error Stack Trace
        catch (NoSuchAlgorithmException e) 
        {
            e.printStackTrace();
        }

        // Close PrintWriter
        out.close();
  }
}

** Access & Secret Keys removed from code **

The same goes for SES. I have also tried using a java library like ‘typica’ and still receive a NoClassDef error. I have the AWS library in my build path under the libraries folder and the jar package / classes seem to be there. So I am unsure why I am unable to use these classes to interact with simpleDB from my servlet.

I’d greatly appreciate any help on this matter. I believe I am not fully understanding how to call AWS SDB from a web environment.

Thank you.

  • 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-28T07:10:12+00:00Added an answer on May 28, 2026 at 7:10 am

    java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentials indicates that this class is not on your classpath. Make sure that the jar containing the com.amazonaws.auth.AWSCredentials class is included in your web application’s WEB-INF/lib folder.

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

Sidebar

Related Questions

I'm about to start working on a rich-internet-application project for a student organization at
I'm an University student and new to java. Last year, second semester we did
I am a university student. I have been working a lot with Android lately
While I was working on an University project, I used a project-internal profiler made
I'm working on a group project for my University which is going to be
I am a student in my fourth year in university. My graduation project is
I'm an undergraduate university student who also writes iPhone applications. Next year I'm expected
I currently am a student worker at a medium sized university. i work for
I'm teaching Java EE at the university, and this was a question a student
I am updating an application I've written used by my employer, a University, to

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.