We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

How to change port number of Jboss 7 dynamically?

Need Reply

I have been using Advanced installer . It is quite good as compare to other but i'm looking for my answer. :|
here is it :-
I have grouped my Jboss 7 server, Postgres database and test.bat into a demo.exe file using Advanced Installer. When file i.e demo.exe file double clicked on the client side then test.bat file runs and it deploys JBoss and postgres at the predefined location and the service starts and my application runs at the port number 8080 .All the script has been written to test.bat file .This demo.exe file has to be used by different users . It may be possible that 8080 might be used or engaged by different application on client side.

So how can i change port number of jboss dynamically on the client side as per port usage?
Or As per discussion with some good developers , i came to know that there are few installers through which you can achieve it?
Is it possible with this advanced installer ?
If yes then how ?

Any help will be highly appreciated and will be thankful .
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to change port number of Jboss 7 dynamically?

Hello,

In order to achieve what you want you can use our "Get a free TCP port" custom action. The custom action will search for a free TCP port and will set its number in the AI_SEARCH_TCP_PORT property. So, you can pass the AI_SEARCH_TCP_PORT property value as a parameter to your BAT file.

Please note that the "Get a free TCP port" custom action can be added only as a custom action without sequence, therefore it should be launched using a control event added on one of your installation dialogs. So, in order to use this custom action you should run your installation package with Full UI.

Here are the steps to proceed:
- go to "Custom Actions" page and add a "Get a free TCP port" custom action without sequence like this:
  • Host name or IP:
    TCP port: 1200
- go to "Dialogs" page and select "WelcomeDlg" dialog
- on "Init Events" tab add a new control event like this:
  • Control Event: Execute custom action
    Argument: GetFreeTCPPort
    Condition: 1
- go to "Custom Actions" page, select the custom action which launch your BAT file and add AI_SEARCH_TCP_PORT property as a parameter to your BAT file; also, your launch BAT custom action should use the following condition:
  • AI_PORT_TEST_RES = "FreePort"
- build and run your project

Also, please keep in mind that in order to implement this scenario you will need to use our "Dialog Editor" feature wich is available only in an "Enterprise" or higher project type.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

Re: How to change port number of Jboss 7 dynamically?

Thanx Daneil ...It looks good... :) As we know in Jboss Application server port number is defined in standalone.xml file but i thing i need to know that is it possible that for changing the port number, a wizard or popup should come up during installation so that we can fill the port number as per our desire i.e 8676 port number and that port replace the earlier defined port number option in standalone.xml .After then when we start the service ,the application should start at the desired port number., Because it will help to know a user that on whicht port number they have to start the application. Like in my case http://localhost:8676 .
Or do you have any more solution for it ? PLease share . NEED HELP

Waiting for your reply Deniel :)
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to change port number of Jboss 7 dynamically?

Hello,

In order to achieve this you can import the related standalone.xml in "Files and Folders" page as an XML file. Then, you can use a dialog which will capture the user input and will save it in the above XML file. You will also have to check the port number entered by the user using our "Check TCP port" predefined custom action.

Here are the steps to proceed:
- go to "Install Parameters" page and add a property like this:
  • Name: PORT_PROP
    Value: 8786
- go to "Files and Folders" page and import the standalone.xml file in desired directory
- double click on the standalone.xml file and then edit the XML element attribute which contain the port number value like this:
  • Name: port
    Value: [PORT_PROP]
- go to "Custom Actions" page and add a "Check TCP port" custom action without sequence
- go to "Dialogs" page and create a new dialog where the user can input a desired port number
- on [Next>] button you should add the following published events:
Control Event: Set installer property value
  • Property: [AI_BIND_TCP_PORT]
    Argument: [PORT_PROP]

    Control Event: Execute custom action
    Argument: CheckFreeTCPPort

    Control Event: Display a specific child dialog
    Argument: <NewDialog>
Please note that the "Display a specific child dialog" event should be added as last item in the "Published Events" list.

- build and run your project

I've also added a sample project which implements a similar scenario.
sample.zip
(3.84 KiB) Downloaded 561 times
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

Re: How to change port number of Jboss 7 dynamically?

HUrrraaayyyyyy

It worked :)
Thanx Daneil and team .
Advanced Intsaller is awesome.
:D
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to change port number of Jboss 7 dynamically?

You're welcome. I'm glad you got this working.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”