![]() |
|
Pramati Server provides a command line interface, the Pramati Server Shell, using which you can perform various Server-related tasks, such as deploying and checking status, from local and remote machines. These tasks can be performed in two modes:
<install_dir>\server\bin\. These batch files are specific to the operating system the server is installed on.
runServer.bat.
runServer.sh. This starts the Server main shell and displays the default prompt.
The following start up options are available for starting the server.
Starting Server in Verbose mode
This option starts the server in verbose mode. In the verbose mode, a comprehensive list of all the configuration properties is displayed.
> ./runserver.sh -verbose
Starting and Stopping Deployed Applications at Server Startup
Applications can be started at server startup using the -startapps option. This option starts all applications that are deployed on the server. Applications can also be configured to be started at server startup by setting the auto-start tag in pramati-j2ee-server.xml of the deployed applications to true:
<auto-start>TRUE</auto-start>If applications are configured with the
auto-start property as false, they will not be started at server startup. To start applications at server startup, the startapps option is used:
> ./runserver.sh -startappsSimilarly, to prevent starting of applications at server startup, the following command can be used. The false option below implies that no application will start, regardless of the application level settings.
> ./runserver.sh -startapps false
Disabling Shell Prompt at Server Startup
By default, when the Server is started, the shell prompt is made available for general administration. The shell can be disabled by using the -noshell option as:
> ./runserver.sh -noshell
Redirecting Output at Server Startup
Server output can be redirected at server startup using the -redirect option.
> ./runserver.sh -redirectThis enables all server output to be redirected to a file. The following two files are created in the logs directory of the started node:
stdErr.log: This file contains information about any errors that might have occurred when server starts up.stdOut.log: This file contains information about all server messages generated at server startup.Starting Server With Username and Password
Server can be started by providing a username and password at server startup by using the -user and -password options. This prompts you for the username and password at server startup.
> ./runserver.sh -user root -password
Starting Server in Realms
The server can be started in a realm by using the -realm option. This starts the server for that realm. The default realm is system.
> ./runserver.sh -realm
Performing Cleanup at Server Startup
Certain cleanup operations can be performed at server startup. For example, corrupted directories are cleaned up at the time the server starts. The -cleanupapps option does this:
>./runserver.sh -cleanupapps
Testing JDBC Resources at Server Startup
JDBC resource can be tested at server startup by using the -testJDBCResources option. If a JDBC resource test fails, an error will show up as shown below:
Error while attempting to get a Connection for the ConnectionFactory [Doc_CF] 2:52:58 PM- Doc_CF [ FAILED ]JDBC resources include JDBC Connection factories, Data Sources, and clustered Data Sources.
. /runserver.sh -verbose -testJDBCResources
Specifying Nodes at Server Startup
Pramati server can be configured with various nodes. Each node is an instance of the server. A particular node can be started by using the -nodedir option.
> ./runserver.sh -nodedir myNode
Synchronizing Nodes in Clusters at Server Startup
In a clustered scenario, configuration of other nodes can be synched up at server start up. This option uploads the configuration of the node to the database.
> ./runserver.sh -uploadconfig
The j2eeadmin@default:> prompt indicates that you are attached to the J2EE Shell, and connected to the default Server node.
remoteshell.bat or remoteshell.sh located at <install_dir>\server\bin\. These files can be run to connect to a Server instance running on a different machine. The command must be executed from <install-dir>\server. The shell opens with the prompt:
not connected:>
This indicates that the shell is currently not connected to any server. To connect it interactively to a server, use the command: connect <enter>
This prompts you for entering the following parameters:
ipaddress[localhost]: naming port[9191]: realm [system]: user name[root]: password[*******]:
The default values are provided in square brackets, to accept the default values, press Enter. You can also use connect -file <filename _moz-userdefined=""> where <filename _moz-userdefined=""> is the name of the file that stores the connection data in the following format: <filename></filename>.
connect -ip <ip> -port <port> -realm <realm> -user <user> -password <password>
For example, connect -ip 127.0.0.1 -port 9191 -realm realm -user root -password pramati
This connects the shell to the server running on the localhost with the naming service started on port 9191. The default user name is root and password is pramati.
C:\PServer50_1016\server\bin>runserver -restore.
Alternatively, for named backups, the name of the Configuration backup can be specified. For example: C:\PServer50_1016\server\bin>runserver -restore backupJune06.
Table 1: List of Generic Commands
| Command | Description |
|---|---|
| shelp | Displays help messages for the generic shell commands. If you want help for a particular command, go to the shell and use the 'help' command. |
| chsh | Changes to a different shell. This prompts you for the shell that you want to change to. |
| reset | Resets all shell props - history for all shells, aliases etc. |
refreshprops <file> | Sets all shell properties from the file. The props file can be like: alias <name>=<value> (for setting aliases) or <variable>=<value> (variable is a shell property like verbose). |
refreshcommandprops <file> |
Loads new commands from the specified file. |
alias <name>=<value> |
Sets the alias. If there are no arguments, this command prints out the current aliases. |
history command no |
Prints the history for that shell if there are no arguments, else, executes the command at the specified command number. |
- command no |
Executes the shell command corresponding to command no. If there are no arguments, prints out the history for that shell. |
| exit | Exits from the current shell and return to the previous shell. |
| set | Sets the shell’s property. It is by default set to true. It can be set to false by using the command set verbose=false (note that there are no spaces for the name value pair "verbose=false"). This command can be used in cases where you don’t want exceptions/errors to be displayed on the console (for example, errors while deployment can be suppressed using the set verbose system property to false). |
!<native command> |
Executes a native command. |
| printerr | Prints the last exception stack trace (useful in non verbose mode). |
<command> > <file_name> |
Redirects command output to the specified file. For example, using help > help.txt redirects the output of the command help to help.txt. |
process <batch_file_name> |
Executes the commands in the batch file. |
Typing any available shell name inside any shell takes you to that Shell.
Table 2: Description of J2EE Shell commands
| Command | Description |
|---|---|
| help command | Displays help messages. If command name is provided, it provides a more detailed usage help for that command. |
| classloader_debug | Sets classloader debugging on/off. |
| config | Allows you to create backups of the server configuration files. Create a backup of the current server configuration. To learn more about how to use this command refer to Backing Up and Restoring Server Configuration. |
| deploy | Deploys the given ear/jar/rar/war on the server. |
| deploygroup | Deploys multiple applications as part of a group. |
| deploytool | Brings up the deploy tool connected to the Server for specifying bean references and deploying applications. |
| detectDeadlock | Detects application level deadlocks for CMP and BMP beans. Detects any deadlocks that have occurred on the current server instance. To know more about dead lock detection read Configuring EJB Server. |
| distribute_app | Distributes a deployed application or par file to a Server. |
| http_accept | Stops/starts the Web Server from accepting HTTP requests. |
| license_details | Displays information about the current server license. |
| list | Displays the list of all deployed applications on the Server. |
| list_system_properties | Displays the list of the system properties set in the server VM. |
| make_par | Makes a prepared archive (*.par) file which is distributable, and saves it in the parchives directory, under the archives directory. |
| migrate_config | Migrates a JBoss/Weblogic archive to Pramati. |
| prepare | Prepares the ear/jar/war/rar at the given path. |
| remove | Removes the application from the Server if it is not running. |
| set_system_property | Sets a system property on the Server VM. |
| setdebug | Turns on/off the debug mode of the Server. |
| setverbose | Sets the verbose method on or off. |
| shutdown | Shuts down the Server and releases all resources being held by it. |
| ssl_accept | Stops/starts the Web Server from accepting SSL requests. |
| start | Starts the application that is already deployed but not active. |
| start_request_sniff | This command starts request sniffing and analyzing what is happening to a request when it is being processed by the Server. |
| status | Shows details of J2EE services - naming, resources, transactions, EJB and Web containers, load balancer (for the Web request dispatcher, if enabled), and cluster (if the service is enabled), socket, and session. Use the resource-name for resource service. |
| stop | Similar to the undeploy function, but only stops the currently running application and does not remove the ear from the file system. The application may be restarted without redeploying it. |
| stop_request_sniff | Stops request sniffing. |
| support | Generates a zipped archive containing config and log files. |
| trace | Enables selective debug tracing in the Server. |
| undeploy | Undeploys the application(s) from the Server. Stops the application, if necessary, and removes the application from the archives directory in the server installation directory. |
| upgrade_license | Upgrades the current license with the new key. |
| validateappstart | Validates an archive that has been deployed but not started. |
| validatearchive | Validates the ear/jar/war at the given path. |
| who_load_me | Determines the loading classloader for a class. |
| whoami | Prints the current user and system information. |
Table 3: Commands in the Resource Shell
| Command | Description |
|---|---|
| help command | Displays help messages. If command name is provided, it provides a more detailed usage help for that command. |
| list | Lists all the resources on the Server. |
| add_datasource | Adds a datasource on the Server. |
| add_jca_cf | Adds a JCA Connection Factory for a connector. |
| add_jdbc_cf | Adds a a JDBC Connection Factory. |
| add_jmsadapter | Adds a configured JMS adapter. |
| add_mailresource | Adds a mail resource on the Server. |
| add_urlresource | Adds a URL resource on the Server. |
| clear_ps_cache | Clears the prepared statement caches of the free connections. |
| create_cluster_generic_resource | Creates a clustered generic resource. |
| create_generic_resource | Creates a generic resource. |
| remove_cluster_generic_resource | Removes a generic resource on cluster. |
| remove_datasource | Removes a datasource from the Server. |
| remove_generic_resource | Removes a generic resource. |
| remove_jca_cf | Removes a configured JCA Connection Factory. |
| remove_jdbc_cf | Removes a configured JDBC Connection Factory. |
| remove_jmsadapter | Deletes a configured JMS adapter. |
| remove_mailresource | Removes a mail resource from the Server. |
| remove_urlresource | Removes a URL resource from the Server. |
| start_cluster_generic_resource | Starts a generic resource on cluster. |
| start_generic_resource | Starts a generic resource. |
| start_tracking | Starts connection tracking for the specified datasource. |
| stop_cluster_generic_resource | Stops a generic resource on cluster. |
| stop_generic_resource | Stops a generic resource. |
| stop_tracking | Stops connection tracking for the specified datasource. |
Table 4: Commands in the JMS Shell
| Command | Description |
|---|---|
| help command | Displays help messages. If command name is provided, it provides a more detailed usage help for that command. |
| list | Lists names of bound topics/queues/factories. This command is deprecated. |
| activate | Activates the JMS Service. |
| add | Adds an administered object - topic, queue, topic Connection Factory, Queue Connection Factory, XA Topic Connection Factory, and XA Queue Connection Factory. |
| cleanup | Cleanup the messages in the server and also from message store. |
| delete | Deletes an administered Object Topic, Queue, Topic Connection Factory, Queue Connection Factory, XA topic Connection Factory, and XA queue Connection Factory. |
| deregister | Forcibly deregisters the client. |
| java | Executes a JAVA Command given the class name and parameters. |
| pause | Pauses the delivery from the specified destination. |
| purge | Purges a queue. All messages held in queue are lost. |
| resume | Resumes the delivery from the specified destination. |
| set | Sets server configuration parameters such as maximum cache size of a destination, maximum memory size for the destination, redelivery limit for queue, redelivery limit policy for queue, or redelivery delay for queue. |
| show | Shows the server statistics for memory/clients. |
| shutdown | Shuts down the Message Server. |
| status | Shows the status of various resources on the Message Server. |
| timer | Gives the status of timer. |
| trace | Reloads tracing information from the current file or loads it from a new file. |
| unsubscribe | Unsubscribes the durable subscriber given the clientID and subscriber name. |
To access this shell, type chsh and choose the number corresponding to the kernel shell or type kernel directly at the command prompt.
The shell prompt changes to kerneladmin@<server_name _moz-userdefined=""></server_name>
A list of commands is displayed on first entry into the shell. Typing help also displays the same information.
Table 5: Commands in the Kernel Shell
| Command | Description |
|---|---|
| help command | Displays all the commands in this shell along with a brief description. If command name is provided, it provides a more detailed usage help for that command. |
| add_service | Adds a deployable and restartable service at runtime. The service must implement the com.pramati.services.framework.RestartableService interface. |
| create_cluster | This command creates a J2EE/JMS cluster configuration. |
| create_node | This command creates a J2EE/JMS node. |
| get_config | Displays configuration information of the service whose name is specified as an argument to the command. |
| remove_service | Removes a deployable/restartable service at runtime. The service must implement the com.pramati.services.framework.RestartableService interface. |
| service_status | Displays the status of services on the Server. |
| start_service | Starts a deployable/restartable service at runtime. The service must implement the com.pramati.services.framework.RestartableService interface. |
| stop_service | Stops a deployable/restartable service at runtime. The service must implement the com.pramati.services.framework.RestartableService interface. |
sqlsh at the Server prompt. The shell prompt changes to sqlsh>.
You can specify the following commands:
Table 6: Commands in the SQL Shell
| Command | Description |
|---|---|
| help command | Displays list of available commands and their usage. If command name is provided, it provides a more detailed help for that command. |
| connect -i | Used to connect to database interactively. |
| connect | Used to connect to database with properties as specified from connection.properties placed in System classpath. |
| disconnect | Used to disconnect from the database. |
| desc table | Displays table's description. |
| listtables | Displays list of tables. |
| status | Displays the current user connected to the database at the URL. |
Any valid SQL queries can be executed using the SQL Shell.
Note: You should disconnect from a DB or a datasource in the SQL shell before exiting from it, else the Server disconnects you automatically.
secsh>. You can specify the following commands on the Security Shell:
Table 7: Commands in the Security Shell
| Command | Description |
|---|---|
| help command | Displays list of available commands and their usage. If command name is provided, it provides a more detailed help for that command. |
| ca_issue_cert | Issues a user certificate signed by CA in PKCS#12 format. Executes Interactively. |
| ca_setup | Sets up the Certifying Authority (CA). This CA will be used to sign a CSR or issue a certificate in PKCS#12 format. |
| ca_sign | Signs the CSR request given in 'csrFile' and stores that in 'certFile'. |
| change_ca_store_password | Changes the password for CA Key Store. |
| change_server_store_password | Changes the password for Server Key Store. Also changes the password for all the keys in the key store. |
| change_trusted_store_password | Changes the password for trusted Key Store. |
| crl_reload | Reloads the Certificate Revocation Lists from the CRL repository of the Server. |
| delete_server_cert | Deletes the certificate stored with the given alias name from the server key store. |
| delete_trusted_cert | Deletes the certificate stored with the given alias name from trusted CA key store. |
| export_ca_cert | Exports the CA's Certificate to a file. |
| export_server_cert | Exports the Server Certificate with given alias to a file. |
| export_trusted_cert | Exports the Trusted Certificate with given alias to a file. |
| generate_cert | Generates a new Server Certificate |
| generate_csr | Generates a Certificate Signing Request. |
| import_cert | Imports certificate into the Server keystore or Trusted keystore. |
| import_csr_reply | Imports CSR reply to the server keystore. |
| list_server_cert | Lists all the certificate aliases present in the server keystore. |
| list_trusted_cert | Lists all the certificates present in the Trusted CA keystore. |
| view_ca_cert | Shows the CA certificate details. |
| view_cert_chain | Shows the details of the Certificate Chain with given alias in the server keystore. |
| view_server_cert | Shows the details of the Certificate with given alias in the server keystore. |
| view_trusted_cert | Shows the details of the Certificate with given alias in the trusted CA keystore. |
Any valid Security queries can be executed using this shell.
java com.pramati.RemoteShell -file [batch_file_location]
For example, you can create a batch file starter.pmt at /home/both/scripts/ that contains the following command set:
connect -ip 127.0.0.1 -port 9191 -realm realm -user root -password pramati start myApp.ear start anotherApp.ear disconnect
Type: java com.pramati.RemoteShell -file /home/both/scripts/starter.pmt
This connects the shell to the Server that is running on localhost at port 9191. It starts myApp.ear and anotherApp.ear, and disconnects from the server - this does not stop the application. You can use the shell in Batch mode to write a script, which will shut down the Server.
Note: You need to have the required privileges to execute this script.
You can create and run a shutdown script to connect to the Server running on localhost and shut it down. Save the following commands in a file, for example, shutdown.pmt, at /home/both/scripts/:
connect -ip 127.0.0.1 -port 9191 -realm realm -user root -password pramati shutdown
Type: java com.pramati.RemoteShell -file /home/both/scripts/shutdown.pmt
This command shuts down the Server.
com.pramati.services.command.<command _moz-userdefined=""> </command>.
Each Shell provides a command mapping between the commands and their class names. For example, the classname for the command list is com.pramati.services.command.j2ee.LISTCommand.
In the event of a command being invoked by the user, that is not presently registered, the CM tries to locate the command handler on the fly by making use of the following mechanism:
Compose the handler class name- <command _moz-userdefined="" uppercase="" to="" name-="">Command. For example, if command was get_app_status, then the class name would be GET_APP_STATUSCommand.
The CM tries to load this class. Normally, the class should be either in the server’s classpath or in the EXT directory <install_dir>\server\lib\ext.
If a new command is being written, then the command class file should be placed in a jar, and the jar be placed in the \ext directory.
mycustomcmd=<classname>. On the command prompt, enter: refreshcommandprops <path_to_props_file>.
This adds the command to be used on the command line. The command will be available in only the particular Shell in which it was loaded.
UserShellConfig.properties that is located at <install_dir>\server\nodes\<node_name>\config directory.
java com.pramati.j2ee.deploy.validator.earvalidator.EARValidator <name and location of the archive>
Note: Before validating an archive from the command prompt, ensure that the classpath has been set. To set the classpath, run setup.sh on Unix or setup.bat on Windows located at <install_dir>\server\bin.
The following options can be specified with this command:
Table 8: Commands for Validating an Archive
| Option | Description |
|---|---|
| -a | Generates and displays a report of all the severity levels after validation is complete. |
| -w | Generates and displays a report of messages with Warning and Failed severity levels. |
| -f | Generates and displays a report of messages with Failed severity level. This is the default option. |
| -v | Generates the results of the validation in the verbose mode. |
| -o | Saves the results of the validation to a text file. |
For example, at the command prompt, type java com.pramati.tools.validator.earvalidator. EARValidator -a -oreport.txt orderApp.ear.
com.pramati.tools.bss.ServerLauncher class for Server launch and associated processing:
Table 9: Options to be passed for the com.pramati.tools.bss.ServerLauncher class
| Options | Description |
|---|---|
| waitForServerInit | Used to specify that the Server Launcher should wait till it is identified Server is properly initialized. This is mandatory. |
| host | This specifies the host on which to locate the Server. Optional - defaults to localhost. |
| namingport | This specifies the naming port of the Server to be located. This is mandatory. |
| waitSeconds | This specifies the time out limit for locating the Server. Optional - defaults to 2 minutes. |
| verbose | This logs the Activity. The default is set as false. |
| help | This prints the help. |
Note: The next release of Server Launcher will also allow you to directly launch the Server. The current release supports only the launching of processes after the Server has started.
The default value for waitSeconds $TIME is two minutes for starting just the Server. There may be reasons why the wait may be more than two minutes:
java com.pramati.tools.bss.ServerLauncher -waitForServerInit -host $HOSTNAME -namingport $PORT -waitSeconds $TIME -verbose -help
This utility should be invoked after the Pramati Server startup call. Host Name and Wait Time assume default values if not specified (for the default values refer to Table 9 above). namingport and waitForServerInit are mandatory - and are the only options supported with the present version.
To initiate Normal Shutdown, enter the following in the default Shell: j2eeadmin@default> shutdown
The Immediate Shutdown command can be used in scenarios where the Server may have to be started from inside an application-specific startup/init/bootstrap scripts/program. Shutdown command is provided in the J2EEServerMBean, and is executable from the Server and Remote Shells.
To initiate Immediate Shutdown, enter: j2eeadmin@default> shutdown <seconds>
After the specified time for shutdown (<seconds _moz-userdefined="">), the Server VM is forcefully exited. If the delay is zero, the Server VM exits immediately.
Invoking Immediate Shutdown
Immediate Shutdown can be invoked in one of two ways:
From the Server ShellTo initiate an Immediate Shutdown using the Shell, enter: j2eeadmin@default> shutdown <force timeout seconds>
Using MBeans The Server Shutdown can be effected programmatically using the J2EEServerMBean. The MBean is located using the MBean Server.
To look up the MBean using JNDI, create an initial context using the correct environment properties.
Context IC=newInitialContext(props);
J2EEServerMBean.mbean=(J2EEServerMBean)ic.lookup("root-server-mbean")
Note: ‘props’ is a properties object containing the lookup parameters like provider URL etc.
The method to be executed is: J2EEServerMBean.stop (forceTimeoutSeconds)
<install_dir>\server\binrunserver -node <nodename><nodename> that you have created.Note: For a Message Server node, ensure that JMSService is enabled in server-config.xml, located at <install_dir>\server\nodes\<node-name>\config.
The command to start Standalone J2EE Server, a J2EE Server Cluster or Message Server node is same.
The command runserver -node <nodename> also helps in creation of a new node.
jmsadmin@default:>show memory
The output may look like:
Free Memory: 1513 KBytes. Total Memory: 1984 KBytes.
jmsadmin@default:>list destinations Bound Topics: JMSTopic Bound Queues: JMSQueue
In JMS context, there are two types of destination objects: Topic and Queue. These are used in point-to-point or publish or subscribe messaging domains. The Message Server console provides a command to find all, configured and list destinations.
jmsadmin@default:>list topics Bound Topics: JMSTopic, StockMarket
It displays all the configured topics on the server.
jmsadmin@default:>list queues Bound Queues: JMSQueue, SellQueue, BuyQueue
To list queues configured on the server using Message Server command line or the shell, use the command list queue. It displays all the configured queues on the server.
jmsadmin@default:>list factories Topic Connection Factories: JMSTopicConnectionFactory Queue Connection Factories: JMSQueueConnectionFactory XA Topic Connection Factories: JMSXATopicConnectionFactory XA Queue Connection Factories: JMSXAQueueConnectionFactory
This command displays all the configured connection factories on the server.
status command. The report generated consists of the following sections.
The following information about Queues are available:
The following information about a Topic is available:
This section displays status of the topic delivery thread. The topic delivery thread is responsible for delivering messages to a subscriber of a topic:
detectDeadlock command.
j2eeadmin@default> detectDeadlock No Deadlocks Detected.
In the above case, no deadlocks are detected.
Table 10: Commands for Viewing list of Destinations and Command Factories
| To List | Give command | Description |
|---|---|---|
| Destinations | jmsadmin@default:>list destinations | This displays all the destination objects configured on the Server |
| Queues | jmsadmin@default:>list queues | This displays all the queues configured on the Server |
| Topics | jmsadmin@default:>list topics | This displays all the topics configured on the Server |
| Connection Factories | jmsadmin@default:>list factories | This displays all the connection factories configured on the Server |
start_tracking <Datasource_Name>. For example, ressh@default> start_tracking Oracle_DS.status resource <DataSourceName> all. For example:
j2eeadmin@default> status resource jdbc/DB1
====================================================
Status generated on
Mon Apr 17 17:47:45 GMT+05:30 2006
====================================================
----------------------------------------------------
< Starting resource status >
----------------------------------------------------
Datasource Name :[jdbc/DB1]
Connection Factory Name :[demo_cf]
Transaction participation :[true]
Configuration details:
Initial pool size = 1
Minimum pool size = 5
Maximum pool size = 20
Idle timeout = 300 seconds
Conn. request timeout = 10 seconds
Refresh interval = 300 seconds
Validation mode = default
Current Pool Status:
Total requests = 0
Total connections = 1
Free connections = 1
Connections in use = 0
Object being validated = false
Total timed out requests = 0
Currently waiting threads = 0
Waiting threads peak = 0
Total connections destroyed = 0
Total invalid connections = 0
Total connection validations = 0
Total connection leaks = 0
Prepared statement cache
Configured cache size = 20
Cache hit ratio = 0
Note:
1. Unclosed connections are closed in finalize -
Start the server with the system property
com.pramati.resource.njdbc.debugconnectionleak=true
to determine the source of these leaks.
2. Unclosed prepared statements are closed when the connection wrapper is closed.
----------------------------------------------------
< Ending resource status >
----------------------------------------------------
Use the 'all' flag to view a more detailed status
-------------- Memory Usage--------------
Total VM memory = 20201k
Free VM memory = 7211k
-----------------------------------------
Server started at Mon Apr 17 17:47:06 GMT+05:30 2006
Server uptime 0 days 0 hrs 0 minutes 39 seconds
j2eeadmin@default>
server\bin\runserver.bat or sh file, enable this feature by setting the system property com.pramati.util.pool.debugRetainedConnections to true:
java -server -Dcom.pramati.util.pool.debugRetainedConnections=true -Dinstall.root=%install_root% -Djava.security.policy=%install_root%\lib\pramati\pramati.java.policy -Djava.security.auth.policy=%install_root%\lib\pramati\pramati.jaas.policy -Djacorb.home=%install_root%\lib\tp\jacorb com.pramati.Server %*
Note: This feature is available only for Pramati Server 4.1 SP3 and above.
This enables advanced instrumentation for datasource connection usage, including:
This can help track down points in the application code which might be holding on to connections for too long and potentially starving other requests.
The output can be viewed by typing status resource <datasource name> all on the J2EE shell. For viewing this information, type status resource <datasource name> InUseConnections. This prints all connections that are currently in use for the datasource specified by <datasource name>.
For additional filtering as in points 2 and 3 above, type:status resource <datasource name> InUseConnections ConnectionsInUseFor=250
This prints all connections in use for the datasources that have been in use for more than 250 milliseconds.
In all the above command combinations, omitting the datasource name would print out the information for all datasources defined on the server.
----------------------------------------------------
< Starting resource status >
----------------------------------------------------
Datasource Name :[orads]
Connection Factory Name :[oraclecf]
Transaction participation :[true]
Transaction isolation :[unspecified]
Configuration details:
Initial pool size = 1
Minimum pool size = 5
Maximum pool size = 20
Idle timeout = 300 seconds
Conn. request timeout = 10 seconds
Refresh interval = 300 seconds
Validation mode = default
Current Pool Status:
Total requests = 1
Total connections = 1
Free connections = 0
Connections in use = 1
Object being validated = false
Total timed out requests = 0
Currently waiting threads = 0
Waiting threads peak = 0
Total connections destroyed = 0
Total invalid connections = 0
Total connection validations = 1
Total connection leaks = 0
Prepared statement cache
Configured cache size = 20
Cache hit ratio = 0
Note:
1. Unclosed connections are closed in finalize -
Start the server with the system property
com.pramati.resource.njdbc.debugconnectionleak=true
to determine the source of these leaks.
2. Unclosed prepared statements are closed when
the connection wrapper is closed.
Printing connection info for: 1
connection[0] has been in use for 9875 ms.
java.lang.Exception: InUseConnection
at
com.pramati.util.pool.ShrinkingPool$InuseInfo.
(ShrinkingPool.java:945)
at
com.pramati.util.pool.ShrinkingPool.addToInUsePool
(ShrinkingPool.java:505)
at
com.pramati.util.pool.ShrinkingPool._getObject
(ShrinkingPool.java:267)
at
com.pramati.util.pool.ShrinkingPool.getObject
(ShrinkingPool.java:235)
at
com.pramati.util.pool.ShrinkingPool.getObject
(ShrinkingPool.java:224)
at
com.pramati.resource.njdbc.ContainerAuthoredDS.getConnectionFromPool
(ContainerAuthoredDS.java:223)
at
com.pramati.resource.njdbc.PramatiDataSource._getConnection
(PramatiDataSource.java:319)
at
com.pramati.resource.njdbc.ContainerAuthoredDS.getConnection
(ContainerAuthoredDS.java:105)
at
com.pramati.jsp.generated.conn._jspService_delegate
(conn.java:68)
at
com.pramati.jsp.generated.conn._jspService
(conn.java:87)
at
com.pramati.jsp.runtime.HttpJspSuper.service
(HttpJspSuper.java:91)
at
javax.servlet.http.HttpServlet.service
(HttpServlet.java:802)
at
com.pramati.web.servlet.core.ServiceAction.run
(ServiceAction.java:74)
at
com.pramati.security.util.PramatiSecurityHelper._doAs
(PramatiSecurityHelper.java:54)
at
com.pramati.services.security.spi.SecurityHelper.doAs
(SecurityHelper.java:124)
at
com.pramati.web.servlet.core.PramatiFilterChainImpl.invokeTargetWebResource
(PramatiFilterChainImpl.java:219)
at
com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter
(PramatiFilterChainImpl.java:140)
at
com.pramati.web.util.servlets.filters.TitleFilter.doFilter
(TitleFilter.java:33)
at
com.pramati.web.servlet.core.PramatiFilterChainImpl.invokeTargetFilter
(PramatiFilterChainImpl.java:163)
at
com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter
(PramatiFilterChainImpl.java:132)
at
com.pramati.web.servlet.core.PramatiFilterChainImpl.startDoFilter
(PramatiFilterChainImpl.java:88)
at
com.pramati.web.interceptors.ServiceInterceptor.preProcess
(ServiceInterceptor.java:138)
at
com.pramati.web.interceptors.core.DefaultInterceptor.process
(DefaultInterceptor.java:62)
at
com.pramati.web.interceptors.core.InterceptorChainImpl.processNext
(InterceptorChainImpl.java:48)
at
com.pramati.web.interceptors.core.DefaultInterceptor.process
(DefaultInterceptor.java:63)
at
com.pramati.web.interceptors.core.InterceptorChainImpl.processNext
(InterceptorChainImpl.java:48)
at
com.pramati.web.interceptors.core.DefaultInterceptor.process
(DefaultInterceptor.java:63)
at
com.pramati.web.interceptors.core.InterceptorChainImpl.processNext
(InterceptorChainImpl.java:48)
at
com.pramati.web.interceptors.core.DefaultInterceptor.process
(DefaultInterceptor.java:63)
at
com.pramati.web.interceptors.core.InterceptorChainImpl.processNext
(InterceptorChainImpl.java:48)
at
com.pramati.web.interceptors.core.DefaultInterceptor.process
(DefaultInterceptor.java:63)
at
com.pramati.web.interceptors.core.InterceptorChainImpl.processNext
(InterceptorChainImpl.java:48)
at
com.pramati.web.interceptors.core.DefaultInterceptor.process
(DefaultInterceptor.java:63)
at
com.pramati.web.interceptors.core.InterceptorChainImpl.processNext
(InterceptorChainImpl.java:48)
at
com.pramati.web.interceptors.core.DefaultProcessContainer.process
(DefaultProcessContainer.java:97)
at
com.pramati.web.core.WorkerThread.processConnection
(WorkerThread.java:332)
at
com.pramati.web.core.WorkerThread.processConnection
(WorkerThread.java:303)
at
com.pramati.web.core.WorkerThread.run
(WorkerThread.java:128)
-----------------------------------------
shell@start_request_sniff [-trace] [-file <output_filename>]
To turn it off, use the following command: shell@stop_request_sniff
##<WEB/EJB/JMS><REQUEST/RESPONSE/TRACE> Thread ID Timestamp System generate ID, followed by more information on the subsequent lines.A request has additional information. Consider the iBank application which will contain information such as:
client ID= "127.0.0.1" context = "bank" URI = "bank/transfer.jsp"
Response includes just the response details. In case of WEB, it includes be the response headers.
## WEB RESPONSE Thread-15 1:24:27 PM ID:1077350067734 Client Id =127.0.0.1 Context =/ URI =/OrderBookWeb/ Details =HTTP/1.1 404 The requested resource was not found. Please check the URI above. Server: Pramati Server Date: Sat, 25 Feb 2006 07:54:28 GMT Content-Length: 1125 Content-Type: text/html Connection: Keep-Alive
A JMS Request Sniff would look as below:
## JMS REQUEST RMI TCP Connection(75)-192.168.1.29 4:42:49 PM ID:1077534769960 Client Id =192.168.1.29-502058352 Context =sendMessage msgId:ID:1673361:1077534769340:192.168.1.29:destination:QUEUE: JMSQueue URI =sendMessage Details =sendMessage ## ## JMS RESPONSE RMI TCP Connection(75)-192.168.1.29 4:42:49 PM ID:1077534769960 Client Id =192.168.1.29-502058352 Context =sendMessage msgId:ID:1673361:1077534769340:192.168.1.29:destination:QUEUE: JMSQueue URI =sendMessage Details =sendMessage done ##
In the above sniff log generated:
| © Pramati Technologies 2007 | Runs on Pramati Server | Feedback | Legal |