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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:01:58+00:00 2026-05-27T15:01:58+00:00

Heroku recently began supporting Java apps. Looking through the docs, it seems to resemble

  • 0

Heroku recently began supporting Java apps. Looking through the docs, it seems to resemble the Java Servlet Standard. Does anyone know of an instance where a GWT app has been successfully deployed on Heroku? If so, are there any limitations?

  • 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-27T15:01:59+00:00Added an answer on May 27, 2026 at 3:01 pm

    My first answer to this turned out to have problems when GWT tried to read its serialization policy. In the end I went for a simpler approach that was less Guice-based. I had to step through the Jetty code to understand why setBaseResource() was the way to go – it’s not immediately obvious from the Javadoc.

    Here’s my server class – the one with the main() method that you point Heroku at via your app-assembler plugin as per the Heroku docs.

    public class MyServer {
    
    public static void main(String[] args) throws Exception {
        if (args.length > 0) {
            new MyServer().start(Integer.valueOf(args[0]));
        }
        else {
            new MyServer().start(Integer.valueOf(System.getenv("PORT")));
        }
    }
    
    public void start(int port) throws Exception {
    
        Server server = new Server(port);
        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setBaseResource(createResourceForStatics());
        context.setContextPath("/");
        context.addEventListener(new AppConfig());
        context.addFilter(GuiceFilter.class, "/*", null);
        context.addServlet(DefaultServlet.class, "/");
        server.setHandler(context);
    
        server.start();
        server.join();
    }
    
    private Resource createResourceForStatics() throws MalformedURLException, IOException {
        String staticDir = getClass().getClassLoader().getResource("static/").toExternalForm();
        Resource staticResource = Resource.newResource(staticDir);
        return staticResource;
    }
    }
    

    AppConfig.java is a GuiceServletContextListener.

    You then put your static resources under src/main/resources/static/.

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

Sidebar

Related Questions

I have recently moved my RoR app on the Heroku platform, and almost everything
I created two very simple Heroku apps to test out the service, but it's
I recently back up my local Postgresql database and imported(restored) into Heroku's SHARED_DATABASE. heroku
I've recently deployed some A/B testing experiments using vanity to my heroku instance. However,
Heroku does not seem to be loading config/locales/pt.yml . (Language is being set correctly
Since Heroku began Facebook integration awhile ago, I've wanted to deploy a few PHP
Heroku seems great, but most non-trivial applications require authentication, and conventional authentication schemes require
Heroku supports background workers and cron (daily, hourly) but I'm looking for a way
I use Heroku to host and deploy a lot of little apps, in the
Heroku is, it seems, under a DDoS attack right now, which is causing intermittent

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.