Eclipse and remote Tomcat 8 server - java

After some time of research I didn't find a complete answer to this. My scenario is as follow:
1 Windows client with Eclipse.
1 Debian server with Tomcat 8.
The idea is to use the remote Tomcat server in the Windows machine to avoiding install the local Tomcat plugin on it, and deploy the projects directly to the remote server vía Eclipse. Is this possible?
As the information I've read, I'm afraid that the local Tomcat server is mandatory in order to get access to de Java Servlets API (package javax.servlet.*). I have a project in Eclipse without any Tomcat (remote nor local) and this package is not available so can't compile.
So, there is a way to achieve what I want? I'm a bit lost in this, so may I have some misleading concepts and simply this is not possible for some good reason :).
Thank you in advance.

Related

Java Websocket with tomcat localhost

I don't know if this is the right one to post to, correct me and I will switch!
I am using java with eclipse photon with Apache tomcat 9. I am making a application that will be connected to server (local host or make a local host on the pc) and then I will be able to send things to this local host node to store on a document. I was woundering 2 questions before I embark on this adventure that I haven't found the answer to.
Number 1: I want to use websockets, and I have tried to find an API from tomcat website but can't find it. I have looked at bunches of API's, there is a lot of free ones, but they are confusing me a bit. There is the javaEE websocket, then their is also a tomcat version (although I'm having a problem finding that now lol), but I just want it to use localhost. In all the tutorials I have watched they use javaEE (expected), but now I don't know if tomcat and websockets work in anything other then javaEE.
number 2: My application relies on there being a local host on the machine it is running on. If I configure tomcat, and have my Server file in my project explorer for eclipse and have that inside my project folder that contains the scripts etc, when I finish and compile my application on installation for the user, I am assuming I will have to create a local server on the users machine on installation; but I was woundering(hoping) that is it simpler, and the local server folder (that I saved within the compiled file that the user will download) that contains the local server configuration will be carried over to the users version when they download. I am woundering this because of setting up ports etc.
Any wisdom or tutorials please link!
For number1 you can implement pure websocket for java with helping of this https://www.baeldung.com/java-websockets.
For number2 I suggest you two options:
Use an embedded version of tomcat then you can create a jar file and give it to your users to run it in their localhosts.
Write a ant task that when users run, your project files and resources copy to tomcat.

How Does One Deploy a Jersey Application to a Remote Tomcat Server

I need to state up front that I am not a Java developer. So it is fair to assume that I know very little about the tooling etc. that Java dev's will be naturally familiar with.
So, I have created a Jersey web api (2.25.1) on my home server running Windows 2012. It serves data to a Xamarin application. I need to deploy this to a Linux server (Ubuntu) on AWS which my friend spun up.
At the moment, the only access I have is via SSH (Putty).
Tomcat (and Glassfish) have been installed on the Linux machine.
How do I go about deploying that application to that AWS server?
The official Jersey documentation seems to be MIA, and my Googling efforts don't yield much. There's a lot of SO questions with a similar title to this one. But I have not found any of the answers (and in many cases, questions) helpful to my cause.
Cheers
I assume that you are using maven to create your jersey web app .
Upon build you will get a *.war file .Copy the same to tomcat/webapps folder .
Start your tomcat then.
To take your file there on remote use winscp tool with your ssh credentials.

How to run java-websocket server in webapp

I am trying to use Websockets for my webapp, for pushing data from server to browser. I am using Java 1.6 (Can not upgrade to java 1.7 due to other dependencies) and I need this to work on any containers like Tomcat, WebLogic, JBoss, etc...
Two libraries I could found are –
“java-websocket” – http://java-websocket.org/
“javax.websocket” –
http://repo1.maven.org/maven2/javax/websocket/javax.websocket-api/1.0/
Server example provided with “java-websocket” is like a standalone Java Program. But I am trying to find a solution which integrates into my webapp.
My webapp address looks like this - http://localhost:8080/demo i.e. runs on say port 8080. However, java-websocket Server needs a port to start. Which means it does not interrelate well into my webapp.
Second library “javax.websocket” which works very well in a webapp context. But I cannot use it because it needs Java 1.7, and I am using Java 1.6.
Does anyone know whether it is possible at all to use “java-websocket” in webapp context? Or may be is there any other better library for this need which works with Java 1.6?
Thank you in advance.

Tomcat Project and Eclipse WTP Remote Server

I am just starting out with programming a tomcat server in java, and have installed eclipse's Web Tools Platform, but when I try to create a Dynamic Web Project, It wants me to specify an installation of Tomcat on my own machine. Is it necessary, other than to run the project, as the server to really use it is online? If it's not, any way I can bypass this problem?
(I'm not sure if there us a more appropriate stack exchange site for this: If there is, please direct me to it.)

Deploy a Java web application on Windows Server 2003

This is my first post on stackoverflow, so please excuse me if my question is stupid, in the wrong tags, not specific enough and just tell me how to improve my post ! I usually find all the answers I need going through the previously asked questions - and thank a lot the stack overflow community for this ! -, but not this time !
So, I'm student and I'm currently developping a java2EE web application to help a compagny managing its moulds stocks. I used struts2 framework to develop the application (which is called MMS) and it runs nicely on my personnal environment which is :
OS : windows7, 64 bits, service pack 1
Application Server : Apache Tomcat 7.0.27 to make MMS run on localhost
Database server : Wampserver2.2d to store the database of MMS
Java : Java JRE7 (jre_7u4-windows-x64)
IDE : Eclipse Java EE indigo sr2
Now I need to deploy my application on my employer's server. They gave me an access through the microsoft remote desktop tool to a windows 2003 server whose configurations are :
Microsoft windows server 2003 entreprise edition
Service Pack 2
My question is simple : how do I go from an application running well on my own environment to an application running on their server and accessible to their employees within their intranet ? Surprisingly enough I did not find any tutorial explaining how to do this. The documentation I found so far are the following :
Tomcat documentation : http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html
Microsoft documentation : http://msdn.microsoft.com/en-us/library/aa478983.aspx
Some other documentation explaining some of the logic (could not post the link because I'm a new user !)
My guess is :
First I need to prepare the environment, ie : install java, a servlet application server, and a MySQL server on windows 2003 server. For this I'd be tempted to install java JRE7, tomcat7, and wampserver2.2 on the windows 2003 server they gave me using the same .EXE I used on my PC.
Deploy MMS in the servelet application server : For this I think I could just drop the .WAR of MMS (created with Eclipse) on the webapp folder of tomcat.
Deploy my DB on the MySQL server : For this I'm thinking of exporting my DB from my computer and import it to the server using PHPmyAdmin (and a .SQL file)
Finally change the context.xml of MMS to make it able to communicate with its new DB.
Would this be enough to allow the employees of the societe I'm working for to access the web appication through their web browser (within the intranet of the compagny only) ?
Any anwser telling if I'm going on the write direction, if I forgot anything to do, giving advice, etc. would be truely appreciated :)
Thank you very much in advance !
Here is a generic solution I would suggest. You can simply install the wamp server package and the tomcat for windows. Upload your war file and start up mysql db, apache and tomcat services. Wamp server should come with php, mysql and phpmyadmin for your mysql. If you are good with batch file, you can make a batch file if you want to automate start, stop and restart all services.

Categories

Resources