0

I've just tried dotcloud, and i wanted to run a java servlet on it, so i've exported the servlet to war, and deployed on dotcloud... The welcome html is accessible, but the servlet itself isn't. I've tried every combination of path, but always 404 error.

First i didn't have anything in web.xml except a link to the welcome html, as with tomcat, the @WebServlet annotation in the servlet class worked, so i could reach the servlet by "http://serveraddress/Projectname/annotatedpath" But on dotcloud i can't, so i've made servlet mapping in web.xml too, but not helped. in same time i can reach the welcome html at "http://serveraddress/Projectname/"

1 Answers1

1

I've created a sample application based on some of the tutorials found on dotCloud. This working example doesn't use @webservlet annotations, but you could fork and modify it to use them.

To get it running try the following:

1) install the dotcloud cli (i'll assume you've already done it)

2) clone the example (-b java to use the java branch)

$ git clone https://github.com/johncosta/ramen-on-dotcloud -b java

3) Create and push the helloworld application

$ dotcloud create helloworldapp
$ dotcloud push helloworldapp -b java   # use the java branch

4) Access the servlet at the following url (as given by the cli output):

http://helloworldapp-<username>.dotcloud.com/helloworld/hello
johncosta
  • 3,737
  • 1
  • 25
  • 25