How to change host name Glassfish - java

I have troubles with glassfish server. I have created application in eclipse and war application, copied it to the remote server and delpoyed to glassfish. It recognized this web application and it works if specify url set it manually, by default it has following url
http://ubuntu:8080/TestService/TestServiceProvider?Tester
If set it to my server ip address manually it works great. How can I change ubuntu to my hostname.
Thanks.

You should redirect your domain name to that ip address from your domain management site.

Since you're using HTTP service I'm also assuming you're using virtual servers.
According to glassfish hostname mapping
setting "

Related

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

Spring : How to remove localhost from url

I am working on some project for that using spring 3.2.0. Whenever I run project it looks like
http://IpAddressWithPortNo.com/myprojectName.com/
IpAddressWithPortNo = localhost : 8080
I want to hide localhost:8080 or ip address.
Is there any method available to map this ip to my project?
http://myprojectName.com
I am using apache tomcat 7.0 and fedora 17.
The solution doesn't involve configuring Spring, but the hosts file of your operating system. On Ubuntu, it is found at /etc/hosts, I'm not sure if its the same for Fedora, but it should be.
You just need to add a line in the hosts file that looks like the following:
127.0.0.1 myprojectName.com
That's it. You then access the myprojectName.com address in your browser and it will look at your localhost, behind the scenes.
The above solution works if you only need name resolution for your local machine.
If you'd like to expand to your local or external network, the answer is less trivial:
for your local network, you need to register a custom domain on your network DNS server (see this and this for more information); if you have a network administrator, direct this requirement to him, explaining that you want to expose your local ip through a custom domain name
if you want to expose this name to the entire internet, you have to register the custom domain to a DNS registration service (you can find free DNS services as well, unfortunately I haven't used any lately and dyndns.org doesn't provide free dns service anymore, try searching free dns service on google and lookup some reviews)
The :8080 will go if you configure Tomcat to respond on port 80, or https on port 443.
You can use any host name that resolves to your network address. For instance if your machine name on the local network is athena.mycompany.com then http://athena.mycompany.com/myProjectName should work fine - but only within the local network.
To get to http://myprojectName.com you will need to configure a firewall/router to forward an incoming request (presumably from the Internet) to your machine. Internal access will likely not resolve this URL.
Gabriel has just posted an answer that should work from your machine, but other machines within your intranet would also require entries to map that name to your machine.
For doing exactly what you want, you need to configure apache tomcat to listen on port 80 and tell your operating system that myproject.com resolves to localhost.
To resolve myproject.com to localhost, add the following to your /etc/hosts file:
127.0.0.1 myproject.com
To change the port number to 80, open /usr/share/tomcat7/confserver.xml or /etc/tomcat7/server.xml (whichever applies to your system) and change Connector port = 8080 to Connector port = 80.

Can't access OpenMary TTS from Azure endpoint

I just deployed an instance of OpenMary TTS server on my Windows 2012 Azure VM and configured ttp endpoints for both port 80 and the default 59125 ports. I've tried launching mary server using both ports and I can't access it externally using either the DNS name or the external IP. I installed IIS on the same host and I am able to access the default page remotely so I know it is not an Azure configuration issue, rather something in OpenMary causing it to only accept requests coming from the loopback IP or localhost.
Is there a hostname setting I can supply on the cmd line via java property? I can change its port name via -Dsocket.port= setting but how do I tweak the host name it listens on? Does it make sense to set the server up behind IIS?
in the Windows Azure Portal, you need to configure the end point mapping.

Running Jetty web server in LAN

GAE comes with an inbuilt jetty webserver for testing purpose.Can it be configured to accessed within our LAN?
I can access it using http://localhost:8888 or http://127.0.0.1:8888 but can't access using http://192.168.1.201:8888 (This my local LAN ip)
why?
Yes it is possible:
To make your GAE accessible on your LAN, you have to configure the launcher to use the address 0.0.0.0 instead of localhost.
Open the GoogleAppEngineLauncher >> Application Settings for your app
Add “-a 0.0.0.0″ to the Extra Flags section and restart. Now your GAE will run in your LAN and can be accessed by other devices.
You need to configure GAE to listen on all interfaces, not only localhost's loopback interface (127.0.0.1).
For IntelliJ IDEA users (version 11 at least):
If you're using the GAE plugin and have a AppEngine Run configuration, open its settings and add to Server parameters: -a 0.0.0.0. This will make the GAE built-in Jetty server to listen on your lan/wlan ip address, http://10.0.1.2 for instance.

Weird Tomcat and Axis Webservice behaviour

I have a simple web service deployed on tomcat using Apache Axis.
If i access the webservice as http://localhost:8080/webservices/TransactionService i see the usual message
TransactionService
Hi there, this is an AXIS service!
Perhaps there will be a form for invoking the service here...
showing that the web service is available and ready for use.
However if i access it as http://10.0.0.1:8080/webservices/TransactionService (10.0.0.1 is the actual IP of the machine. I'm accessing it on the same machine as above, machine hosting tomcat) i get:
HTTP Status 404 - /webservices/TransactionService
--------------------------------------------------------------------------------
type: Status report
message: /webservices/TransactionService
description: The requested resource (/webservices/TransactionService) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.5
There is nothing in the tomcat logs
If i try deploying on Jetty it all works fine.
Is there any explanation for this? Any pointers most welcome.
Tomcat can listen on different hostnames/IPs in a different way. Specifically, every host/IP can have its own work directory:
<Host name="localhost" workDir="/workdir">
...
</Host>
Application deployed to one workdir won't be available to a host with another workdir.
Check your configuration.
UPDATE: if name is specified as name, not IP, check that that name is resolved to 10.* address too.
Also, one of the hosts is default. It responds to all requests now matter what host they are targeted too, if there is no specific Host. For your setup you may want to leave only that one active.
I don't think a change to Tomcat configuration is the answer. I don't have to do such a thing to use my local IP address or localhost.
Could it be as simple as an addition to your hosts file? I've got mine in c:/windows/system32/drivers/etc/hosts, and there's an entry for "127.0.0.1 localhost" in it.

Categories