• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connect to JBoss AS 7 on Oracle Linux 7 in VirtualBox

 
Ranch Hand
Posts: 34
Eclipse IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy!

I installed the Oracle Linux 7 in to the VirtualBox. This is a standard installation, I did not configure anything.
The virtual machine network is attached to Bridged Adapter.
> [root@localhost ~]# /etc/sysconfig/network-scripts/ifup ifcfg-enp0s3


> Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0)

> [root@localhost ~]# ip addr

> 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:ad:4f:68 brd ff:ff:ff:ff:ff:ff
inet 172.24.131.35/24 brd 172.24.131.255 scope global enp0s3
inet6 fe80::a00:27ff:fead:4f68/64 scope link
valid_lft forever preferred_lft forever


With winscp I copied the jboss-as-7 and the java to /usr/etc path.

> [root@localhost ~]# export JAVA_HOME="/usr/etc/jdk1.7.0_67"
> [root@localhost ~]# export PATH=$JAVA_HOME/bin:$PATH
> [root@localhost ~]# java -version
-bash: /usr/etc/jdk1.7.0_67/bin/java: Permission denied

> [root@localhost ~]# chmod u+x /usr/etc/jdk1.7.0_67/bin/java
> [root@localhost ~]# java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

> [root@localhost ~]# chmod u+x /usr/etc/jboss-as-7.1.1.Final/bin/standalone.sh

> [root@localhost ~]# /usr/etc/jboss-as-7.1.1.Final/bin/standalone.sh

...
08:46:30,919 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/MyExample'
08:46:32,269 INFO [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /MyExample
08:46:32,369 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "MyExample.war"

After this, I tried to connect with my Host machine to the Guest server with this link http://172.24.131.35:8080/MyExample/
But it is not connect.

What could be wrong? In the Linux or in the standalone.xml? Or my virtual machine installation in VirtualBox?

The JBoss AS 7 is a standard install too.

Here is the console log.

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


08:45:51,486 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080


By default, all services including the HTTP listener services are bound to localhost (for security reasons). So you can't access the server remotely unless you specify which IP/host the server's services are to be bound to. One of the ways to bind to a specific IP which is then remotely accessible is by using the -b option (there are other ways to do it via the standalone/domain xml configurations too) to the startup command:



In your case it would be:



There's more details in this blog that I wrote up when the -b support was added in AS7 http://www.jaitechwriteups.blogspot.in/2011/09/jboss-as-702-arc-released.html
 
Edward Bloom
Ranch Hand
Posts: 34
Eclipse IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Jaikiran Pai,

I've tried your suggestion.

And I've tried also this one:
./standalone.sh -Djboss.bind.address=172.24.131.35 -Djboss.bind.address.management=172.24.131.35

and this one in the standalone xml:



But unfortunatelly i cannot reach yet.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure the firewall rules allow access to that IP/port from outside. You could even try a simple:



from the command prompt and see if that works (of course after starting the server). If it doesn't then you'll have to check with the sysadmin about the firewall rules.
 
Edward Bloom
Ranch Hand
Posts: 34
Eclipse IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Jaikiran Pai,

I typed that command on my Oracle Virtual machine.
The result of your suggestion:

[root@localhost ~]# telnet 172.24.131.35 8080
Trying 172.24.131.35...
Connected to 172.24.131.35.
Escape character is '^]'.

Edit:
And when i shut down the JBoss As:
Connection closed by foreign host.

I suppose thats right.

I turned off firewall on the windows 8.1 host too.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try the telnet from the same machine from where you weren't able to access the server?
 
Edward Bloom
Ranch Hand
Posts: 34
Eclipse IDE Firefox Browser Fedora
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem was the firewall on the Oracle Linux 7.

So i had to stop and disable firewalld using systemd.

systemctl stop firewalld.service
systemctl disable firewalld.service

Thanks,
ed
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic