NonStop Application Server for Java (NSASJ) 1.2 User Guide HP Part Number: 715246-003 Published: June 2014 Edition: J06.15 and subsequent J-series RVUs; H06.
© Copyright 2013, 2014 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Contents About This Document.....................................................................................6 Supported Release Version Updates (RVUs)..................................................................................6 Intended Audience....................................................................................................................6 New and Changed Information..................................................................................................
Security subsystem..................................................................................................................55 Transferring client credentials to server..................................................................................56 Realm authentication..........................................................................................................56 Security domains..........................................................................................................
NSASJ Server internals............................................................................................................95 NSASJ Server and JI...........................................................................................................95 NSASJ Server and TS/MP...................................................................................................96 Knobs in NSASJ configuration.............................................................................................
About This Document This manual provides information on NonStop Application Server for Java (NSASJ). It also contains: • Features of NSASJ • How to install and configure NSASJ • How to manage NSASJ using non-GUI and GUI mode of the CLI tool • Demo on a sample Java application • Integrating NSASJ with NSJSP and NSMQ • Information on web container and web subsystem • Integration of web container with EJBs, SQL/MX and NSMQ Supported Release Version Updates (RVUs) This manual supports J06.
• Added information about various integrations with web container “Integrations for Web Container” (page 91). • Added information about singleton timer “Singleton service” (page 108). Document Organization This manual is organized as follows: “Introduction” (page 10) This chapter describes the overview and architectural details of NSASJ. “Features of NSASJ” (page 18) This chapter describes the salient features of NSASJ.
{ } Braces A group of items enclosed in braces is a list from which you must choose one item. For example: -c identity {true|false} | Vertical Line A vertical line separates alternatives in a list that is enclosed in brackets or braces. For example: where [threadID|all] ... Ellipsis An ellipsis immediately following a pair of brackets or braces indicates that you can repeat the enclosed sequence of syntax items any number of times. For example: print {objectID|objectName} ...
HP Encourages Your Comments HP encourages your comments concerning this document. We are committed to providing documentation that meets your needs. Send any errors found, suggestions for improvement, or compliments to docsfeedback@hp.com. Include the document title, part number, and any comment, error found, or suggestion for improvement you have concerning this document.
1 Introduction This chapter provides an introduction to NonStop Application Server for Java (NSASJ), and then introduces you to topics such as Java Enterprise Edition (Java EE), JBoss, and the architecture of NSASJ. NSASJ is a Java EE Application Server which provides an implementation of a subset of Java EE technologies. NSASJ is a port of the open source JBoss Application Server on NonStop platform.
Figure 1 Java EE architecture Applet Container EJB Applet Web Container HTTP SSL JSP Java SE HTTP SSL Application Client Container SAAJ Application Client SAAJ EJB Container EJB Servlet JavaMail Java Persistence JTA Connectors JMS Management WS Metadata Web Services CD&DI JACC JASPC JAXR JAX-RS JAX-WS JAX-RPC SAAJ Java SE Java Persistence Management JMS WS Metadata Web Services CD&DI JAXR JAX-WS JAX-RPC JavaMail Java Persistence JTA Connectors JMS Management WS Metadata Web Services CD&DI JACC
Table 1 Java EE components supported by NSASJ (continued) Component Description NSASJ application components to demarcate the transaction boundaries. It also provides an interface between the transaction manager and a resource manager. Connector The Connector is a Java EE SPI that allows resource adapters support access to Enterprise Information Systems to be plugged into any Java EE product.
can be started either in a standalone or domain mode. JBoss provides standalone and domain deployment models. NSASJ leverages on the domain deployment model of JBoss and the following components constitute JBoss when started in domain mode: • Server: A server is a single instance of JBoss container that provides an implementation of various Java EE technologies. This component processes request for any business service.
Figure 2 NSASJ architecture EJB Client Domain Controller / Host Controller TCP/IP Subsystem (IP-CIP or TCPIPv6) Post Master Post Master TCP/IP Subsystem (IP-CIP or TCPIPv6) Post Master Post Master TS/MP Pathsend API NSASJ NSASJ NSASJ TCP/IP Subsystem (IP-CIP or TCPIPv6) Infinispan Cache CPU 0 Infinispan Cache NSASJ TCP/IP Subsystem (IP-CIP or TCPIPv6) Infinispan Cache CPU 1 CPU 2 Infinispan Cache CPU 3 NonStop Server Components of NSASJ The following list describes the various compon
state of a SFSB (Stateful Session Bean). For more information on Infinispan, see “Infinispan subsystem” (page 53). • Post Master: A Post Master acts as a postmaster between remote Java EE clients and NSASJ Server. Post Master does not participate in data processing. It just acts as an agent, which transfers data between the remoting client and NSASJ serverclass, so that the instances can effectively handle client requests.
Table 3 JBoss subsystems support (continued) Subsystem Name Description EJB3 This is the subsystem that defines the entire infrastructure required by the container to support EJBs. This subsystem does not define the beans. Infinispan This is the subsystem where the Infinispan subsystem configuration is defined. Supported In case of NSASJ, Infinispan is configured in a distributed mode. The EJB subsystem references the Infinispan subsystem for caches and passivation stores.
Table 3 JBoss subsystems support (continued) Subsystem Name Description NSASJ NSASJ does not need this component as it does not interface with any web server. Naming This subsystem can be used to export named resources. Supported OSGi The OSGi subsystem provides a standardized, component-oriented, computing Not Supported environment for networked services. JBoss provides an OSGi framework integrated with the Application Server.
2 Features of NSASJ This chapter describes the following features of NSASJ inherited from NonStop platform: • “High Availability” (page 18) • “Scalability” (page 20) High Availability High Availability (HA) is the ability of NSASJ to maintain the business continuity and service availability at all times by surviving hardware or a network failure.
of instances of NSASJ are always running, and hence, the business services offered by NSASJ are always available. • Infinispan: Each installation of NSASJ has an Infinispan cache cluster to maintain state information. Infinispan cache cluster is configured in such a way that at least one node acts as a backup for another. Thus, all state information is replicated and is available in another node too. Failure of a node does not result in loss of state information.
• ◦ Loading the session data from Infinispan Cache server prevents old session data from being used. ◦ Failure of one or more NSASJ serverclass instances or Infinispan Cache server does not impact the web session replication as NSASJ Server instances are configured in the TS/MP serverclass and the Infinispan Cache servers work in a distributed mode. Stateful session replication handling: State of a Stateful session bean is maintained by Infinispan Cache server across multiple client requests.
Figure 3 Post Master instances for different TCP/IP providers TCPIPv6 IP-CIP Post Master Instances Accessible NOTE: HP recommends IP-CIP for better scalability. NSASJ Server for Scalability A server, in an NSASJ configuration has only one definition but multiple instances of the same server. The server is configured as a TS/MP serverclass and all the instances of the server share the same configuration and set of file system resources.
Figure 4 Data marshalling using Pathsend API and TCP/IP Post Master NSMQ Broker Pathsend API TCP/IP NSASJ Infinispan cluster for Scalability Infinispan cluster, in an NSASJ configuration is a component that stores the state of session beans. The NSASJ Server uses a simple TCP connection to communicate with the Infinispan cluster. The Infinispan configuration in NSASJ ensures that the objects stored in the cluster are distributed evenly across all the nodes of the cluster.
3 Installing NSASJ This chapter discusses the NonStop Application Server for Java (NSASJ) installation script and its prerequisites. This chapter also describes the procedures to install, remove, and repair NSASJ.
1. Double-click the CD drive to open the product CD and then click the setup.exe file. The Independent Products Setup screen appears. 2. Click View the Readme File option. The readme.txt file opens in Notepad. 3. 4. Review the information provided in the readme.txt file and go back to the Independent Products Setup screen. Click Run IPSetup option to launch IPSetup. The Welcome screen appears. NOTE: HP strongly recommends that you exit all Windows applications before running the IPSetup program. 5.
6. Review the License Agreement and do one of the following: a. If you do not want to accept the terms of the agreement, select I do not agree to the above conditions and click Cancel to exit the IPSetup program. b. To accept all the terms of the agreement, select I agree to the above conditions and click Next >. The Placement Options screen appears.
7. Select one of the following as a target platform for your IP software: a. TNS/E for H-series and J-series. b. Workstation to install the IP on your workstation. 8. Do one of the following and click Next >: a. Select the Use DSM/SCM to complete installation on the host check box to launch the DSM/SCM planner interface after completing the IPSetup program. b.
9. From the Available Products: list, select NSASJ as the product you want to install. 10. Click Add->. The selected product moves to the Selected Products list. 11. Click Next >. The Host Information screen appears.
12. Log on to the Host by performing the following steps: a. From the Host name: list, select the IP address of a host system where you want to place the selected product. NOTE: If the IP address of a Host system is not available in the Host name: list, type the IP address. b. c. Enter a user name and password. Select the communication mode. NOTE: Starting with T0316H01^AAK (version 4.1.00.0), IPSetup supports two modes of communication: Telnet and Secure SHell (SSH).
NOTE: • HP recommends that you do not change the default service value unless it is required. • The following are the default port numbers: ◦ SSH port — 22 ◦ Telnet port — 23 ◦ FTP port — 21 For additional port numbers, consult the system administrator. d. Click Next >. The Host Target Settings screen appears. 1. Do one of the following: a. Accept the default location for the work subvolume and the subvolume where the existing files will be backed up from the work subvolume. b.
3. Verify the location where the product files will be placed on the Host system and click Next >. The Placement Manifest screen appears.
4. Verify the details displayed on the Placement Manifest screen and click Next >. If you select the Back up existing host files to: check box in the Host Target Settings screen, IPSetup backs up any existing files to the backup subvolume. If you do not select this check box, IPSetup purges any files in the work subvolume or in the distribution subvolume (DSV) (and installation subvolume (ISV) for IPs) with names identical to files that are about to be placed.
After transferring the installation files, the Placement Complete screen appears.
5. Complete your IPSetup program: a. Select the View the Readme File check box. b. Click Finish. The IPSetup program completes and opens the readme.txt file. The T0950PAX file is located in the volume which is specified during the IPsetup. For example, the screen shot displays $AUDIT as the volume. NOTE: The IPSetup places the pax file in the volume $AUDIT.E0950H01. This pax file can be extracted using the command pax -rvf /G/audit/e0950h01/t0950pax in OSS.
VERSION bin domain infinispan-5.1.4.FINAL versions.txt To run the setup script, complete the following steps: 1. Go to the directory where the setup script is located: OSS: cd / 2. Run the setup script at the OSS prompt: OSS: ./setup NOTE: The setup script has to be run using the korn SHell and not bash SHell.
4. If you want to specify a custom NSASJ installation directory, enter the name when the following message is displayed: Enter a name for the NSASJ installation directory [nsasj]: product The directory product does not exist, do you want to create it (n or [y]): Press y to create a custom directory. On successful creation of custom directory, the following message is displayed: Successfully created directory product.
10. Enter the name of the pathmon when the following message is displayed: Enter the pathmon name [$NSASJ]: $DOC NOTE: The start script which is used to setup the pathway environment uses this as the pathmon name. All NSASJ serverclasses are configured in this pathmon. 11. Enter the name of the NSASJ deployment when the following message is displayed: Enter the NSASJ deployment name for this installation.
NOTE: A user can be added either to the ManagementRealm or ApplicationRealm. ManagementRealm is used to authenticate management users who use the CLI. ApplicationRealm is used to authenticate users who invoke business components such as EJB. 16. What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) a) NOTE: The mgmt-users.properties and application-users.properties are present in /domain/configuration.
Example 1 1. A user is added with username admin and password admin123 to the Application Realm but no role is assigned to this user. The following key-value pair is added to the application-users.properties file in the $NSASJ_HOME/domain/configuration folder. admin=9ef3dd9f0c6012bf01bcc2c31d5cd8b7 2. This key-value pair must be deleted to delete the user admin. If a user test has a role testrole, then this key-value pair must be deleted from the application-roles.properties file.
Table 4 Attributes for pathway environment and NSASJ serverclass (continued) Name Description Mandatory/Optional BIND_ADDRESS Specifies the address on which the NSASJ listens for remote connections. For example, 15.154.120.44. This has no default value. Mandatory CAUTION: This value is populated during NSASJ setup. Manually modifying this value requires modifications to the domain.xml, proxy-conf.xml of OpenPortmapper, and configuration files of cache servers.
Table 4 Attributes for pathway environment and NSASJ serverclass (continued) Name Description Mandatory/Optional NOTE: The value is populated by the setup script, and the value is the default volume for the logged in user. Since, each NSASJ installation needs a guardian sub volume to be configured, this value must be unique for each installation. When a logged in user needs to install multiple NSASJ installations, this value needs to be manually modified for each installation.
Table 5 NSASJ installation directories and files (continued) bin Contains scripts to add user, start and stop an installation, and script to start the management CLI. docs Contains the XML schema definition files. copyright.txt Contains copyright information. domain Contains the configuration files, deployment content, and writable areas used by the XX-server processes and Host Controller. infinispan-5.1.4.FINAL Contains the Infinispan used by the NSASJ installation. install.
Table 6 Repair configuration files Filename Description domain.xml If any changes are done through the management interface, then the Host Controller takes a backup copy in the same folder. Replace the existing domain.xml with the most recent backed up version. If the file is manually modified, and there are no backup copies to replace from, and if the modifications cannot be undone then the file can be replaced with the one from a dummy NSASJ installation.
4 Configuring NSASJ NSASJ comprises multiple components such as Server, Host Controller, Cache Server, and Post Master. Each of these components have a specific set of configuration files defined for them. This chapter explains the different configuration files for each of these components of NSASJ. For more information on the components of NSASJ, see “Components of NSASJ” (page 14).
Table 7 Contents of host.xml Component Description security-realms Within JBoss AS 7, the security realms are used to secure access to the management interfaces. These realms are also used to provide security to resources, which get exposed by JBoss Remoting such as EJB access. They are used to define an identity for the server, where, the identity can be used for both inbound and outbound connections which is established by the server. security-realm The host.
Table 7 Contents of host.xml (continued) Component Description For more information, see https://docs.jboss.org/author/ display/AS71/ Admin+Guide#AdminGuide-CommandLineInterface. domain-controller In NSASJ, there is no distinction between the Host Controller and the Domain Controller. The Host Controller plays the role of Domain Controller. This is indicated by the local child element in the domain-controller. JBoss AS 7 uses named interface references throughout the configuration.
NOTE: An extension module is configured through a corresponding subsystem definition. Table 8 (page 46) lists and describes the extensions and their corresponding subsystem configuration. The following snippet illustrates the various subsystems contained in the domain.xml file: module="org.jboss.as.clustering.
ji.prop This file is used by Java Infrastructure (JI) to convert NSASJ into a TS/MP serverclass. The ji.prop file contains an entry for the public interfaces (remoting port, http and https connector ports) defined in the domain.xml. By default, the files is for format server_socket:. The following is a snippet of ji.prop: server_socket-15.213.84.6:3450 server_socket-15.213.84.6:3459server_socket-15.213.84.6:3460 NOTE: The remoting port as mentioned in domain.xml is 3450, and the ji.
Table 10 Cache server configuration Files Description nsasj-udp.xml This file contains JGroups configuration that is used by the cache servers to form a cluster. The following are some salient features of this configuration: 1. The transport protocol that is used to form the cluster is UDP. 2. The cluster is formed on a multicast address that is obtained from the user during product setup. The multicast port is used to form the cluster is BASE_PORT+7.
proxy-conf.xml This configuration file contains information about the binding port and connection address. The bind port is indicated by the attribute localPort, and the address to which the Post Master connects, is indicated by the attributes dstAddress and dstPort. The following is a snippet: PAGE 50Table 11 Elements of EE subsystem (continued) Element Description NOTE: Module dependencies can also be defined by one of the JBoss specific deployment descriptors such asjboss-deployment-structure.xml. ear-subdeployments-isolated A flag indicating whether each of the sub deployments within a .ear can access classes belonging to another sub deployment within the same .ear. If this is set to false, the classes belonging to other sub deployments within the .
EJB3 subsystem The schema definition for the EJB3 subsystem can be found in the file jboss-as-ejb3_1_3.xsd in the docs/schema folder of the NSASJ installation. The following is a snippet from domain.xml: PAGE 52Table 12 Components of EJB3 (continued) Attributes Description The following is the attribute for the same:resource-adapter-name: This is the name of the resource adapter deployment. The default value is nsmq-rar-1.0. bean-instance-pool-ref This element is used to configure the instance pool that is used by default for Message Driven Beans. If this element is not present, then MDBs are not pooled and a new instance is created for every invocation.
Table 12 Components of EJB3 (continued) Attributes Description If it is remoting, then the option needs to be defined in org.jboss.remoting3.RemotingOptions class. • name: This is the name of the option that is to be set. For example, READ_TIMEOUT (if the type is xnio), and MAX_OUTBOUND_MESSAGE (if the type is remoting). • value: This is the value of the option that is to be set. Infinispan subsystem Infinispan is used as the cache container in NSASJ (inherited from JBoss AS).
Table 13 Components of Infinispan (continued) Component Element/Attribute • default-cache: Each cache container can contain multiple caches. The default configuration of the cache container has only one local-cache named local-ejb. • module: The module whose class loader must be used to build this cache container. The following is a snippet: PAGE 55Table 13 Components of Infinispan (continued) Component Element/Attribute must contain all the data in memory so that other instances of NSASJ have access to the data. • purge: If set to true, the store is purged when the cache starts. In case of NSASJ, it is set to false, as it is urged that a new NSASJ instance must not purge the cache store. Security subsystem The subsequent explanation is intended only to get an overview of all the different components and their corresponding roles.
.......... .......... For more information on the default configuration, see https://docs.jboss.
authorization action. The actual authorization is done during the invocation of a container resource such as an EJB. • server-identities: This is used to enable SSL communication between remote client and server. For more information, see https://docs.jboss.org/author/display/AS71/ Admin+Guide#AdminGuide-OutOfTheBoxConfiguration. The default configuration of ManagementRealm and ApplicationRealm are configured for both local authentication mechanism (using the local element) and digest authentication.
Table 14 (page 58) lists the components of the Web subsystem, and then discusses the attributes comprising it. Table 14 Components of Web subsystem Component Element/Attribute connector Represents the interface between external clients sending requests and receiving responses from a particular service. In addition to the ability to execute Servlets and JSP pages, the connector component enables Catalina to function as a standalone web server.
The security constraint is specified in the web.xml file and any of the security mechanisms, namely BASIC, FORM based, or Client CERT based in the login-config tag of the web.xml file. The following example provides a sample configuration from web.
store as illustrated in Figure 2 (page 14). In NSASJ, the embedded caches are in local mode and do not share any data. Instead, when the clustered session information is put into the cache, it is evicted to the remote backup store in the Infinispan Cache servers. Session data requests are obtained by querying the remote backup store in Infinispan Cache servers. Thus, when requests span across instances of NSASJ, the most recent data is obtained from the remote store.
Table 15 Components of domain.xml (continued) Element Attribute Description tcp-no-delay The tcp-no-delay must be set to true so that every request is followed by a response. Write-read-write-read sequence is followed. shared Shared is set to true because the same cache store is shared across multiple cache loaders. pre-load The pre-load is set to true so that the data stored in the remote store is loaded to the cache loader on NSASJ startup.
Table 16 Components of nsasj.xml (continued) Element Attribute Description hash numVirtualNode Allows fine tuning of rehashing characteristics. The numVirutalNodes allows better distribution of data among the nodes. Currently it is set to 4 for 2 real nodes. numOwners Number of cluster wide replicas for each cache entry. Set to 2 to avoid single point of failure. Expiration and Eviction from Infinispan Cache servers Expiration and Eviction refer to cleaning the cache of unused cache entries.
sure that the session entry is removed from the remote servers, the attribute of the element of the namedCache must be set to the session-timeout value. Also, the element of the element must be set to the maxInactiveInterval of the application. This configuration ensures entries are cleared from the Infinispan Cache servers on expiration of session. Java Persistence API subsystem This subsystem is used to configure the default for JPA.
nsmq.jndi.properties This file contains mapping data that is required to create the admin objects of NSMQ. The format of the mappings is =. If the JNDI name refers to a connection factory then the value should be the brokerURL. For example, java\:jboss/exported/jms/RemoteConnectionFactory=tcp:// 15.154.120.44:7900 NOTE: The : is escaped as it is a special character. It needs to be escaped only in the key.
DataSource A DataSource is a repository for connections to the physical data source. A DataSource is mainly used to pool connections and cache statements. Application Servers like JBoss provide wrapper DataSources that wrap around a driver DataSource to give additional functionality. Some features of the wrapper DataSource are discussed later. Configuring DataSource in NSASJ Configuring a DataSource in NSASJ involves the following steps: 1. Installing the JDBC driver 2.
1. Define the dependencies in the META-INF/MANIFEST.MF class of the driver. This can be done by adding a Dependencies: in the manifest file of the driver. NOTE: Here module refers to an NSASJ module that contains the dependency jars. Making this entry in the manifest file of the driver jar might have undesirable side effects when the driver jar is used in any other Application Server, or a managed environment.
Table 19 Elements of DataSource configuration Elements Description datasource This element defines a datasource. The following are some of the attributes of this element: • jta: Setting this attribute to true makes the DataSource participate in a JTA transaction. The default value is true. If set to false, the DataSource does not participates in the JTA transaction. This can be particularly useful in NSASJ and SQL/MX T4 when the useExternalTransaction attribute is set.
• Enabling container pooling enables to manage the connections through CLI. • Statement caching can be enabled in the datasources/datasource/statement element. For more information, see tables 5.15 Pool settings and 5.20 Statement settings at the http://docs.jboss.org/ironjacamar/userguide/1.0/en-US/html/ deployment.html#deployingds_descriptor site that explains all the attributes that can be configured while defining the connection pool and statement caching.
propagated to the TS/MP serverclasses. As a result, the TS/MP serverclass becomes a part of the JTA transaction context. • The state of the TMF transaction remains the same as that of the XA transaction. For example, whenever an XA transaction is rolled back, the corresponding TMF transaction gets rolled back too. NOTE: NSASJ can run in 64-bit mode from AAC SPR. 64-bit mode can be selected either during installation or by changing the JAVA_MODE variable in $NSASJ_HOME/config.prop to JAVA_MODE=64bit.
A State Less Session Bean gets invoked within an XA transaction, and the business logic of the bean needs it to invoke a legacy platform service in the form of a TS/MP serverclass with the help of JPathsend API. In such a case, non-XA resource, like the serverclass invocation is expected to take part in the global transaction and hence, the resources accessed by the serverclass also become an integral part of the global transaction.
Non XA resources in a transaction The default behavior of the transaction manager requires all transactional resources to participate in 2pc protocol. This restriction is relaxed for at most one branch, which, means of all the transaction branches, only one branch can select not to participate in 2pc protocol. This branch gets committed first after all the branches are prepared for commit.
recovery log for XARM, the transaction manager is made aware of the fact that the XAResource (in this case the XARM) does not participate in 2pc protocol. If an XAResource implements a certain marker interface, JBoss transactions assume that the XAResource does not participate in 2pc protocol. The configuration attribute xarm.onePhaseCommit in $NSASJ_HOME/modules/ com/hp/nsk/xares/wrapper/main/xarm.properties file can be used to control the behavior of XARM.
Table 22 Elements of transaction subsystem (continued) Attributes Description NOTE: In this release of NSASJ each instance runs a recovery manager and a status manager. In future releases there will be one instance of recovery manager that will query the status manager on each NSASJ instance and perform the recovery operation. coordinator-environment The following are the attributes defined in this element: • default-timeout: Specifies the default transaction timeout in seconds.
The file to which boot messages are written can be controlled by the system property org.jboss.boot.log.file. The following table shows the system property values for the host controller and server instances. System Properties Server instances / domain/servers/nsasj-server/log/server.log Host Controller / domain/log/host-controller.log Logging subsystem configuration in domain.xml The logging subsystem follows the schema defined in jboss-as-logging_1_1.xsd.
Log handlers A logger can be configured with one or more handlers. Upon receiving a log message, the logger provides the handler the message to publish. The handlers are configured to format the log message, and then publish them to a destination configured in the handler. NSASJ provides multiple handler implementations. Table 23 (page 75) lists all such handlers and provides description for them.
Table 24 Symbols and descriptions (continued) Symbols Description %E Specifies the stack trace of any exception that needs to be logged. The information that is logged contains extended module information. %F Specifies the file name of the class that is calling the log method. %k Specifies the resource key (if any) of the log message. %l Specifies the complete source location information. The output is equivalent to %C.%M(%F:%L).
Table 25 Filters and conditions (continued) Filter Name Type Description deny Standalone This filter always returns a value false. not Composite This filter negates the decision of its child filter. This filter accepts just one child element, and is also called the NOT filter. match Standalone This filter returns a value true if the non localized raw message matches the pattern. This filter defines an attribute by name pattern which can contain any regular expression.
1. 2. This is a properties file with name value pairs with = as the separator. A key with the name loggers defines all loggers that are configured. For example, loggers = com.hp.nonstop.sample, org.jboss.as.ejb3. Where, these two are two different loggers with log categories as com.hp.nonstop.sample and org.jboss.as.ejb3. 3. 4. 5. 6. A key with the name handlers defines all handlers. a. It is not mandatory to define all the handlers with a handlers key. b.
• encoding attribute defines the character encoding to use while publishing a message. • handlers attribute defines that if this handler is an ASYNC handler, then this attribute contains a comma separated list of all handlers where the message needs to be published. 10. Filter Expressions • A filter expression is used to configure the predefined filters. • The predefined filters are identified by literals.
5 Managing NSASJ JBoss provides multiple management interfaces while NSASJ supports only a few of them. These management interfaces are used to configure and manage servers.The following table compares the management interfaces between JBoss and NSASJ: Management Interface Description JBoss NSASJ Web Management Interface The web interface is a Supported Google Web Toolkit (GWT) application that uses the HTTP management API to configure and manage a JBoss domain.
Perform the following step to start CLI in non-GUI mode in the command prompt on Windows:Run the jboss-cli.bat --connect --controller=: command from the bin folder to connect to the Host Controller. Perform the following step to start CLI in non-GUI mode in the OSS prompt of NonStop: Run the jboss-cli.sh --connect --controller=: command at the OSS prompt to connect to the Host Controller. Where, jboss-cli.sh is located in the bin folder of .
CLI provides an option to execute operations on a node. The operation read-children-types lists the types of child elements of a node. The operation read-children-names lists all the child elements of a node. For more information, see the Management Resources described in https://docs.jboss.org/auth. Attributes Each management resource exposes information about its state as attributes. Each attribute is composed of an attribute type and attribute value.
NSASJ supports all the operations and functionalities supported by the web console of JBoss with the exception of the following: • Starting servers • Adding server groups • OSGI • Web Services HP recommends to access the web management console over HTTPS in a secured manner. The NSASJ web management console extends this feature from the JBoss management console and provides this feature.
Working with the Runtime tab Runtime tab enables you to view and modify the runtime state of the NSASJ Server instances. It also enables you to manage deployments for NSASJ. NOTE: 84 HP recommends to use Internet Explorer 9.0 or later versions to view this video.
Working with the Server tab Server tab enables you to view and modify the overall configuration of NSASJ Server. Through this tab, you can also administer the common management policy for a set of servers. NOTE: HP recommends to use Internet Explorer 9.0 or later versions to view this video.
Working with the Profiles tab Profiles tab enables you to configure the various subsystems contained in NSASJ. Most importantly, you can use this tab to administer a datasource. NOTE: 86 HP recommends to use Internet Explorer 9.0 or later versions to view this video.
Managing NSASJ using Java programs JBoss provides management APIs which can be used for managing the resources. These APIs are packaged in org.jboss.dmr and org.jboss.as.controller.client. NSASJ provides a wrapper over ModelControllerClient to easily connect to NSASJ's native management port. This wrapper is provided as a module com.hp.nsk.client-demo. To create a Java management program, extend the class com.hp.nsk.nsasj.client.NSASJClient and override the executeCommand method.
/*Copyright 2013 Hewlett-Packard Development Company, L.P. */ /** * WhoAmIClient is a sample nsasj client program that demonstrates the usage * of com.hp.nsk.nsasj.client.NSASJClient to get information about the user connected * to the host controlller. * */ package com.hp.nsk.nsasj.client.demo; import org.jboss.dmr.ModelNode import com.hp.nsk.nsasj.client.NSASJClient; public class WhoAmIClient extends NSASJClient { /** * method - main().
/** * Create the org.jboss.dmr.ModelNode to hold the result */ ModelNode returnVal = null; try { /** * Execute the command using the client object */ returnVal = this.client.execute(op); } catch (Exception e) { System.err.println(e.getMessage()); if (this.client != null) this.disconnectFromHC(); System.exit(0); } System.out.println("Logged in as : " + returnVal.get("result").asString()); } public static String hostControllerName = "master"; } For more information on Management Client API, see https://docs.
6 Integration Integrations for EJB Container Integration of NSASJ with NSJSP NSJSP is a Servlets and JavaServer Pages (JSP) container available on HP NonStop operating systems. A servlet container provides an environment in which you can deploy, execute, and manage web applications based on servlets or JSPs. NSJSP is written in Java, and it offers a standards-based environment to host Java Servlet and JSP applications.
ServerUrl java.lang.String tcp://localhost:61616 • Change the authentication details : Username UserName java.lang.
Example 3 Sample snippet public class SomeServlet extends HttpServlet { private static final long serialVersionUID = 1L; @EJB(mappedName = "java:global/SomeSessionBean/SomeBean!com.hp.nsasj.sample.SomeBean") SomeBean bean; public SomeServlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(bean.
7 Internal description of NSASJ components This chapter provides details about the various components of NSASJ through different questions and answers. It also provides an insight into the internal working of NSASJ with various other components outside NSASJ. In this edition, only Post Master and NSASJ Server internal details are documented and the other components will get appended in subsequent versions of this manual.
There is a limit on the number of client connections a single instance of Post Master can handle. As explained in JI, each connection results in a Pathsend dialog being established with the serverclass. TS/MP limits the number of outstanding dialogs to 256 per requestor. In case of NSASJ, the requestor process is the Post Master process. Hence, the number of client connections that a Post Master can handle simultaneously is 256.
NOTE: If the size of the data exchanged between the client and server exceeds the send and receive buffer sizes (see SO_SNDBUF and SO_RCVBUF in the API doc for java.nio.channels.SocketChannel), the number of I/Os also increase as the data is sent in chunks of size defined by the buffer sizes. An EJB client can set the buffer sizes in the jboss-ejb-client.properties file using the org.xnio.Options.RECEIVE_BUFFER and org.xnio.Options.SEND_BUFFER options.
NSASJ Server and TS/MP As already stated NSASJ Server is configured as a TS/MP serverclass. The following explains the serverclass configuration parameters: MAXLINKS This is the maximum number of links that can be granted to an instance of the serverclass. A link is established (or an existing link re-used) when the Post Master establishes a connection with the serverclass. So this means a maximum of MAXLINKS number of simultaneous connections can be established per serverclass instance.
NSASJ Server and TMF NSASJ Server integrates with TMF to provide unified standards based transaction interface in the form of JTA. The subsequent subsection first explains the internals of the JTA implementation and then explains how it integrates with TMF. JBoss AS ships with an inbuilt Transaction Manager. The Transaction Manager is infact an independent JBoss product by name Narayana (alias JBoss TS). NonStop provides a product by name XARM which is a Resouce Manager for TMF.
useExternalTransaction. When this attributes is turned ON, the JDBC driver does not start any TMF transaction of its own and performs work in the transaction context of the calling thread. In NSASJ the transaction of the calling thread is initiated and controlled by XARM. When the application executes any DML statements and when the container (or the application) commits the transaction, XARM too being a participant tries to commit the TMF transaction.
A Programmatic Management of NSASJ using API NSASJ provides different approaches to configure, manage and monitor servers. One of them is Java based programmatic management using the Management Client API. Since, all the NSASJ Management resources are exposed through management API in Java, this is a good approach in the production environment to customize and carry out a set of repeatable tasks on the Application Server.
Table 26 Sample program details (continued) Program Description application demonstrates how to execute a command on any individual instance of the NSASJ serverclass and also on host-controller. Sample program code NSASJVersionClient.java sample program /*Copyright 2013 Hewlett-Packard Development Company, L.P. */ /** * NSASJVersionClient is a sample nsasj management client program that demonstrates the usage * of NSASJClient to get information about the NSASJ Server */ package com.hp.nsk.nsasj.client.
} } NSASJEJBStatisticsClient.java sample program /*Copyright 2013 Hewlett-Packard Development Company, L.P. */ /** * NSASJEJBStatisticsClient is a sample nsasj client program that demonstrates how to * get and set values of profile parameters using NSASJClient * */ package com.hp.nsk.nsasj.client.demo; import org.jboss.dmr.ModelNode; import org.jboss.logging.Logger; import com.hp.nsk.nsasj.client.
} public static void main(String[] args) { NSASJEJBStatisticsClient obj = null; // Initialize the logger System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager"); System.setProperty("logging.configuration", "file:logging.properties"); Logger logger1 = Logger.getLogger("NSASJClient", "com.hp.nonstop.nsasj.client.demo"); // Get the args if (args.length > 2) { System.out .println("Usage : java com.hp.nonstop.nsasj.client.demo.NSASJVersionClient
} /** * shutdownshutdownServer method - shutsdown a given NSASJ Server instance * * @param - serverName name of the server (like nsasj-server:cpu,pin) * @return - void */ private void shutdownServerClass() { try { SvClassInstances svci = new SvClassInstances(this.pmon, this.serverClassName); ModelNode op = new ModelNode(); op.get("operation").set("shutdown"); ModelNode address = op.get("address"); address.
address.add("host", hostControllerName); address.add("server", this.serverName); logger.info("The command being executed is --" + op.asString()); ModelNode returnVal = client.execute(op); String result = returnVal.get("outcome").toString(); logger.info("Result : " + result); System.out.println("Stopped NSASJ server instance " + serverName ); } else { logger.error("Server name cannot be null"); } } catch (Exception e) { logger.error(e.getMessage()); e.
public static void main(String[] args) { ShutdownClient obj = null; // Initialize the logger System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager"); System.setProperty("logging.configuration", "file:logging.properties"); Logger logger1 = Logger.getLogger("NSASJClient", "com.hp.nonstop.nsasj.client.demo"); // Get the arguments if (args.length < 2 || (args.length == 0 && args[0] == "--help")) { System.out .println("Usage : java com.hp.nonstop.nsasj.client.demo.
* Constructor - Instantiates the NSASJ Client Object. The NSASJ Client Objec is used to connect * to host controller, execute commands and disconnect from HC * * @param - properties file that contains the connection params * */ public NSASJClient(String propFile) { Properties connProp; try { connProp = Utility.getClientProperties(propFile); if (connProp.containsKey("host") && connProp.getProperty("host") != null) this.host = connProp.getProperty("host"); if (connProp.containsKey("port") && connProp.
ncb.setName(new String(username)); } else if (current instanceof PasswordCallback) { PasswordCallback pcb = (PasswordCallback) current; logger.trace("\n\t\tpcb.setPassword() = " + new String(password)); pcb.setPassword(password); } else if (current instanceof RealmCallback) { RealmCallback rcb = (RealmCallback) current; logger.trace("\n\t\trcb.getDefaulttest() = " + rcb.getDefaultText()); rcb.
B Singleton service This appendix briefly explains the way NSASJ implements the cluster wide singleton service. This feature is often used by applications to run the singleton on only one instance in a highly available JBoss cluster. The cluster wide singleton service is a JBoss specific feature and is not specified in the Java EE spec. This feature must not be mistaken for the Singleton Session Bean defined in the EJB specification.
Limitations When the master node gets killed, NSASJ still depends on JGroups to intimate the container of a change in the cluster constitution. When JBoss runs on a platform such as Windows, each node gets the intimation within a few seconds. While on NonStop, the intimation goes to other nodes after an extended duration of several minutes. On occasions it is observed that the change in the cluster structure is not communicated at all.
NOTE: • It is possible for the application to provide its own election policy to pick the master. NSASJ has made the TS/MP related changes to the default election policy chosen by the JEE container. • The application that is hosted in the above mentioned JBoss Web site is written for JBoss AS 7.2 while NSASJ is a port of JBoss 7.1.2. If the application is built as is, and is deployed in NSASJ, a java.lang.NoSuchMethodError is returned. The method SingletonService.
C Frequently asked questions 1. How do I know when the server has completely started and ready to service requests? Look at the server.log file in /domain/servers/nsasj-server/log folder. A message like JBoss AS 7.1.2.Final "Steropes" started in 6155ms - Started 119 of 179 services (60 services are passive or on-demand) indicates that the server is started and ready to process requests. 2. Is there a way to know what NonStop processes constitute my NSASJ environment? Yes.
5. Am trying to invoke a Stateful Session Bean but am getting a SASL exception. Am sure that I have provided the right credentials. How do I fix this problem? The jboss-ejb-client.properties should contain authentication information for the cluster too. The following is a complete listing of jboss-ejb-client.properties that is used to successfully invoke a Stateful Session Bean on NSASJ. remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false remote.connections=default remote.
9. I see an error -7 in the server log file. What is this? NSASJ uses XARM library to integrate with TMF which in turn uses recoverable resource Managers. This error occurs when a new resource manager cannot be created in TMF. When this error occurs, check the RESOURCEMANAGER count in TMF and delete the closed RESOURCEMANAGERs. There is also an option to alter the number of recoverable resource managers that can be registered for the entire TMF subsystem.
Index Background of JBoss, 12 Infinispan subsystem, 53 Installation directories, 40 Installation directory structure, 40 Installing NSASJ, 23 Running NSASJ, 38 Installing NSASJ from CD, 23 Integration, 90 C J Cache Server Configuration, 40 CLI tool in GUI mode CLI tool in non-GUI mode, 80 CLI tool on Windows, 80 CMP, 15 Command Line Interface, 80 Comparison of JBoss and NSASJ, 15 Components of NSASJ, 14 ConfigAdmin, 15 Configuring DataSource in NSASJ, 65 Configuring NSASJ, 43 Connection, 64 Connection
O X On-platform CLI, 82 Operations, 82 OSGi, 17 XARM, 71 P Pathway Configuration, 39 Pathway environment attributes, 40 Post Master, 15, 20 Post Master configuration, 48 Post Master Server Configuration, 40 Process Controller, 13, 15 Profile, 13 R Realm authentication, 56 Recovery logs, 70 Remote EJB method invocation, 19 Remote Object Lookup, 19 Remoting, 17 Removing NSASJ configuration, 41 Repairing NSASJ installation, 41 Resource Adapters, 17 Root logger, 74 Running the IPSetup program, 23–24 S SAR