-
1. Re: use a different port for web service in jboss7
synclpz Dec 9, 2013 1:18 PM (in response to liuliu)You should add a new socket-binding with your port, and set up an http-connector in web subsystem.
1. Create new <socket-binding name="http-8089" port="8089"/>
2. In subsystem "urn:jboss:domain:web" add <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http-8089"/>
-
2. Re: use a different port for web service in jboss7
liuliu Dec 10, 2013 3:44 AM (in response to synclpz)Thank for your reply, it is what i missed. There is already a connector named http, so I changed the name of connector.
Another question, Now we can get the web service by both 8080 and 8089. Is it possible use only 8089 for web service? On the same server, I have the web application running on the port 8080.
-
3. Re: use a different port for web service in jboss7
synclpz Dec 10, 2013 5:07 AM (in response to liuliu)As I said you shouldn't have renamed the connector, you should just add another, so the following will work:
Another question, Now we can get the web service by both 8080 and 8089. Is it possible use only 8089 for web service? On the same server, I have the web application running on the port 8080.
if you have two connectors, one default "http" and one with another name (I mentioned it as "http-8089", it's just a name) referring another socket-binding.
This way you will have your web server (serving web-app and ws) listen on both ports.
-
4. Re: use a different port for web service in jboss7
liuliu Dec 10, 2013 9:21 AM (in response to synclpz)I cant add the connector if I dont change the name of the connector, I get this error message
Response
Internal Server Error
{
"outcome" => "failed",
"failure-description" => "JBAS014803: Duplicate resource [
(\"subsystem\" => \"web\"),
(\"connector\" => \"http\")
]",
"rolled-back" => true
}
If I keep the same name, just change the socket-binding, both the web-app and ws use the port 8089.
What I want is the web-app and the ws use the different port, web-app on 8080 and web service on 8089.
-
5. Re: use a different port for web service in jboss7
synclpz Dec 11, 2013 5:28 AM (in response to liuliu)I have this configuration in my standalone.xml:
the web subsystem:
<subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
<connector name="http2" protocol="HTTP/1.1" scheme="http" socket-binding="http2" enabled="true"/>
<virtual-server name="default-host" enable-welcome-root="false">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
and in socket-bindings:
<socket-binding name="http" port="8080"/>
<socket-binding name="http2" port="8180" fixed-port="false"/>
therefore web server listens on 8080 and 8180.
-
6. Re: use a different port for web service in jboss7
liuliu Dec 12, 2013 3:21 AM (in response to synclpz)hi,
I have no doute about what you said, the server listens on port 8080 and 8180. but what I want is web-app and web service use different port. Is it possible?
by example, I dont want the web app is available on port 8180, and the web service is only available on port 8180.
thanks
-
7. Re: use a different port for web service in jboss7
synclpz Dec 12, 2013 3:03 PM (in response to liuliu)Oh... I don't think it is possible via configuration. But programmatically you can check the URL in web-app and throw exception if port is not right and also implement an interceptor for WS to do the same thing.
Or just start two jboss instances, for example :-)
-
8. Re: use a different port for web service in jboss7
liuliu Dec 13, 2013 3:23 AM (in response to synclpz)2 jboss instance, it could be a solution. but my web service is simple annotation on ejb method, and now it need creat a new projet for the web service. I dont like it.
And I dont understand what it is for the wsdl-port parameter of webservice subsystem if we cant seperate web-app port and web-service port?
-
9. Re: use a different port for web service in jboss7
synclpz Dec 13, 2013 6:39 AM (in response to liuliu)I think it is actually important when a JBoss cluster is behind loadbalancer which uses different incoming port...
-
10. Re: use a different port for web service in jboss7
rhusar Dec 13, 2013 7:37 AM (in response to synclpz)I wonder if putting a loadbalancer in front of the single server and doing url rewriting would help your problem?
host:8080/web-app -> host:8080/webapp
host:8180/web-service -> host:8080/web-service
Othercases, 404 or whatever.
-
11. Re: use a different port for web service in jboss7
dlofthouse Dec 13, 2013 1:18 PM (in response to liuliu)And I dont understand what it is for the wsdl-port parameter of webservice subsystem if we cant seperate web-app port and web-service port?
When WSDLs are processed / generated they need to contain the address of the endpoint in a way that the remote clients can use to connect to the server, due to various ways that servers can be configured the WS subsystem can not always be aware of the actual address a client will use to connect to the server - the wsdl-port attribute can be used to tell the ws subsystem the port that will be used. It is not a mechanism to trigger the opening of a different port.
-
12. Re: use a different port for web service in jboss7
tkalafut Dec 13, 2013 1:45 PM (in response to dlofthouse)Test: Why won't the Discussion site let me create a question?
It lets me fill in everything and then says "cannot create or update content" at the top when I try to post. Grrrrrr.
-
13. Re: use a different port for web service in jboss7
liuliu Dec 16, 2013 5:30 AM (in response to dlofthouse)thanks