After you have deployed your NexJ application, you can access it by opening a URL in a supported web browser.
NexJ strongly recommends clearing or truncating the NJSession table for any upgrade that requires a reseed. Doing so preserves client user states.
Deploying a model
Deploy your application after configuring your application server.
You can deploy more than one model to each application server by using unique names for .ear archive files.
Depending on your permissions and configuration, you can either deploy using NexJ Studio or manually through the command line.
Dynamic deployment is supported. If you need to change some settings and re-deploy the model, you can do so without stopping and restarting the server.
Deploying a workspace model using NexJ Studio
Deploy any model that is open and available in the Model Library. If you are developing the current model, you can deploy the model without having to create a published .jar beforehand. The deployment process will temporarily publish the .jar when deploying to the server.
In order to deploy a workspace model, you must have already configured environment files in the Deployment layer of the model to identify the server and connections that you want to use in your deployment. In addition, the models referenced by the workspace model must be available during deployment.
To deploy a workspace model from NexJ Studio:
-
In the toolbar, click the Set Current Model button
. The Model Library window opens.
-
In the Models tab of the Model Library, select the checkbox for the model that you want to deploy.
-
Ensure that all referenced models, including the base model and any mixins, are available.
-
If the base model is unavailable, a magnifying glass appears in the Base Version column. Click the magnifying glass icon to locate the model.
-
If any mixins are unavailable, a magnifying glass appears in the Upgrade column in the Mixin Models section. Click the magnifying glass icon to locate the model.
-
-
Click Close. The Model view appears with your selected model.
-
In the toolbar, click the down arrow next to the Set Current Server button
. Choose the server or environment file that you want to deploy to.
-
If you selected a server in the previous step, select the associated connection for that server. In the toolbar, click the Set Current Connections button
. Choose the connections that you want to deploy with.
-
Configure the server settings. When changes are made to settings that require server configuration, for example data sources and channels, the server must be configured before deployment. Configuring before deployment ensures that unconfigured settings do not cause errors.
-
To start the configuration process manually from the menu bar, select Project → Configure Server. The configuration process occurs.
-
To enable automatic configuration from the menu bar, select Project → Configure Automatically. NexJ Studio will run the configuration process each time you deploy a model.
-
-
Click the Deploy Model button
to begin deploying to the application server.
NexJ Studio validates the model during deployment. If warnings are detected during the validation, a dialog box will ask you to confirm that you want to continue deploying. If errors are detected, you will be unable to deploy the model until they are resolved.
Deploying a published model using NexJ Studio
Deploy a published model directly from the Base Models tab. If you do not need to customize or develop the model, using a published model allows you to deploy it without having to open it in NexJ Studio.
Before you deploy the model, ensure the following prerequisites are met:
-
The Global environment folder is set in the NexJ Studio preferences, and it points to an existing folder. The global environment folder can be set by selecting Window → Preferences → NexJ Studio.
-
The environment or server file that you configured according to the instructions in Creating environment filesis copied into this folder. If you have not created the environment or server file, you can use the environment file editor in NexJ Studio to do so. A list of global environments can be accessed from the menu bar by selecting Window → Show View → Global Environments. New files can be added to this list through the View Menu button
.
To deploy a published model:
-
In the toolbar, click the Set Current Model button
. The Model Library window opens.
-
Click the Base Models tab.
-
If your model is not listed, add it to the list. Click Add. Navigate to the published model and click Open.
-
Select your model and click Deploy. The Deploying Model dialog opens.
-
In the Server and Connections fields, select the environment or server and connections that you want to use.
The available configurations are taken from the files stored in the global environment folder. -
Select the Configure Automatically option. When changes are made to settings that require server configuration, for example data sources and channels, the server must be configured before deployment. The Configure Automatically option ensures that unconfigured settings do not cause errors.
-
Click OK to begin deploying to the application server.
NexJ Studio validates the model during deployment. If warnings are detected during the validation, a dialog box will ask you to confirm that you want to continue deploying. If errors are detected, you will be unable to deploy the model until they are resolved.
Deploying a model using the command line
You can also deploy a model using the command line through ANT scripts. For more information, see Deploying using the command line.
Deploying multiple models on a single server
It is possible to deploy multiple models on a single server and access a selected model using a unique URL.
You can deploy completely different solutions or multiple copies of the same solution, possibly for different versions of the model.
Setting up multiple model deployment on a single server
By default, when a model is deployed, its environment name or a derivation of the project namespace is added as a suffix to the deployed enterprise archive .ear file, for example, nexj-finance.ear. Multiple .ear files can be deployed onto a single application server and accessed using the URLs specified in the server or environment files. The file name and URL must be different for each model so they do not cause conflicts. However, there are other properties that must be altered in order for multiple models to function without problems.
The following properties must be customized:
Object queue port
By default, the object queue port is set to 1111. This port must be different for every deployed model. To customize the object queue port, open the server or environment file. In the Properties view, locate the messagePort property, under the Queueing category. A unique messagePort must be added for each model.
Ports
Ensure that there are no port conflicts between models. For example, if two models contain UDP channels, they must be configured to use different ports.
Environment names
If you are deploying the same model multiple times, you must enter a unique environment name in the server or environment files. The name can be entered in the Properties view, in the name property within the Deployment category. It is possible to deploy .ear files without a suffix by entering an empty name attribute. An empty name attribute generates a file called nexj.ear.
HTTP server URLs
By default, the server path is /nexj/env, where env is specified in the source as a top level attribute of name or taken from a part of the project namespace if no attribute exists. Specify a unique URL for each model. Different environment names will ensure that unique server URLs are generated by default.
Dynamic metadata deployment of models
Specifying environment properties through a properties file
You can use a properties file to set the environment properties for a model through variables. For more information, see Specifying environment properties through a properties file.
Running deployed applications
After you have deployed your application, you can access it through NexJ Studio, or through a supported browser by specifying a URL.
Launching applications from a browser
After a model is deployed, its applications become available for access through a supported web browser.
To launch an application, enter the application URI (Uniform Resource Identifier) into the browser navigation bar. The URI format depends on whether the application is a portal application, such as NexJ CRM, or a flat web application, such as NexJ Admin Console or NexJ System Admin Console.
Launching portal applications from a browser
The format of the URI is the following:
http://<serverName>:<port>/<context>/<modelName>/SysPortal.htma?app=<appName>
serverName
The name of the server. If you are running your own webserver, this value is localhost.
port
The default port is 8080. If your production system uses the default HTTP port 80, then you do not have to specify the port.
context
The directory on the application server where the model resides. This value is usually nexj.
modelName
This value is optional and only used when multiple models are deployed on the same server. The name of the model. For example: US-Finance.
appName
The name of the application as defined in metadata. For example: Contact.
Advanced users, such as developers, can specify additional attributes after the application name in the URI, by adding a string of the following format: <&attribute=value>. For more information about additional supported attributes, see Attributes and data types | Attributesanddatatypes attributesanddatatypes.
Launching flat web applications from a browser
The format of the URI is the following:
http://<serverName>:<port>/<context>/<modelName>/<appName>.html
serverName
The name of the server. If you are running your own webserver, this value is localhost.
port
The default port is 8080. If your production system uses the default HTTP port 80, then you do not have to specify the port.
context
The directory on the application server where the model resides. This value is usually nexj.
modelName
This value is optional and only used when multiple models are deployed on the same server. The name of the model. For example: US-Finance.
appName
The name of the application as defined in metadata. For example: Admin.
Launching applications from NexJ Studio
You can launch an application from a deployed model using NexJ Studio.
To run your NexJ application from NexJ Studio:
-
In the NexJ Studio toolbar, click the down arrow next to the Set Current Model button
and select a deployed model.
-
Click the down arrow next to the Set Current Server button
and select either an environment file or a server file.
-
In you selected a server file in the previous step, click the down arrow next to the Set Current Connections button and select a connections file.
If you selected an environment file in the previous step, this button will not be active. -
Click the Set current user button
and select the user that you want to access the application as.
If the user you want is not listed, add it by selecting Manage Users... → Add and setting the login name of the new entry. The default NexJ System Administration user name isnexjsa. -
Click the down arrow on the Run application button
, and select one of the following application types:
-
If you will launch a flat web application, such as NexJ Admin Console or NexJ System Admin Console, select Flat Web.
-
If you will launch a portal application, such as NexJ CRM, select the caption that you defined in the portal application strings file. For example, select NexJ Customer Relationship Management (NexJ CRM) .
The application type is selected in the menu.
-
-
Click the down arrow on the Run application button
and select the application that you want to launch. For example, select
NexJ CRM.
The application launches in your default web browser.


