Monday, July 27, 2015

Thursday, July 2, 2015

Database problems

“Test connection failed for the data source PLANTSDB on server dmgr at
node was6host01CellManager01 with the following exception:
java.sql.SQLException: Database ‘...\PLANTSDB' not found. DSRA0010E:
SQL State = XJ004, Error Code = 40,000. View JVM Logs for further
details.”

 The View JVM Logs hyperlink in the error message will be used to begin the problem determination.

 __ 1. View the JVM logs.
__ a. Click the View JVM Logs hyperlink in the Test connection error message.
__ b. Click the View button of the SystemErr.log. Note that the log has more lines
than can be shown on one screen. You should view the last 200 lines to see the
error message.












===========================
Creating a database connection: Common problems
ƔTypical problems that arise when configuring a database
connection are:
– Spelling errors or typos when filling in the parameter values
– Client JAR files necessary to the JDBC Provider are not present
– Lack of user permissions on the database server
– Connectivity problems because of network topology or a database
that has not been started
ƔThe problems encountered when configuring a database
connection are usually easy to fix if you know what to look for
and where to look:
– WebSphere Application Server V6.1 provides immediate feedback
when testing a connection
– The SystemErr.log contains explicit information about the actual
exception


====================================
Data source database parameter problems:
Identification
ƔThe data source is the connection between the application
server and the database.
ƔCommon configuration problems consist of:
– Incorrectly specified database server parameters
– Incorrect user authentication credentials
ƔUse the Test Connection service and examine the error
message:
ƔAs suggested by this error message, the JVM logs are a good
place to begin the problem determination activity



=======================================

Data source database parameter problems: Diagnosis
and resolution
ƔThe SystemErr.log tells you that the address provided was
invalid for the connection.
ƔA connectivity problem could be as a result of an incorrect
database name, server name, or port number.
– If this is a large organization, the database administrator might have to
be consulted to verify that database name.
– You can verify that the server name is correct by attempting a ping of
the machine or a Telnet session.
– The port number could have been changed to something other than
the default
• If it is a DB2 database, the port number can be discovered through the
DB2 Configuration Assistant or by exporting the instance parameters by
using the DB2 Control Center.
3/8/06 11:13:22:458 MST] 0000000a SystemErr     R java.net.SocketException:
Operation timed out: connect:could be due to invalid address at
java.net.PlainSocketImpl.socketConnect(Native Method)

 ==========================================


 Data source database authentication problems:
Identification
ƔIf you run the Test Connection service and receive an error
message like:
ƔIt is signifying a problem with the authentication credentials.
This could be a result of:
– Misspelled user name or password
– Assigning the wrong JCA credential definition to the data source
– Missing user account for this user on the database server machine


=========================================

Data source database authentication problems:
Diagnosis and Resolution
ƔThe exception in the SystemErr.log file says that the password
is invalid:
ƔHowever, in this particular case, it was as a result of assigning
the incorrect JCA authentication definition to the data source.
Therefore, it is important to inspect all of the parameters
associated with the user authentication and verify that they are
correct.
ƔThis might include coordination with the database administrator
or server security administrator to verify that the user account
actually exists and is a member of the group that is able to
access the database.
[3/23/06 10:40:16:492 CST] 0000003e SystemErr     R java.lang.Exception:
java.sql.SQLException: Connection authorization failure occurred.  Reason: password
invalid.DSRA0010E: SQL State = null, Error Code = -99,999

Wednesday, July 1, 2015

Heapdump

Here is the steps to generate heapdump.[ Tested and verified ]

Type : 1 
----> wsadmin
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,node=was7sec01Node01,*

$AdminControl invoke $objectName generateHeapDump


Type : 2            ==============kill -3 =======================

Application servers > server1 > Process definition > Environment Entries


IBM_HEAPDUMP TRUE    
IBM_JAVA_HEAPDUMP_TEXT TRUE   

recycle node and server once  ....

kill -3  <pid>


Type : 3 

To use the administrative console to generate your heap dump, complete the following:
    1. Start the administrative console.
    2. In the navigation pane, click Troubleshooting Java dumps and cores.
    3. Select the server_name for which you want to generate the heap dump.
    4. Click Heap dump to generate the heap dump for your specified server.

GSK

PLEASE DO TASK ONE SERVER AT A TIME START WITH POK AND THEN DO BLDR

Login to UserServivces Servers and follow the steps below.
1.    GET current Keystore used by IHS

          {Server}:/usr/WebSphere/HTTPServer/conf# grep -i Keyfile httpd.conf | grep -v ^#
           Keyfile /web/security/webidentity.kdb

2.     Generate new Certificate using current keystore file from step 1.
               gsk7cmd -cert -create -db webidentity.kdb -pw PASSW0RD -label "{Server}" -dn "{Server},OU=Web Identity,O=IBM,C=US" -size 2048 -x509version 3 -expire 7300
             
               gsk7cmd -cert -list -db webidentity.kdb -pw PASSW0RD

               gsk7cmd -cert -details -db webidentity.kdb -pw PASSWORD -label "{Server}"

3.    Send new User Service CRS to IBMCAPKI (https://daymvs1.pok.ibm.com/ibmca)
              gsk7cmd -certreq -recreate -db webidentity.kdb -pw PASSW0RD -label "{Server}" -target {Server}.crs

              NOTE: Before anything, you must create a new profile on IBMCAPKI so you can send CRS file.

4.Import certificate generated by xxxx
              gsk7cmd -cert -receive -file cert.crt -db webidentity.kdb -pw PASSW0RD
             
              gsk7cmd -cert -list personal -db webidentity.kdb -pw PASSW0RD

5.INSTALL ROOT AND INTERMEDIATE CA
              gsk7cmd -cert -add -db webidentity.kdb -pw PASSWORD -file root_CA.arm -label "IBM Internal Root CA"

              gsk7cmd -cert -add -db webidentity.kdb -pw PASSWORD -file internal_CA.arm -label "IBM INTERNAL INTERMEDIATE CA"

6.Change deafult certificate within keystore
              gsk7cmd -cert -getdefault -db webidentity.kdb -pw PASSW0RD
             
              gsk7cmd -cert -setdefault -db webidentity.kdb -pw PASSW0RD -label "{Server}"
             
              gsk7cmd -cert -getdefault -db webidentity.kdb -pw PASSW0RD

7. Recycle IHS after the above steps to take new certificate into effect.

       8.    Confirm no errors in the IHS logs.
       9.    If no errors ask the testers to test the UserServices functions.

Thursday, July 14, 2011

Session Beans

What Is a Session Bean?

A session bean represents a single client inside the J2EE server. To access an application that is deployed on the server, the client invokes the session bean's methods. The session bean performs work for its client, shielding the client from complexity by executing business tasks inside the server.

As its name suggests, a session bean is similar to an interactive session. A session bean is not shared--it may have just one client, in the same way that an interactive session may have just one user. Like an interactive session, a session bean is not persistent. (That is, its data is not saved to a database.) When the client terminates, its session bean appears to terminate and is no longer associated with the client.

State Management Modes

There are two types of session beans: stateful and stateless.

Stateful Session Beans

The state of an object consists of the values of its instance variables. In a stateful session bean, the instance variables represent the state of a unique client-bean session. Because the client interacts ("talks") with its bean, this state is often called the conversational state.

The state is retained for the duration of the client-bean session. If the client removes the bean or terminates, the session ends and the state disappears. This transient nature of the state is not a problem, however, because when the conversation between the client and the bean ends there is no need to retain the state.

Stateless Session Beans

A stateless session bean does not maintain a conversational state for a particular client. When a client invokes the method of a stateless bean, the bean's instance variables may contain a state, but only for the duration of the invocation. When the method is finished, the state is no longer retained. Except during method invocation, all instances of a stateless bean are equivalent, allowing the EJB container to assign an instance to any client.

Because stateless session beans can support multiple clients, they can offer better scalability for applications that require large numbers of clients. Typically, an application requires fewer stateless session beans than stateful session beans to support the same number of clients.

At times, the EJB container may write a stateful session bean to secondary storage. However, stateless session beans are never written to secondary storage. Therefore, stateless beans may offer better performance than stateful beans.

When to Use Session Beans

In general, you should use a session bean if the following circumstances hold:

At any given time, only one client has access to the bean instance.
The state of the bean is not persistent, existing only for a short period of time (perhaps a few hours).
Stateful session beans are appropriate if any of the following conditions are true:

The bean's state represents the interaction between the bean and a specific client.
The bean needs to hold information about the client across method invocations.
The bean mediates between the client and the other components of the application, presenting a simplified view to the client.
Behind the scenes, the bean manages the work flow of several enterprise beans. For an example, see the AccountControllerEJB session bean in Chapter 18.
To improve performance, you might choose a stateless session bean if it has any of these traits:

The bean's state has no data for a specific client.
In a single method invocation, the bean performs a generic task for all clients. For example, you might use a stateless session bean to send an e-mail that confirms an online order.
The bean fetches from a database a set of read-only data that is often used by clients. Such a bean, for example, could retrieve the table rows that represent the products that are on sale this month.

Wednesday, May 25, 2011

tar

The compression option provides a more efficient way of expressing:
tar -cvf - directory | mkszip >archive
as the one command line:
tar -cvzf archive directory
To identify all files that have been changed in the last week (7 days), and to archive them to a file on diskette, you might type:
find directory -mtime -7 | tar -cvf a:archive -