How do you run multiple instances of JBoss 4.0 (running under Eclipse) on the same machine? - eclipse

At my office we run JBoss 4.0 and use Eclipse to debug and run the JBoss server. We're deploying simple wars, nothing terribly complex. However, I haven't yet figured out how to get this version of JBoss to either allow me to run separate instances of the war (HEAD and the Branch, for example) or to run separate servers controlled by two different projects in Eclipse. Anyone know how to do this? I've searched and found nothing that addresses this specifically.

The three things you have to think about are:
Making sure that instances do not overwrite each other’s files
Making sure that the instances don’t open the same TCP ports
Determining how to shut down each instance
Create a copy of your configuration so you don't have file collisions (like when temp files are created). Then, I would recommend just binding the two configurations to different IPs on the same machine, which will avoid port conflicts. You can do something like this:
run –b 192.168.0.100 –c myconfig
run –b 192.168.0.101 –c myconfig2
If you have two network cards, this is easy. If you don't, you can setup virtual IP addresses with a loopback adapter on Windows. On Linux, you can use ifconfig.
To shut down, just make sure you specify the IP/port to shut down, like this:
shutdown –s 192.168.0.100:1099 -S
shutdown –s 192.168.0.101:1099 -S
I'm not sure how to get you going on Eclipse, but you should be able to specify those flags to the run and shutdown scripts through the configuration somehow.
We cover this topic in depth in JBoss in Action in section 15.2 - Collocating multiple application server instances.

I think you can subscribe various instances of JBoss to your eclipse installation. normal installation example
Hope it helps you

Related

Remote control Eclipse on Ubuntu

I'm using Eclipse on many different PC's also on nonPrivat PC's like in the university, I would like to run Eclipse on an Ubuntu Server (I already got one running at home) and access it remotely from another operating system (Windows/Mac/Linux).
I know there are ways like Xrdp, but I don't really want to install a GUI on the Ubuntu Server to do that. (If it's at all possible to access it over the internet)
Are there other ways to deal with that problem? Maybe something quite different than that?
Thanks in advance!
Two solutions.
You can use ssh -X user#your.server. This will create a tunnel for the X protocol, allowing you to run Eclipse with display on your machine, i.e. just
mymachine $ ssh -X me#that.server
thatserver# eclipse
and you will see the GUI on the local machine, provided you have an X server, which should be standard and is easy to find for a Mac (it is called Quartz).
If you are not willing, or not able, to install X on your machine, you could also install tightvnc on the remote machine and a VNC client on your computer. VNC is a different remoting protocol, and can be better than X in some cases, because it has a reputation for fewer round trips in its communication, giving less latency problem.
If you have a database to reach for your project, that can be seen only from the remote machine, maybe inside a DMZ, you might still reach it, creating an SSH tunnel, like this
ssh -X -L <database port>:<database server address>:<port number here> me#that.server
This way you will be able to access the database with which you talk on port database port at address database server address, as seen from the remote server that.server. The port will be forwarded to localhost:por number here.
Do you need to have graphic access to eclipse or do you just need to be able to build projects? If you just want to build projects there is a headless CDT which let's you do that from the command line.

Play 1.2.4.3: How to find currently used port for debugger?

I have several Play applications running parallel. One of them is running in Eclipse. I want to connect the Eclipse debugger (launcher "Connect JPDA to myapplication.launch"), but the port changes every time (probably due to one of the other applications blocking the default port). I would edit the launcher and enter the current port manually*, but: How would I know which port to use?
PS: As my app runs for quite a while I do not see the port initially displayed in the console anymore.
*PPS: Is there a more elegant way to handle this?
The more elegant way of handling this is to just define the jpda port it should use yourself, so you always know behind which jpda port an application is running and you don't have to look it up all the time. Its documented in the configuration manual and it comes down to adding jpda.port=???? in your application.conf (changing the question marks into a port number, ofcourse).
The reason they change is indeed because they are running in parallel. Java automatically switches to the next available port if the default is in use.
There should be a line in the output log that looks like the following:
Listening for transport dt_socket at address: <some port number>
That's the debug port number you need to configure in Eclipse for JPDA.
OK, in OS X you'll find the port in the activity monitor: Double click each "java" process until you find the one belonging to Eclipse. The requested port is the one mapped to "*".
Click here for details (in German) and screenshots (I need 10 reputation to post images or more than two links)

Netbeans & Eclipse hang when I attempt remote EC2 debugging via Xdebug

Already, I've checked at least 20 resources and am out of ideas:
I have a clean, remote Ubuntu EC2 instance, fresh from the AMI, having stopped only to install LAMP, phpmyadmin, and xdebug on it. Yes, I have configured my remote EC2 instance's php.ini file as follows:
Meanwhile, back on my laptop I have Netbeans & Eclipse installed. While I can get either to seamlessly upload and Run my php web app on my EC2 site (via SSH/SFTP) as soon as I hit "Debug" from either, index.php gets uploaded, a browser window opens, and then NOTHING HAPPENS. The page doesn't load, the Debug perspective doesn't open, breakpoints don't get triggered, nothing. Netbeans just hangs out saying "waiting for connection" whereas Eclipse just sits at the notorious 57% level (& yes, I toggled the xdebug.idekey before testing with Eclipse)).
So I tested xdebug's functionality on my server according to the instructions found here and here (both passed). I tried changing to port 9001 (in remote php.ini as well as in local Netbeans/Eclipse), I even tried launching this brand spanking-new EC2 instance with pretty much open Security group settings (SSH=0.0.0.0/0), but nothing seems to be working. I am out & out flummoxed, a self-confessed noob, and appreciative of any insight seasoned professionals in the community may have to offer.
Thanks,
Debbie
This feels like a networking issue to me. Port 9000 may not be accessible. The quickest way to test is to telnet to port 9000 on the remote system (if you have a telnet client installed that allows you to specify which port to telnet to). If the telnet attempt times out or is closed by the remote system you will see the error and this verifies that there is a networking issue.
I would check /etc/services to make sure that port 9000 is not reserved for use of something else. If port 9000 exists and is uncommented then something else is using the port and that services does not know how to respond to your request so it hangs.
I would do a netstat (lookup params to see "all" listening ports) and make sure the remote system is listening on port 9000. If you don't see port 9000 then the remote system is not configured to establish the connection.
If you are on a WIFI network then port 9000 may need to be port forwarded to the remote system using the internal cable modem configuration menu/utility. This is the scenerio I favor because I've wasted so much time solving this kind of problem with different software.
Good luck, you have more troubleshooting ahead of you and different questions to ask to resolve your problem.

Angular app not working in IE 9 on remote server

I have a simple angular application that works just fine when deployed on my local JBoss instance, but when I deploy the same war file in our sandboxed environment (also JBoss) the application doesn't load. Just shows up as a blank page. When viewed on Chrome or FF it works fine as well.
Not a lot to go on, but any pointers in the right direction would be very helpful.
Edit: Just another piece of info, it doesn't work locally on IE either when the address contains the computer name and not localhost. So http://localhost:8080/angularapp works but http://[machinename]:8080/angularapp does not.
In the post you don't make completely clear in what environments you've the problem (it's clear it doesn't work using IE, but does it work in all cases with Chrome and FF?).
But the problem you're experiencing when trying to access using the machine name (http://machinename:8080/...), may be caused because you've not defined properly the IP bindings in the JBoss startup: by default JBoss binds only to localhost (127.0.0.1), if you want JBoss to be accessed from any other network interface, you've to define it. That can be done using the -b parameter of the startup script (run.sh for Jboss 3.x/4.x/5.x/6.x or standalone.sh if it's JBoss 7). For example:
./run.sh -b xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xxx is your server IP) will make the JBoss accessible only from that IP (and its corresponding machine name, provided is correctly defined in the DNS or /etc/hosts ...), but not from localhost.
./run.sh -b 0.0.0.0 will make the JBoss accessible from all the networks interfaces of your server.

Making web application go Public

I have my web Application deployed in jboss web server. It contains Servlets. Right now its url is localhost:8080/MyWebApp I want to make it public so that the clients not in localhost can also access MyWebApp. I am new to this so I am not pretty sure about how to do this. I have browsed through many sites offering a domain but I dont understand where will my Server reside. Can I make my own System as Server and run jboss Server?
Regarding listening only on localhost, take a look at your startup scripts ; to make it listen on all the network interfaces you can use
run.sh -b 0.0.0.0
To listen only on a particular ip use
run.sh -b 1.2.3.4
Ideally you do not want users to access http://some_server:8080/MyWebApp but something like http://some_server/MyWebApp. To do this you will need to setup Apache with mod_jk and proxy the requests to jboss. If you have never done this before, it might be challenging. But there are plenty of resources on the internet to help you perform this task.