Glassfish server is shipped with default domain (domain1). For most of our development purposes default domain is sufficient.
But there are cases when you need additional domain and even run the application simultaneously on multiple domains.
While creating a new domain we should be cautious about ports. Use following command to create the domain:
asadmin create-domain --user admin --portbase 4000 --savemasterpassword=true domainname
Please note we have used option portbase. This option calculates various ports based following formula:
portbase+48 for Admin.
portbase+80 for HTTP Instance.
portbase+76 for JMS.
portbase+37 for IIOP.
portbase+81 for HTTP_SSL.
portbase+38 for IIOP_SSL.
portbase+39 for IIOP_MUTUALAUTH.
portbase+86 for JMX_ADMIN.
portbase+66 for OSGI_SHELL.
portbase+09 for JAVA_DEBUGGER.
Be careful while choosing the portbase.
I will be describing how to use multiple domain in Netbeans in my next post.