REST

Using Proxy to call webservice

Code is based on Java-8 and we are using following libraries

  • FasterXML Jackson Parser
  • JBOSS JAX-RS libraries for calling REST API
  • Apache Collection Utils

 

Case1: GET CALL:

URL: https://myhost.com/api/v1/search?text=someText
Method: GET

Step1: Create domain objects
package com.myclient.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SearchResObj {
    private String id;
    private String name;
    // setter & getters
}
Step2: Create a proxy interface
package com.myclient.rest.proxy

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.myclient.domain.SearchResObj;

public interface MyHostServiceProxy {
    String BASE_PATH = "/api/v1";

    @GET
    @Path("/search")
    @Produces({MediaType.APPLICATION_JSON})
    @Consumes({MediaType.APPLICATION_JSON})
    List search(@QueryParam("text") String pText,@HeaderParam("token") String pToken);
}
Step3: Create Service calling REST services
package com.myclient.service;

import java.util.Collections;
import java.util.List;
import java.util.Objects;

import javax.ws.rs.client.Client;
import javax.ws.rs.core.UriBuilder;

import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;

import org.apache.commons.collections.CollectionUtils;

public List searchObjects(String text, String token) {
  ResteasyClient client = new ResteasyClientBuilder().build();
  ResteasyWebTarget target = (ResteasyWebTarget) client
			.target(UriBuilder.fromPath("https://myhost.com" +
  MyHostServiceProxy.BASE_PATH));
  MyHostServiceProxy proxy = target.proxy(MyHostServiceProxy.class);
  List response = proxy.search(text, token);

  if (Objects.isNull(response) || CollectionUtils.isEmpty(response))   {
      return Collections.EMPTY_LIST;
  }
  return response;
}

 

Case2: POST CALL:

URL: https://myhost.com/api/v1/search
Method: POST
Request:
{
“text” : “someText”,
“type” : “someType”
}

Step1: Create domain objects
package com.myclient.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SearchResObj {
    private String id;
    private String name;
    // setter & getters
}
package com.myclient.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SearchReqObj {
    private String text;
    private String type;

    public SearchReqObj(){}
    public SearchReqObj(String type, String text) {
        this.type = type;
        this.text = text;
    }
    // setter & getters
}
Step2: Create a proxy interface
package com.myclient.rest.proxy

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.myclient.domain.SearchReqObj;
import com.myclient.domain.SearchResObj;

public interface MyHostServiceProxy {
    String BASE_PATH = "/api/v1";

    @POST
    @Path("/search")
    @Produces({MediaType.APPLICATION_JSON})
    @Consumes({MediaType.APPLICATION_JSON})
    List< search(SearchReqObj requestObj,@HeaderParam("token") String pToken);
}
Step3: Create Service calling REST services
package com.myclient.service;

import java.util.Collections;
import java.util.List;
import java.util.Objects;

import javax.ws.rs.client.Client;
import javax.ws.rs.core.UriBuilder;

import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;

import org.apache.commons.collections.CollectionUtils;

import com.myclient.domain.SearchReqObj;
import com.myclient.domain.SearchResObj;

public List searchObjects(String type, String text, String token) {
  ResteasyClient client = new ResteasyClientBuilder().build();
  ResteasyWebTarget target = (ResteasyWebTarget) client
			.target(UriBuilder.fromPath("https://myhost.com" +
  MyHostServiceProxy.BASE_PATH));
  MyHostServiceProxy proxy = target.proxy(MyHostServiceProxy.class);
  List response = proxy.search(new SearchReqObj(type, text), token);

  if (Objects.isNull(response) ||
    CollectionUtils.isEmpty(response.getCaseSummaries())) {
      return Collections.EMPTY_LIST;
  }
  return response;
}
Java

Upload / Download byte[] – REST

Getting org.apache.http.impl.client.CloseableHttpClient

import org.apache.http.client.config.RequestConfig;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;

private Registry buildCustomConnectionSocketFactoryRegistry() {
return RegistryBuilder.create()
.register("HTTP", PlainConnectionSocketFactory.INSTANCE)
.register("HTTPS", new SSLConnectionSocketFactory(SSLContexts.createSystemDefault(), SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)).build();
}

public CloseableHttpClient byteServiceClient() {
/** This is the guy which keeps a connection pool.*/
final PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(buildCustomConnectionSocketFactoryRegistry());

/** Preparing default request configuration. This can be overridden if needed by setting request configuration at the request level. */
final RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(10000)
.setSocketTimeout(10000)
.build();

/** Set connection manager and its properties thus building Apache HTTP Client.*/
return HttpClients.custom()
.setConnectionManager(connectionManager)
.setMaxConnTotal(10)
.setDefaultRequestConfig(requestConfig)
.build();
}

Uploading byte[] from REST Client


import java.io.IOException;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.util.EntityUtils;

public void uploadBytes(final byte[] bytes) throws ClientProtocolException, IOException {
String url = "https://mycompany.com/postByteArray";
HttpPost uploadFileRequest = new HttpPost(url);
uploadFileRequest.setEntity(new ByteArrayEntity(bytes));
final CloseableHttpResponse uploadFileResponse = byteServiceClient().execute(uploadFileRequest);
EntityUtils.consume(uploadFileResponse.getEntity());
}

Downloading byte[] from REST Client


import java.io.ByteArrayOutputStream;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.util.EntityUtils;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

public byte[] downloadBytes() throws ClientProtocolException, IOException {
String url = "https://mycompany.com/getByteArray";
HttpGet downloadFileRequest = new HttpGet(url);
final CloseableHttpResponse downloadFileResponse = byteServiceClient().execute(downloadFileRequest);
if(downloadFileResponse.getStatusLine().getStatusCode() == Response.Status.OK.getStatusCode()){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
downloadFileResponse.getEntity().writeTo(baos);
byte[] buffer = baos.toByteArray();
return buffer;
}
EntityUtils.consume(downloadFileResponse.getEntity());
return null;
}
Java

JVM Params

Memory params: Probably required to set minimal and maximal heap size to suite our needs. In most cases ms=mx but that is not always the case. It is really important to have a memory dump whenever we encounter an OutOfMemoryError mainly if you want to be able to isolate fast “spike” memory depletion bugs.

-Xms{#MB}m -Xmx{#MB}m
-XX:PermSize={#MB}m -XX:MaxPermSize={#MB}m
-XX:+HeapDumpOnOutOfMemoryError 

Below displays the configuration of the JVM all parameters available with their default value or the overridden one.

-XX:+PrintFlagsFinal

Below is for safety, to make sure we are not running a client compiler or something stupid like that

-server

GC logging configuration: If we want to be able to estimate GC efficiency GC logging is the way. Starting from Java7 log file rotation is supported.

-XX:+PrintGCDetails
-XX:+PrintGCDateStamps 
-XX:+PrintTenuringDistribution
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCApplicationConcurrentTime
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles={#files}
-XX:GCLogFileSize={#MB}M
-Xloggc:{some gc log file}.gc 

Remote JMX configuration: Opening a JMX port for remote monitoring can help us debug and monitor our server with tools like VisualVM and JConsole. If security is an issue we may also require password and encrypt communications.

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port={a port}
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
Selenium

Reading field value in selenium set by JQuery

html() method for JQuery
If html() method for JQuery is used to set the value of the field as

$('#MY_FIELD_ID').html(fieldValue);

Then below is the code snippet to retrieve the value of MY_FIELD_ID in Selenium

driver.findElement(By.id("MY_FIELD_ID")).getText();

val() method for JQuery
If val() method for JQuery is used to set the value of the field as

$('#MY_FIELD_ID').val(fieldValue);

Then below is the code snippet to retrieve the value of MY_FIELD_ID in Selenium

driver.findElement(By.id("MY_FIELD_ID")).getAttribute("value");
Selenium

Selenium : How to check for Title of the Page in iFrame

Recently we were working on Selenium script for web automation testing for our web application. In our web application, all the pages opens in an iframe.

Steps we follows:

driver.switchTo().frame("frameName") // Switch to iframe.
assertTrue(driver.getTitle(), ("MyIFramePage".equals(driver.getTitle()));

The assertTrue() statement always returns “false” irrespective of the fact that the driver has been switched to an iframe. The fact behind that is the driver.getTitle() always returns the title of the page visible to end-user i.e. in this case, the title of the parent page holding the iframe.

To retrieve the title of the page in iframe, you need to do use JavascriptExecutor

assertTrue((String)(((JavascriptExecutor) driver).executeScript("return document.title;")), ("MyIFramePage".equals(((JavascriptExecutor) driver).executeScript("return document.title;"))));
Java

Getting the value of Formula Field in Excel using Apache POI

To get the HSSFCell value where cell is of type FORMULA field.

private Object getCellValue(HSSFCell cell) {
    if (cell == null) { return null; }
    if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
        switch (cell.getCachedFormulaResultType()) {
            case Cell.CELL_TYPE_NUMERIC: return cell.getNumericCellValue();
            case Cell.CELL_TYPE_STRING: return cell.getStringCellValue().replaceAll("'", "");
        }
    }
    return null;
}
Java

Introduction To The Rete Algorithm

What is Rete?
The Rete algorithm is a pattern matching algorithm designed by Dr Charles L. Forgy of Carnegie Mellon University. Rete is a Latin word which means net [1]. It is a very efficient algorithm for matching facts against the patterns in rules. Understanding of the Rete algorithm will make one easier to understand why writing rules one way is more efficient than writing them another way.

Rules, Ruleset and Facts
A ruleset is nothing but a knowledge base consisting of one or more business rules (or simply rules). Every rule in the ruleset represents some knowledge. Rules are usually in the form of if-then. As if-then rules are suitable for rete algorithm they are called rete rules. Here is a simple rete rule
If age > 60 then assign status = “Senior Citizen”
Where if, then and assign are keywords. If part represents condition and then part represents action. There may be more than one condition and in that case the conditions should be joined by logical operators. Then part represents one or more actions. Clearly the above example rule means that if a person’s age is more than 60 then he is a senior citizen. If we want to check whether a person is senior citizen or not we need a data that is the person’s age and this data is called fact. As the number of unique variables or definitions increases, so does the number of facts. For example,
If age > 60 and annual-income <12000 then assign monthly-bonus = 2000
To execute the above rule we need two data or facts: one for age and one for annual-income. For checking the bonus of two persons we need two pair of data, and so on. This is a simple case and in real life situations we may have thousands of facts where the rule should operate on. And we may have thousands of different rules as well.

The Inference Cycle
Each rule has an inference cycle consisting of three phases: match, select and execute. In matching phase, the conditions of the rules are matched against the facts to determine which rules are to be executed. The rules whose conditions are met are stored in a list called agenda for firing. From the list of rules, one of the rules is selected to execute or fire. The selections strategy may depend on priority, recency of usage, specificity of the rule, or on other criteria. The rule selected from the list is executed by carrying out the actions in the right hand side of the rule. The action may be an assertion, executing a user defined or built-in function or executing a decision table, or otherwise. Note that the decision table engine is used to execute decision tables.

Image

Building of the Rete Network
The Rete network is a direct acyclic graph consists of nodes representing patterns in the conditions of the rules. The nodes behave like filters, testing the incoming tokens, and sending only those that pass the test. The rete network consists of two parts: alpha network and beta network. Alpha network consists of nodes known as alpha nodes. Each alpha node has one input that defines intra-elements. Beta network consists of beta nodes where each node takes two inputs to define inter-element conditions.
The Rete network starts with the root node called Rete Node. Kind nodes follow the root node. There should be a kind node for each fact type. Alpha nodes are then created for each pattern and connected to the corresponding kind node. A condition, for example, a>b or b>c has two patterns, so two alpha nodes will be created: one for a>b and one for b>c. Each alpha node is associated with a memory known as alpha memory. It is used to remember the facts matched. Alpha nodes are then joined by beta nodes. Beta node accepts only two inputs. So if there are three alpha nodes then first two nodes will be joined by one beta node. Thereafter the output of this beta node and the third alpha node will be joined by another beta node. This way beta nodes support partial matching. Each beta node has a memory to store joined patterns.
Assertion of each fact creates a token. Initially the tokens enter the root node. The network then splits a branch for each token type. Each kind node gets a copy of the token and performs SELECT operation to select tokens of its kind. The kind node delivers a copy of the token node it receives to the alpha nodes. On receiving the token, the alpha nodes do a PROJECT operation and extract components from the token that match with the variables of the pattern. That is alpha node, basically, evaluates the conditions. Beta node then determines the possible cross product for a rule. Finally actions in the rule will be executed.

Example
Suppose we have a rule,
If age>60 or age<5 or income<36000 then concession = 50/100.
Assume that age is java variable and income is xml variable. The following rete network can be created to represent this rule.

Image

In the above rete network, there are two kind nodes as there are two types of facts: java and xml. Kind 1 node represents java type and kind 2 node represents xml type. As there are three patterns: age>5, age>60 and income<36000 three alpha nodes will be created. Alpha 1 and alpha 2 representing the first two patterns are connected to kind1 and an alpha 3 representing the third pattern is connected to kind2. Now first two alpha nodes are joined by beta 1. The third alpha node and beta 1 joined by beta 2.
When a value for age enters the root a token will be created. Copies of this token will be passed to kind nodes. Kind1 will accept it as the fact type is java. This token will be passed onto alpha1 and alpha 2. If the value satisfies the constraint then the token will be passed onto beta 1 and then to beta 2. In the mean time value of income enters the root and then accepted by kind 2. Alpha 3 receive it and checks if the value satisfies the constraint, income < 36000. If yes then it allows the token passing onto beta 2. If the fact, that is the values, match with the condition in the beta 2 then the rule will be added to a list for firing.

PS:- For complete article, download the PDF from : Introduction to Rete Algorithm

Java

Creating your own logging level in log4j

Step 1: Extend org.apache.log4j.Level to create your custom log level.

package com.mypackage.myproject;
import org.apache.log4j.Level;
public class CustomLogLevel extends Level
{
    public static final CustomLogLevel FATAL = new CustomLogLevel(70000, "FATAL", 0);
    public static final CustomLogLevel ERROR = new CustomLogLevel(60000, "ERROR", 0);
    public static final CustomLogLevel WARN = new CustomLogLevel(50000, "WARN", 0);
    public static final CustomLogLevel APPLICATION = new CustomLogLevel(40000, "APPLICATION", 0);
    public static final CustomLogLevel INFO = new CustomLogLevel(30000, "INFO", 0);
    public static final CustomLogLevel DEBUG = new CustomLogLevel(20000, "DEBUG", 0);

    public CustomLogLevel(int level, String levelStr, int syslogEquivalent)
    {
        super(level, levelStr, syslogEquivalent);
    }

    @Override
    public static CustomLogLevel toLevel(int val, Level defaultLevel) {
        switch (val) {
        case 20000:
            return DEBUG;
        case 30000:
            return INFO;
        case 40000:
            return APPLICATION;
        case 50000:
            return WARN;
        case 60000:
            return ERROR;
        case 70000:
            return FATAL;
        default:
            return APPLICATION;
        }
    }

    @Override
    public static CustomLogLevel toLevel(String sArg, Level defaultLevel) {
        if (sArg == null) {
            return APPLICATION;
        }
        String s = sArg.toUpperCase();

        switch (s) {
        case "DEBUG":
            return DEBUG;
        case "INFO":
            return INFO;
        case "APPLICATION":
            return APPLICATION;
        case "WARN":
            return WARN;
        case "ERROR":
            return ERROR;
        case "FATAL":
            return FATAL;
        default:
            return APPLICATION;
        }
     }
}

Step 2: use the logging level in log4j.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<!-- Appenders -->
<appender name="rollingFileAppender" class="org.apache.log4j.RollingFileAppender">
    <param name="file" value="/opt/logs/MyLogFile.log" />
    <param name="append" value="true" />
    <param name="encoding" value="UTF-8" />
    <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/opt/logs/MyLogFile.%d.log" />
    </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss,SSS} - %-5p: %m %n" />
    </layout>
</appender>

<!-- Application Loggers -->
<logger name="myprj.mypackage">
    <level value="APPLICATION" />
</logger>

<!-- Root Logger --&gt;
<root>
    <level value="WARN"></level>
    <appender-ref ref="rollingFileAppender" />
</root>
</log4j:configuratqion>
Personal

Goodbye, Mumbai

Image

It’s my last week in Mumbai, and I am excited to move down to Bangalore now. Between I am sad, depressed & feeling bad for moving out from Mumbai, which I never thought of ….

15-Oct-2005, I came down to Mumbai with the thought that soon I will move down to Delhi near to my home town. But I don’t know, whats happen and soon I became the part of AAMCHI MUMBAI. Who so ever said this for the 1st time “Mumbai, EK MAAYA NAGARI” …. He was/is a genius. I think he/she truly discovered Mumbai [Maya naagri] 🙂 ….

Here, I made lots of new friends both at personal & professional level and would take opportunity to thanks all of them for supporting me when ever I required them.

From professional aspect, I worked for CapGemini India Pvt. Ltd. [Oct 2005 to July 2011] & then joined Rolta India Pvt. Ltd. [Aug 2011 to May 2013] . My learning experiences in both the companies was tremendously good and would again like to thanks all my colleagues & seniors, without whom I would have never succeeded in my carrier here.

Must not forget to mention, I found my MAAYA [MEMSAHEB] here, Sreevidya Miduthuru [Married on: 12-Nov-2009] & became a father of Raveesh Kumar [DOB: 09-July-2011]

Lastly, I must apologies to all those in MUMBAI whom I hurt-ed intentionally or un-intentionally & thanks to all my dear and near friends/colleagues/seniors.

Please be in touch…

WISH ALL MUMBAIKERS OUR WEST WISHES.

~ Nitin, Sreevidya & Raveesh

Database

Resetting password for ODSSM if expired

Goto directory: ORACLE_HOME\domain_database\sysman\log
For e.g.Goto directory: D:\Oracle\product\11.2.0\dbhome_1\XYZ.mycompany.com_ORCL\sysman\log
Open file : emoms.log 
2012-07-30 08:35:03,852 [SystemThreadGroup-8] ERROR app.SessionObjectManager sessionDestroyed.128 - java.sql.SQLException: ORA-28001: the password has expired
If, password is expired, you will see following stack trace
java.sql.SQLException: ORA-28001: the password has expired
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:73)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:472)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:414)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:857)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:409)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:621)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:203)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:492)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:386)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:276)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:212)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:140)
at oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1752)
at oracle.jdbc.pool.OracleImplicitConnectionCache.makeOneConnection(OracleImplicitConnectionCache.java:644)
at oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:592)
at oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:460)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:544)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:480)
at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:336)
at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:322)
at oracle.sysman.util.jdbc.ConnectionCache.getUnwrappedConnection(ConnectionCache.java:575)
at oracle.sysman.emSDK.svc.conn.FGAConnectionCache.getFGAConnection(FGAConnectionCache.java:207)
at oracle.sysman.emSDK.svc.conn.ConnectionService.getPrivateConnection(ConnectionService.java:1138)
at oracle.sysman.emSDK.svc.conn.ConnectionService.getPrivateConnection(ConnectionService.java:1172)
at oracle.sysman.eml.app.SessionObjectManager.sessionDestroyed(SessionObjectManager.java:116)
at oracle.sysman.eml.app.SessionListener.sessionDestroyed(SessionListener.java:126)
at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:860)
at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:397)
at com.evermind.server.http.SessionAsyncInvalidateHandler.invalidateSession(SessionAsyncInvalidateHandler.java:179)
at com.evermind.server.http.SessionAsyncInvalidateHandler.run(SessionAsyncInvalidateHandler.java:139)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
2012-07-30 08:35:06,520 [HTTPThreadGroup-561] ERROR conn.ConnectionService verifyRepositoryEx.891 - Invalid Connection Pool. ERROR = ORA-28001: the password has expired
Step1: Connect to database using System user
           sys as sysdba / Welcome1
Step2: select username,account_status,expiry_date from dba_users;
See the account_status for user ODSSM. It must show: EXPIRED & LOCK or EXPIRED
Step3: connect database using ODSSM / Welcome1
You will be prompt for new password
Enter 
New password as : Welcome1
    Retype new password: Welcome1
sql> conn ODSSM/Welcome1 ERROR: ORA-28001: the password has expired     Changing password for ODSSM New password: Retype new password: Password changed Connected.