Running Java applications serverside

Discussion in 'Programming & Software Development' started by kthnx, Jun 7, 2008.

  1. kthnx

    kthnx Member

    Joined:
    Apr 5, 2006
    Messages:
    1,133
    Location:
    NSW
    So, I have this little box thing called an Xport. It connects to a serial device (a water level sensor) and you can connect to it for settings etc via it's ethernet port. It spews the data to a designated local IP, where a receiver program catches the transmission and displays it to a user. That all works fine.
    I'm trying to set it up to work on a web server so that I can store the variables in a SQL db and display them on a graph (no worries coding the graphing application // retrieving the variables).
    My problem is somehow getting the server to receive the databursts being sent to it. I know a guy who's done it but he actually owns his server, whereas I just rent hosting space, so I'm having a bit more trouble since I can't just run applications. Not really 100% but I'm lead to believe Java is the way to go for receiving the transmissions. Would you agree? How hard is it to get Java running serverside (I'm guessing there's some kind of horrible package to install?)
    My knowledge is basically limited to HTML / PHP / AS2 so no idea if I'm on the right path here or what. Any thoughts?
     
  2. lazjen

    lazjen Member

    Joined:
    Feb 10, 2003
    Messages:
    416
    Location:
    Brisbane
    Getting some java application to listen on a port for these transmissions would not be difficult to achieve. Depending on what you need or the skills available to you this could mean just a standalone java app, or some deployed application in an appserver (like Tomcat or Glassfish). I suspect the latter might be overkill for your needs though. Installation of java is very simple - there's RPMs for example - some other OSes have other packages. At worst there's a tarball.

    I think the biggest problem you're going to have (besides writing the app) is convincing the site you're hosting with to allow you to use java (or anything really) to run your app. Servers that allow you to run apps are generally more expensive than just web hosting.

    Now, you might be able to simplify this a bit, depending on the device hooked up to your sensor. If you can write something there to catch the data there, you could resubmit it as a HTTP request (post) to your web host, where I assume you can use PHP to process it.
     

Share This Page