database postgresql on apache tomcat server - java

I don't find the solution for my specific problem, therefore, I ask for you help.
I developed a java application using Spring, JPA/Hibernate and Vaadin. The database is on PostgreSQL.
The application on my computer run on localhost:8080 and bind the database on localhost:5432;
In order for my colleagues to use it, I need now to deploy my application on a virtal server Tomcat. The address of this Tomcat is like 10.152.487.12:8080...
I want to create a war of my application in java and deploy it on Tomcat. But, where I can put the database and how ?
Apache Tomcat allow the creation of a Postgresql server on 8080 port ?
Apache Tomcat allow the installation of a Postgresql server on 5432 like 10.152.487.12:5432 ?
Please, I need help, thank you in advance !

I found the solution !
Yes, I am a newbie, but I think another peoples can be in the same situation, therefore...
You open the "Remote Desktop" on windows if the server where Tomcat turn on is Windows Server. Then, you enter the IP address of the server (without the port 8080 of course). Then, you arrive on the server, you can go on Internet for download PostgreSQL (warning, desactivate the security of the browser, it not allow you to surf !).
Finally, install, enjoy !

Related

Publishing a site with Tomcat

I am working on an open source project that written in Java.
I am using Tomcat server,Mysql and Java,
with writing
http://localhost:8080/Projectname,
I can run this project
But I must open this project to other users,
I have a constatnt Id, I have done it with using IIS before many times.
How can I do it with Tomcat server,
Is there anyone who has experince on this matter
Thanks for your helping
You Should replace localhost with your IP and check firewall exception for this 8080 port.

Set Up New Tomcat Server

I am kind of a newbie on server, environment stuff, so I need help on setting up a new Tomcat server.
Actually I have installed one instance and it is running already on my dedicated server, but I can't access it's main page, so it is made possible to deploy my apps.
These are the internet proccess in the server. Tomcat is running on port 8080. I tried to access it by IP:8080 and it doesn't work
So is there some extra configuration on a dedicated server to be made? Some security stuff?

Not able to connect localhost with system ip

I have deployed my java web application using apache tomcact in my system through Eclipse. I can access the same page with
https://localhost:8080/Home.jsp
as well
https://mysystemip:8080/Home.jsp
But the same page is not able to connect
https://mysystemip:8080/Home.jsp over the network through other systems. Previously it was working and now not. What issue causing this ?
Your Tomcat server is only bound to your local network interface. You need to bind it to all interfaces for it to be available.
There is already a solution (Can't access Tomcat using IP address):
Add address="0.0.0.0" to Connector string

WebSockets not working on OpenShift Tomcat 7.0 and WildFly Application Server 8.1.0.CR1

I 've spent the whole night trying to run a simple echo test on Tomcat 7.
The test I try to run runs locally as expected. But when deployed to the openshift the connection opens and then immediately closed. I've been looking for the right setup on the internet and found questions and answers for them for exactly the same problem but the solutions don't work for me.
The example of what I have as a test can be checked at http://pureikka-belgampaul.rhcloud.com/pi-8/index.html
At the bottom of the viewarea there's a debug console reporting the statsus of the websocket.
So I feel like I have not made a simple mistake in the setup and it runs locally with only the change of the host name and the port number for the websocket.
Could it be a routing trouble after the upgrade of the connection?
I deploy my war file directly to the webapps directory.
I also think I got websockets working at one moment but i'm not so sure anymore. I could be looking at the localhost after all.
Eventually I decided to try wildfly8 gear because it ships with support for websockets. I checked out the https://github.com/javaee-samples/javaee7-samples repo and deployed the chat demo to the local wildfly8 and the example worked from the first run as it is supposed. Great. But the same war file fails to work correctly on the openshift (http://wildfly8-belgampaul.rhcloud.com/chat3/)
I tried to use ports 80 or 8000 in both setups.
Need someone's help? advice or question to send me back to the right direction
Maybe someone has solved a similar issue?
Web Sockets on OpenShift work over ports 8000 for ws and 8443 for wss, it is not a "work around" it's the way websockets work on this system.
Here are the most useful links providing just enough light about the problem
https://www.openshift.com/blogs/paas-websockets (general info about websockets on openshift)
https://www.openshift.com/blogs/deploy-websocket-web-applications-with-jboss-wildfly (diy example)
to summarize:
websocket support out-of-the-box is the most reliable with node.js.

Can't connect to tomcat webservice

So I've been doing a java webservice in Eclipse in which I have launched on a localhost tomcat from Eclipse. This has worked very good as long as I've been connecting to the tomcat started from Eclipse.
However now I want to try deploy it on my tomcat separated from Eclipse but still on localhost. So I exported my web project to a .war file and deployed it with the tomcat manager app. However now I cant reach it from my client any longer. I'm running the tomcat on port 8080, just as my Eclipse tomcat did. BUT I can go to a reasource URL from my web browser and receive proper information, so the service is running(which the manager app is saying as well).
The client is a android device connected to the same network. The service fetches information from a MySQL database on the same machine. This connection worked fine before exporting it to war on my other tomcat
What am I doing wrong here? Just ask if you need any further information!
Ok so after testing I found it strange that I got connection time-outs and not something else. It also took at least 10 seconds before any feedback occurred. Sooo it felt like a firewall problem which indeed it was.
First I needed to portforward the tomcat port in my router to the machine ip that was hosting it. Then I remembered I had Windows firewall on that very machine which was also blocking conenctions on that port. So I allowed connections on tomcat port and BAM! It worked.
Thanks for all your comments, of course I should have thought about opening my ports before coming here.

Categories