Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Jboss: multiple instances, passing java properties, different ports

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have jboss 5.0.1 GA installed in /opt/jboss. I have read only access there... :-(

I have 2 apps, APP1 and APP2 and I would like them to listen on different ports: APP1 on port 9090 and APP2 on port 9091; additionally each APP has some properties to be set at startup.

Given that I cannot write the war files directly into the jboss deploy folder, how can I start 2 jboss instances in isolation using different ports and the given war?

I believe I have to write a script that does that (let's call it start.sh), can you please point me to some links/tutorials?

It would be great if I could do something like:

$JBOSS_HOME/bin/run.sh -port=9090 -java_opts="-Dname=value" APP1.war

In order to start the APP APP1.war, make it listen on port 9090 and pass the Java property -Dname=value.

How can I achieve this?

Thanks a lot in advance!

Cheers,
Giovanni

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will still run into problems - a running instance of JBoss AS will attempt to create a number of directories within the server directory. You really need to assign write access, or put it somewhere where you do have write access.
 
Author
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll probably want to run two instances of JBoss. You'll have to create two server configurations, so you'll have to get access to the installation.

JBoss does not just use one port, it uses many ports for the various services. You might have better luck using the -b (dash b) option.

./run.sh -b 192.168.1.101
./run.sh -b 192.168.1.102

What I recommend you do is figure this all out on your local machine by customizing your own configurations, then give the configuration directories to your admin in order to install them in the server directory for you.

 
Giovanni De Stefano
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

thank you for your replies.

Is there any possibility to run run.sh passing as argument the specific server configuration?

I can get write access to JBOSS_HOME but I cannot change the directory structure. So if my run.sh has to create "things" at runtime, it is not a problem.

The problem is that I have to deploy those apps with different configurations and I would like to package the whole thing regardless where jboss is installed.

Any link/tutorial you can suggest?

Thanks,
Giovanni
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To run two instance of JBoss on the same machine you need two different server configurations, which are just two directories under the server folder. So no matter what you really need to create those two folders.

If they are already there, then the best and easiest solution is to use the Binding Manager, and that requires you to be able to modify the jboss-service.xml in the server/<server-config-dir>/conf directory.

Check out the JBoss docs for more information on the Binding Manager, it is really simple to use and set up.

Mark
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You do not have to run two copies of the app server for each web app to be available on a different URL You can use virtual hosts instead: http://docs.jboss.org/jbossas/guides/webguide/r2/en/html/ch07.html
 
Javid Jamae
Author
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the -c flag to have it use a different server configuration.

Peter is right, if you don't have to use different ports, you might just use different URLs.
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:You do not have to run two copies of the app server for each web app to be available on a different URL You can use virtual hosts instead: http://docs.jboss.org/jbossas/guides/webguide/r2/en/html/ch07.html



You can't tell if that is really what the op was asking. At least I couldn't see that in the question.

I think the original poster needs to clarify what they actually want.

Mark
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic