2

i am creating an android application which has got two parts a client part and a server part. So the client will be asking the serveer for a particular data and server need to give it back to the client. My question is how i can run this server program (jar file ) in a web server. I have tested it locally using eclipse but i need to know how i can put this into a web server and run it there. So that the client can use a data connection and connect to the server program and get back the respose from there Sorry for the inconvenience caused and a thank you in advance

Jijo
  • 57
  • 10
  • You need to build an [API][1]. or you can use one already done. – Francisco Corrales Morales Jan 25 '14 at 05:26
  • No, I mean API, Google it, and you must define your service, so we can now what exactly do you need. – Francisco Corrales Morales Jan 25 '14 at 05:35
  • What i need is i have an application running on my android device i need to login inorder to use that application. So we have the login details in the database (mysql using the jdbc ) . So the question is that how i can put my sever side codes into a web server ? – Jijo Jan 25 '14 at 05:39
  • This question is far too vague for a proper answer. For example, unless you explain how you have **currently** implemented your server-side code, we can't tell you how to turn it into something that would run on a web server. – Stephen C Jan 25 '14 at 05:55
  • i am creating an android application which has got two parts a client part and a server part. So the client will be asking the serveer for a particular data and server need to give it back to the client. My question is how i can run this server program (jar file ) in a web server. I have tested it locally using eclipse but i need to know how i can put this into a web server and run it there. So that the client can use a data connection and connect to the server program and get back the respose from there Sorry for the inconvenience caused and a thank you in advance – Jijo Jan 25 '14 at 13:24

2 Answers2

0

You will require Tomcat server for running Java ,jsp

To start with hosting this link might help you. How to host a JSP website on a webserver?

Community
  • 1
  • 1
MjZac
  • 3,476
  • 1
  • 17
  • 28
  • 1
    You certainly do NOT need to use Tomcat, (although that is a popular option). There are many different application servers that can host JSPs: GlassFish, JBoss, and WebLogic are a few examples that quickly come to mind. Also, there's no reason you would have to use JSPs. There are many options... I'd start with google and would search for "_java servlets_". – jahroy Jan 25 '14 at 05:50
0

From the way you describe your server it sounds like a simple .jar file that you built. If this is the case, you can simply deploy the jar on any compatible computer (or webserver) that you have shell access to.

  1. Build runnable jar in eclipse
  2. Place the jar file on some server
  3. Make sure the server has java installed (same java you used to build your runnable jar)
  4. Run the jar using java -jar path_to_jar.jar

To answer your question, you can run this in the background of a server running other services as long as you pick a port that isn't already in use. Make sure you enable port forwarding on your router/firewall (if you have one) if you want to access the service externally.

George
  • 416
  • 3
  • 11
  • To add on to this, this isn't really a permanent solution. But it should let you test your code with an active server. Before actual release of your app you really should do a proper deployment using something like JBOSS. – George Jan 25 '14 at 05:46