0

First of all, I successfully created a RESTful webservice as Maven project. When I browse to http://localhost:8080/JsonService/vehiclegroups I receive a list with vehiclegroups. This is working perfectly when I run it in Netbeans.

Now I have the following question: What are the steps to deploy my .jar to an ubuntu server?

So I already created a jar with dependencies source. I defined a main class but this one is empty because all my code is inside the methods that are called when visiting a specific path.

When I run my .jar file, it only executes the code inside the main class and than it stops. How do I make sure it runs like inside Netbeans and receive data when browsing to the urls?

Do I have to install a Glassfish server on the Ubuntu and then run the jar? I want the program to keep running and answer all the path requests.

Thanks!

Community
  • 1
  • 1
Zothuis
  • 1
  • 3
  • I got this so far: compile a .war file instead of a jar file. Install glashfish. Start glashfish and browse to :4848. Go to applications. Add the .war file and launch. Still got some issues with my dependencies... – Zothuis Jul 12 '16 at 14:53

1 Answers1

0

I finally got it working! Install the Glassfish on the Ubuntu and browse to the admin panel. Go to applications > deploy > add the .war file.

You have to put the mysql-connector-java-5.1.23-bin.jar inside the global lib folder of Glassfish to avoid errors.

Everything works fine after that.

Cheers!

Zothuis
  • 1
  • 3