Access JAVA web application from other machines

Asked

Viewed 110 times

0

I am using JAVA,JPA, with Wildfly,e primefaces. I have the link of my application http://localhost:8080/Sicoob/faces/cadastre I would like other machines to access this application, I already modified the localhost by the IP of my machine but it didn’t work, there is something specific to do?

2 answers

1

The correct thing is to set up a new interface called any to any address, e.g.:

<interface name="any">
    <any-address/>
</interface>

and specify it as default in the socket biding group, ex:

 <socket-binding-group name="standard-sockets" default-interface="any" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>
        </outbound-socket-binding>
    </socket-binding-group>
  • Changing the socket and the interface worked properly, thank you Heber and Dilnei.

0

In wildfly, go to standalone.xml (or Domain.xml, depending on which script you use to climb the server), and change the line below:

Of:

<interface name="public">
    <inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>

To:

<interface name="public">
    <inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
  • I made the change ,I changed "http://localhost:8080/Sicoob/faces/cadastroEstoque.xhtml" to "10.54.31.85:8080/Sicoob/faces/cadastroEstoque.xhtml" and it didn’t work.

  • restarted the server? this ip 10.54.31.85 is the same as yours?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.