| Creating a Domains using weblogic.Server |
| It was chilling January days, when I was doing my experiments for WebLogic System Administration certificate. You might think that how come this is possible a domain using weblogic.Server?? But it is true, you can do this, you can configure a domain using java weblogic.Server. This blog enables you to help you to make that domain with weblogic.Server class and the same command will Start the Admin Server of-course you can name your Admin Server here I did as Server2. The command can be given as follows: java -XX:MaxPermSize=512m -Dweblogic.RootDirectory=. -Dweblogic.Domain=domain2 -Dweblogic.Name=Server2 -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic -Dweblogic.ListenAddress=WLHost.com -Dweblogic.ListenPort=9015 weblogic.Server Let us see new scenario If we have config.xml file copied from an existing domain then we can run the server with the override the exiting values present in the urconfig.xml file with ListenAddress, ListenPort new values given in command line. No config.xml was found. Would you like the server to create a default configuration and boot? (y/n): y The response 'y' indicates to the weblogic.Server to create a domain directyory with all required files and directories for it. If you don't specify the ListenAddress then weblogic will search for all possible network channels to connect with the given port. java -XX:MaxPermSize=512m -Dweblogic.RootDirectory=. -Dweblogic.ConfigFile=urconfig.xml -Dweblogic.Domain=domain2 -Dweblogic.Name=Server2 -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic -Dweblogic.ListenAddress=WLHost.com -Dweblogic.ListenPort=9015 weblogic.Server Above highlighted text in single line in a command prompt or keep this into a shell script or batch script for respective operating environments. Here the domain can be created for only single server (Admin Server) instance, and we cannot add managed server and cluster etc. if we have already a config.xml file available then we can specify using -Dweblogic.ConfigFile=urconfig.xml. |
| Creating the Domains using ANT |
| Creating the Weblogic domain with Ant Script : In the Oracle WebLogic we have option to create a domain with ant script ( build.xml ) with a specialized ant task wlserver. Here it will create a domain and starts the server also. Ref: Starting Servers and Creating Domains Using the wlserver Ant Task use vi build.xml and enter the following lines then run ant in the command prompt My Successful build.xml for Solaris where all paths, classpath which already assigned in previous domain creation types. build.xml Note: Each line keep it in the lessthan Open tag(<) and greaterthan close tag(/>) and remove if open or close braces () are there in there before using it project name='testant' default='all' basedir='.' target name='newserver' delete dir='./tmp' mkdir dir='./tmp' (<)wlserver dir='./tmp' servername='wsant' noExit='true' domainname='wdant' host='WLHOST' port='9033' generateConfig='true' username='weblogic' password='weblogic' action='start'(>) jvmarg value='-XX:MaxPermSize=192m' wlserver #closing wlserver target #closing target project #closing project Execution Results as follows: bash-3.00$ ant Buildfile: build.xml newserver: [delete] Deleting directory /export/home/wluser/testant/tmp [mkdir] Created dir: /export/home/wluser/testant/tmp BUILD SUCCESSFUL Total time: 1 minute 26 seconds [WLServer wsant] Server will not be killed due to noExit flagwsant Noticed following changes to work it properly: 1. The folder name tmp is used for creating domain that can be domain directory path, we change it once the ant script run successful. 2. When I used the e-docs given ant script it is running the server after configuring domain with given parameters and automatically Killing the ant generated process. To stop this added attribute noExit with true as value. 3. The default jvmags to start WebLogic Server not sufficient. it is throughing following Error: java.lang.OutOfMemoryError: PermGen space To resolve this wlserver standalone tag changed to paired tag, and a child tag added as jvmarg. |