Performance of Session Stateless Bean in WebSphere with connection to DB

Im using WebSphere Advanced Single Server Edition Version 4.0.1. and a WebSphere DataSource to get my connections to Microsoft SQL 2000 (using netdirect's JSQLDriver).
For the EJB I set the transaction to 'requieresNew'.
For testing purposes I had been testing some code I'll be using in a Session Stateless Bean inside a servlet's method. In my servlet I use one single connection and preparedStatements to improve performance.
When I test it on the Servlet, this process takes around 3 minutes to complete, but when I put this code inside a Session Stateless Bean and call it from this servlet's method, it takes around 30 minutes to complete!. How is this possible?!
Worst of all, when the EJB ends and the process returns to the Servlet, it throws me this exception.
com.ibm.websphere.ce.cm.StaleConnectionException: class com.ibm.ejs.cm.proxy.PreparedStatementProxy is closed.
The code uses some utilities from a Framework we created, but I really doubt it affects the performance since I put such classes in a jar file and the EJB is accessing such classes correctly.
I thought that maybe I was missing something related with how I get the connection inside the EJB, but I had no luck trying to figure this out.
This is the code in my EJB, commented code was in use when this code was tested in the method of the servlet (some code has been removed or modified, so I just left the 'main' body of the code):
package cmx.ejb;
import cmx.common.*;
import java.util.*;
import qsi.sys.db.*;
import qsi.sys.util.*;
import java.rmi.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.*;
import javax.sql.DataSource;
* Bean implementation class for Enterprise Bean: SimuladorEJB
public class SimuladorEJBBean implements javax.ejb.SessionBean {
     private javax.ejb.SessionContext mySessionCtx;
private Context ctx;
private DataSource ds;
private static final int TCONSUMO = 4;
private static final int CARACEQ = 6;
private static final int PPRODUC = 9;
private static final int PPUNTA = 12;
private static final int UTONHR = 8;
private static final int TPRODUCC = 3;
private Vector val = null;
private Vector vecArea = null;
private String query;
private Object[] params;
private int numAreas;
private int vSecDetHE;
//All the prepared statements I'll use in my process
private PreparedStatement pstmSelectSerial = null;
private PreparedStatement pstmUpdateSerial = null;
private PreparedStatement pstmgetPPEquipos = null;
private PreparedStatement pstmgetTransfers = null;
private PreparedStatement pstmaddRProduccion = null;
private PreparedStatement pstmupdInventario = null;
private PreparedStatement pstmgetServicios = null;
private PreparedStatement pstmaddConsumo = null;
private PreparedStatement pstmgetAreaEquipos = null;
private PreparedStatement pstmfindCE = null;
private PreparedStatement pstmcontEventoLogEq = null;
private PreparedStatement pstmaddLog = null;
private PreparedStatement pstmfindCaract = null;
private PreparedStatement pstmfindComposicion = null;
private PreparedStatement pstmfindCombAlt = null;
private PreparedStatement pstmaddInventarioH = null;
private PreparedStatement pstmgetAlmMatREM = null;
private PreparedStatement pstmfindAlmacen = null;
private PreparedStatement pstmcontEventoLogAlm = null;
private PreparedStatement pstmgetAlmacenes = null;
private PreparedStatement pstmfindInvHora = null;
private PreparedStatement pstmgetPeriodoHorario = null;
private PreparedStatement pstmgetProgramaCE = null;
private PreparedStatement pstmgetProgramaPP = null;
private PreparedStatement pstmgetProgramaParo = null;
private PreparedStatement pstmgetPrograma = null;
     * getSessionContext
     public javax.ejb.SessionContext getSessionContext() {
          return mySessionCtx;
     * setSessionContext
     public void setSessionContext(javax.ejb.SessionContext ctx) {
          mySessionCtx = ctx;
     * ejbActivate
     public void ejbActivate() {
     * ejbCreate
     public void ejbCreate() throws javax.ejb.CreateException {
System.out.println("ejbCreate()");
try {
Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
ctx = new InitialContext(parms);
ds = (DataSource)ctx.lookup("jdbc/datasource");
}catch (Exception e){
e.printStackTrace();
     * ejbPassivate
     public void ejbPassivate() {
     * ejbRemove
     public void ejbRemove() {
System.out.println("ejbRemove()");
     pstmSelectSerial = null;
     pstmUpdateSerial = null;
     pstmgetPPEquipos = null;
     pstmgetTransfers = null;
     pstmaddRProduccion = null;
     pstmupdInventario = null;
     pstmgetServicios = null;
     pstmaddConsumo = null;
     pstmgetAreaEquipos = null;
     pstmfindCE = null;
     pstmcontEventoLogEq = null;
     pstmaddLog = null;
     pstmfindCaract = null;
     pstmfindComposicion = null;
     pstmfindCombAlt = null;
     pstmaddInventarioH = null;
     pstmgetAlmMatREM = null;
     pstmfindAlmacen = null;
     pstmcontEventoLogAlm = null;
     pstmgetAlmacenes = null;
     pstmfindInvHora = null;
     pstmgetPeriodoHorario = null;
     pstmgetProgramaCE = null;
     pstmgetProgramaPP = null;
     pstmgetProgramaParo = null;
     pstmgetPrograma = null;
public void GenerarSimulacion(int pidSimulacion, String pfini, String pffin, int cveEntidad, int cveUsuario) throws Exception{
System.out.println("GenerarSimulacion()");
System.out.println("***Simulacion " + pidSimulacion + " en proceso...***");
Calendar inicioProceso = Calendar.getInstance();//Tiempo en que empezo el Proceso
Calendar finProceso = null;//Tiempo en que termino el Proceso
     Connection cnn = null;
//boolean autoCommit = false;
     try{
     cnn = ds.getConnection();
autoCommit = cnn.getAutoCommit();
cnn.setAutoCommit(false);
     cnn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
pstmSelectSerial = cnn.prepareStatement("select iValor from CatConsecutivo where vcConsecutivo=?");
pstmUpdateSerial = cnn.prepareStatement("update CatConsecutivo set iValor = iValor+1 where vcConsecutivo=?");
pstmgetPPEquipos = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getPPEquipos"));
pstmgetTransfers = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getTransfers"));
pstmaddRProduccion = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.addRProduccion"));
pstmupdInventario = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.updInventario"));
pstmgetServicios = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getServicios"));
pstmaddConsumo = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.addRConsumo"));
pstmgetAreaEquipos = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getAreaEquipos"));
pstmfindCE = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.findCE"));
pstmcontEventoLogEq = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.contEventoLogEq"));
pstmaddLog = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.addLog"));
pstmfindCaract = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.findCaract"));
pstmfindComposicion = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.findComposicion"));
pstmfindCombAlt = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.findCombAlt"));
pstmaddInventarioH = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.addInventarioH"));
pstmgetAlmMatREM = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getAlmMatREM"));
pstmfindAlmacen = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.findAlmacen"));
pstmcontEventoLogAlm = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.contEventoLogAlm"));
pstmgetAlmacenes = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getAlmacenes"));
pstmfindInvHora = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.findInvHora"));
pstmgetPeriodoHorario = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getPeriodoHorario"));
pstmgetProgramaCE = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getProgramaCE"));
pstmgetProgramaPP = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getProgramaPP"));
pstmgetProgramaParo = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getProgramaParo"));
pstmgetPrograma = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getPrograma"));
pstmgetAreaEquipos = cnn.prepareStatement(Manager.getParameter("cmx.admin.inicioSesion.getAreaEquipos"));
Map hmEqMat = null;
Iterator itEqMat = null;
Map.Entry meEqMat = null;
Map hmInvAlm = null;
Iterator itInvAlm = null;
Map.Entry meInvAlm = null;
Map hmPunta = null;
Iterator itPunta = null;
Map.Entry mePunta = null;
Iterator itPuntaEq = null;
HashMap hmPuntaEq = null;
Vector vecPuntaEq = null;
Iterator itPPEq = null;
HashMap hmPPEq = null;
Vector vecPPEq = null;
Iterator itCar = null;
HashMap hmCar = null;
Vector vecCar = null;
Iterator itLog = null;
HashMap hmLog = null;
Vector vecLog = null;
Iterator itCA = null;
HashMap hmCA = null;
Vector vecCA = null;
Iterator itCom = null;
HashMap hmCom = null;
Vector vecCom = null;
Iterator it = null;
HashMap hm = null;
Vector vecEv = null;
Iterator itEq = null;
HashMap hmEq = null;
Vector vecEq = null;
Vector vecSim = null;
Date d;
String sDSim = "";
Date dDiaPrevio;
String sDiaPrevio = "";
String consulta;
int vContador= 0;
int hr=0;
long vDiaPrevio = 0;
Integer idInvH;
Integer idProd;
Integer idCons;
Integer idLog;
int vCont = 0;
int vCiclo = 0;
int vArea = 0;
int vAreaAct = 0;
int vPuntaEquipo = 0;
// Periodo de Simulacion
long fini = getCurrDate(pfini);
long ffin = getCurrDate(pffin);
// Variables Generales
int vSecuencial = 0;
int vEvento = 0;
float vCostoE = 0;
int vAlmacenREM = 0;
// Variables de Transferencia
float vCantidad = 0;
int vTipoMov = 0;
int vUMedida = 0;
int vAlmacenTr = 0;
float vNIni = 0;
float vNMin = 0;
float vNMax = 0;
float vNAct = 0;
// Variables de Equipos
int vPPMaterial = 0;
int vPPEquipo = 0;
int vPPArea = 0;
int vMaterial = 0;
int vCaractEq = 0;
int vParo = 0;
int vEstatusParo = 0;
int vEstatus = 0;
float vMinPunta = 0;
float vPorcPunta = 0;
float vProporcion = 0;
float vTPH = 0;
float vGasto = 0;
float vKwNoProd = 0;
float vKwProd = 0;
int vAlmacen = 0;
// Variables de Composicion de Materiales
int vMaterialCom = 0;
float vPorcCom = 0;
float vFactorCC = 0;
int vTipoMovCom = 0;
int vUMedidaCom = 0;
int vAlmacenCom = 0;
float vNIniCom = 0;
float vNMinCom = 0;
float vNMaxCom = 0;
float vNActCom = 0;
int vMaterialCA = 0;
int vUMedidaCA = 0;
int vAlmacenCA = 0;
float vNIniCA = 0;
float vNMinCA = 0;
float vNMaxCA = 0;
float vNActCA = 0;
int vOk=0;
int h=0;
boolean vbOk=false;
boolean swArea=true;
Calendar dtH1;
vecSim = new Vector();
vecSim.add(new Integer(pidSimulacion));
for (long ld=fini; ld<=ffin; ld=getNextDate(new Date(ld), 1))
{   d = new Date(ld);
//The process which calls find(), upd(), AplicaEvento() and GetCostoEnergia() methods several times.
//The methods find() and upd() uses a util class (DataDB) which basically assigns the params to the PreparedStatement and executes it, returning the results in a Vector.
} // for ld : Dia de Simulacion
//Cerrar la transaccion
}catch (Exception e){
          System.out.println("rollback...");
               mySessionCtx.setRollbackOnly();
     System.out.println("rollback ok!");
System.out.println(e.toString());
               throw e;
}finally{
finProceso = Calendar.getInstance();
finProceso.setTime(new java.util.Date(finProceso.getTime().getTime() - inicioProceso.getTime().getTime()));
System.out.println("***Simulacion " + pidSimulacion + " procesada en: " + finProceso.get(Calendar.MINUTE) + ":" + finProceso.get(Calendar.SECOND) + "." + finProceso.get(Calendar.MILLISECOND) + ".***");
try {
if (cnn!=null && !cnn.isClosed()) {
          System.out.println("close ok?");
cnn.close();
               System.out.println("close ok!");
}catch (SQLException sqle){
sqle.printStackTrace();
System.out.println("commit ok?");
cnn.commit();
System.out.println("commit ok!");
}catch (Exception e){
e.printStackTrace();
System.out.println(e.toString());
try {
if (cnn!=null && !cnn.isClosed()) {
               System.out.println("rollback ok?");
                         cnn.rollback();
          System.out.println("rollback ok!");
}catch (SQLException sqle){
sqle.printStackTrace();
}finally{
finProceso = Calendar.getInstance();
finProceso.setTime(new java.util.Date(finProceso.getTime().getTime() - inicioProceso.getTime().getTime()));
System.out.println("Simulacion procesada en: " + finProceso.get(Calendar.MINUTE) + ":" + finProceso.get(Calendar.SECOND) + "." + finProceso.get(Calendar.MILLISECOND) + ".***");
try {
if (cnn!=null && !cnn.isClosed()) {
               System.out.println("autocommit ok?");
               cnn.setAutoCommit(autoCommit);
          System.out.println("autocommit ok!");
          System.out.println("close ok?");
cnn.close();
               System.out.println("close ok!");
}catch (SQLException sqle){
sqle.printStackTrace();
private float GetCostoEnergia(float pfKw, long plFecha, int piHora,int cveEntidad) throws Exception {
float exito = -1;
//calculations and has access to DB throught method find()
return exito;
private int AplicaEvento(int pidMaterial, int pidEvento, int pidSecuencial, int pidSimulacion, long plFecha, int piHora) throws Exception {
int exito = -1;
//calculations and has access to DB throught method find()
return exito;
private Iterator find(PreparedStatement pstm, Vector values) throws Exception {
params = (values!=null)? values.toArray() : null;
Vector data = DataDB.executeQuery(pstm, params); //This util class is in a external jar file, such util basically assigns the params to the PreparedStatement and executes it, returning the results in a Vector.
return data.iterator();
private int upd(PreparedStatement pstm, Vector values) throws Exception {
params = values.toArray();
return DataDB.executeUpdate(pstm, params); //This util class is in a external jar file, such util basically assigns the params to the PreparedStatement and executes it.
Help will be REALLY appreciated!
Thanks in advance.

Thanks Paul for your comments.
In fact, I call my EJB in the servlet just once. Im sure calling the same EJB. My project requieres it to be stateless.
This is my last log
1/2/03 13:15:00:481 CST] 17fac55b SystemOut U -ejbCreate()-
[1/2/03 13:15:00:591 CST] 17fac55b SystemOut U jdbc/xa/oye
[1/2/03 13:15:00:651 CST] 17fac55b SystemOut U -GenerarSimulacion()-
[1/2/03 13:15:00:741 CST] 17fac55b SystemOut U ***Simulacion 32 en proceso...??***
[1/2/03 13:15:01:012 CST] 17fac55b SystemOut U JSQLConnect(2.2721) Trial license - expires on:Tue Jan 07 13:01:32 CST 2003, unlimited connections
[1/2/03 13:15:01:092 CST] 17fac55b SystemOut U Connection OK!
[1/2/03 13:15:01:392 CST] 17fac55b SystemOut U PreparedStatements OK!
[1/2/03 13:15:01:402 CST] 17fac55b SystemOut U Comenzando Sim...
I forgot to mention that I create a connection (autocommit false) at the begining of my servlet, which I use throught all the servlet, then I call the EJB, and after the EJB succeds I also close the transaction in the Servlet (to commit what is on the servlet, not the EJB). Thats why I set the transaction in the EJB to requiresNew, so after the EJB ends it commits its own transaction, Am I right?.
The Exception I get I think its because the connection used in the servlet timed out while waiting for the EJB to finish.
This issue has become urgent, so please if you know why I have this problem reply ASAP.
Thanks!

Similar Messages

  • Performance issue session or bean?

    hi,
    i have a doubt regarding performance issue.
    actually in my application, five jsp' s need to communicate each other. They share around 15 String Objects.
    1. So right now i am using Session object to store
    these 15 String objects.
    2. Also my application can declare a class to
    store all these 15 String objects as attributes and
    then use <jsp:usebean> tag for communication
    with session scope.
    So now we have two methods for sharing information
    in jsp application as stated above.
    Can anyone help me which is the best method to follow as given above and why. Which does increase or decrease the web server load.
    Thanks in advance.
    Have a nice day.
    Bye
    Suresh

    I'd go for wrapping up the data in a single object...not for any performance issues, just because it's far tidier.
    As for performance, I doubt there is much difference although by wrapping up the data in one object you only have to call the session object once to get a handle on all 15 strings.

  • Java Heap Error when using Stateless Session Timer Bean deployed in Oracle

    Hi,
    Am getting following Java Heap Error when using Stateless Session Timer Bean deployed in Oracle 10g AS R3 (Oracle Containers for J2EE 10g (10.1.3.0.0) (build 060119.1546.05277) ):
    06/08/02 14:58:43 javax.ejb.EJBException: java.lang.OutOfMemoryError: Java heap space
    06/08/02 14:58:43 at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:304)
    06/08/02 14:58:43 at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:67)
    06/08/02 14:58:43 at com.evermind.server.ejb.interceptor.system.TxNotSupportedInterceptor.invoke(TxNotSupportedInterceptor.java:45)
    06/08/02 14:58:43 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
    06/08/02 14:58:43 at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:86)
    06/08/02 14:58:43 at com.evermind.server.ejb.StatelessSessionEJBHome.invokeTimer(StatelessSessionEJBHome.java:71)
    06/08/02 14:58:43 at com.evermind.server.ejb.EJBContainer.invokeTimer(EJBContainer.java:1624)
    06/08/02 14:58:43 at oracle.ias.container.scheduler.TimerTask.runBeanTimer(TimerTask.java:92)
    06/08/02 14:58:43 at oracle.ias.container.scheduler.TimerTask.run(TimerTask.java:184)
    06/08/02 14:58:43 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
    06/08/02 14:58:43 at java.lang.Thread.run(Thread.java:595)
    06/08/02 14:58:43 Caused by: java.lang.OutOfMemoryError: Java heap space
    I had tried using -Xms / -Xmx options (upto 1 GB).
    The trace of exception gets delayed (from being displayed on the console) as the memory size is increased; but after sometime it starts getting displayed on the console.
    Even though this exception is displayed on the console, the Timer Bean continues to execute upto sometime before it finally crashes!
    If anyone has encountered such problem; would appreciate if you could share the solution.
    Regards, Vidyadhar

    Hi guys, I have the same problem. I have an application EAR file with two modules (EJB and WAR starting in this order). The application can schedule a process via EJB timer. In this case restarting the server I receive the error above. If I change the modules start order --> WAR - EJB the server start correctly, but the application scheduler fails (the persistency is not working) with this error:
    07/10/09 10:30:54 FINISSIMO: TimerTask.runBeanTimer java.lang.NullPointerException; nested exception is: java.lang.NullPointerExceptionjavax.ejb.TransactionRolledbackLocalException: java.lang.NullPointerException; nested exception is: java.lang.NullPointerException
    java.lang.NullPointerException
         at java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:107)
         at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
         at java.util.ResourceBundle.getString(ResourceBundle.java:285)
         at java.util.logging.Formatter.formatMessage(Formatter.java:108)
         at oracle.j2ee.util.TraceLogFormatter.format(TraceLogger.java:124)
         at oracle.j2ee.util.TraceLogger$TraceLoggerHandler.publish(TraceLogger.java:105)
         at java.util.logging.Logger.log(Logger.java:428)
         at java.util.logging.Logger.doLog(Logger.java:450)
         at java.util.logging.Logger.log(Logger.java:539)
         at oracle.ias.container.timer.TimerEntry.readObjFromBytes(TimerEntry.java:308)
         at oracle.ias.container.timer.TimerEntry.getInfo(TimerEntry.java:107)
         at oracle.ias.container.timer.Timer.getInfo(Timer.java:367)
         at oracle.ias.container.timer.EJBTimerImpl.getInfo(EJBTimerImpl.java:89)
         at com.finantix.foundation.integration.ejbtimer.EJBTimerServiceExecutorBean.ejbTimeout(EJBTimerServiceExecutorBean.java:42)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBTimeoutJoinPoint.invoke(EJBTimeoutJoinPoint.java:20)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at com.evermind.server.ejb.StatelessSessionEJBHome.invokeTimer(StatelessSessionEJBHome.java:38)
         at com.evermind.server.ejb.EJBContainer.invokeTimer(EJBContainer.java:1714)
         at oracle.ias.container.scheduler.TimerTask.runBeanTimer(TimerTask.java:106)
         at oracle.ias.container.scheduler.TimerTask.run(TimerTask.java:220)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    javax.ejb.TransactionRolledbackLocalException: java.lang.NullPointerException; nested exception is: java.lang.NullPointerException
         at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:309)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:73)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:55)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at com.evermind.server.ejb.StatelessSessionEJBHome.invokeTimer(StatelessSessionEJBHome.java:38)
         at com.evermind.server.ejb.EJBContainer.invokeTimer(EJBContainer.java:1714)
         at oracle.ias.container.scheduler.TimerTask.runBeanTimer(TimerTask.java:106)
         at oracle.ias.container.scheduler.TimerTask.run(TimerTask.java:220)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.NullPointerException
         at java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:107)
         at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
         at java.util.ResourceBundle.getString(ResourceBundle.java:285)
         at java.util.logging.Formatter.formatMessage(Formatter.java:108)
         at oracle.j2ee.util.TraceLogFormatter.format(TraceLogger.java:124)
         at oracle.j2ee.util.TraceLogger$TraceLoggerHandler.publish(TraceLogger.java:105)
         at java.util.logging.Logger.log(Logger.java:428)
         at java.util.logging.Logger.doLog(Logger.java:450)
         at java.util.logging.Logger.log(Logger.java:539)
         at oracle.ias.container.timer.TimerEntry.readObjFromBytes(TimerEntry.java:308)
         at oracle.ias.container.timer.TimerEntry.getInfo(TimerEntry.java:107)
         at oracle.ias.container.timer.Timer.getInfo(Timer.java:367)
         at oracle.ias.container.timer.EJBTimerImpl.getInfo(EJBTimerImpl.java:89)
         at com.finantix.foundation.integration.ejbtimer.EJBTimerServiceExecutorBean.ejbTimeout(EJBTimerServiceExecutorBean.java:42)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBTimeoutJoinPoint.invoke(EJBTimeoutJoinPoint.java:20)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         ... 9 more
    Any idea?
    Thx Auro

  • CacheFullException with Stateless bean

    Hallo everbody,
    I have a problem with a Stateless bean the log file give me this error:
    javax.ejb.EJBException: Exception during transition from pooled to ready:
    - with nested exception:
    [weblogic.ejb20.cache.CacheFullException: Cache is at its limit of: '100' *active*
    beans.]
    I use this bean for several action, and just for an action I have this error.
    What I can't underastand that Stateless bean get with the session and as the user
    close the session the Bean have to expire, isn'it? So can't uderstand while 100
    Bean still on the cache.
    Could anyone help me?
    Thank's a lot
    Fausta

    1. check thread dump ... any threads actually still busy?
    2. is it stateful or is it stateless? I don't mean how do you deploy it, but
    I mean which is it really? does it have any state?
    3. always call remove() ... this isn't the problem (Weblogic doesn't require
    remove()) but you should do so anyway.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Sachin Shah" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    I have a statelesss session bean which i m using in the application.Initially
    this bean was stateful bean but due to problems of timeout it was changedto stateless
    bean. The problem is sometimes when i view the statistics from console, ifind
    that there are max 20 beans allowed and all 20 are in use. Because ofwhich no
    user can work further and i have to shutdown the server. I fail tounderstand
    this cause being a stateless session bean it should be released (returnedto free
    pool) as soon as the method is over. So why this behaviour. Any idea.
    Thanks in Advance

  • Using Query String Parameters with Session Scoped bean

    I would like to pass query string parameters from a product page (user clicks on a specific product commandLink) that is request scope to a details page that is session scoped.
    The problem is that the session scoped page only handles the first request. If you view the details of a product and then navigate back to the product page and choose another product ... the details page will not handle the new query string parameters and display the details for the first product chosen.
    Is there a way to make the session scoped bean recognize the query string parameters past the first request?

    I was able to replicate this problem with a very simple app that performs a redirection... just like the real app. Here's the simple app that I put together:
    From request scope page:
    <f:view>
             <h:form>
               <h:commandButton value="Link 1" action="#{reqbean.Link1}"/>
               <br/><br/>
              <h:commandButton value="Link 2" action="#{reqbean.Link2}"/>
            </h:form>
           </f:view>
    From request scope bean:
    public String Link1() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=1");
        return null;
      public String Link2() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=2");
        return null;
      }At this point... I put a println in the constructor of the session scoped bean because this is where I want to get the query string params. The constructor only gets called the first time a redirect is performed.

  • Stateless Session EJB Bean Example please

    Dear Friends,
    Develop a stateless session EJB bean and deploy it in WebLogic 8.1
    Please proivde me a weblogic8.1 example along with the deployment steps.
    Also mention the supporting softwares needed.
    I have weblogic 8.1, JDK 1.5
    Advance Thanks.
    Rengaraj.R

    Hi Rahul,
    Please paste the files here if they are small in size.
    IDfLoginInfo li = new DfLoginInfo(); //this is where the error occurs as when i remove this line. i dont get an error
    Have you checked this as I have mentioned something regarding this in my mail?
    Regards
    Vicky

  • Spring framework - Error with session scoped Beans

    Hello guys,
    I'm trying execute my Java Application inside Netweaver Application Server, but I'm having problems with serviceBeans with scope session. Anyone have already used Spring with session scope?
    Thanks,
    Cleiton.

    After many attempt, when I declared the bean with <aop:scoped-proxy  /> it works, however it could cause performance problem. I don't need refer this bean by another singleton bean, i did a wrong configuration in order to make a work a round...
    When I run my application on tomcat server, the DWR starts perfectly the "session scope bean form IOC container", but in the WEBAS maybe it's running in other thread. Is it possible?
    Anyone had a problem like this?
    I got a detailed error with log4j,
    ERROR Application [1] org.directwebremoting.impl.DefaultCreatorManager - Error loading class for creator 'SpringCreator[CounterSpringFacade]'.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterSpringFacade': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
         at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
         at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:145)
         at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:107)
    Edited by: Cleiton dos Santos Garcia on Jan 7, 2009 5:02 PM

  • SessionSynchronization methods in Stateless Bean with BMP

    Hi,
    Why cant we use SessionSynchronization methods in Stateless Bean with BMP?
    Just cos the bean has full control over the transactions and it doesnt make sense at all or there is something more to add to this.
    Thanks in advance,
    Seetesh

    Hi,
    Why cant we use SessionSynchronization methods in
    Stateless Bean with BMP?Stateless Session Bean does not miantain the state across the method call.And the Transaction control is lying within the method call.
    Just cos the bean has full control over the
    transactions and it doesnt make sense at all or there
    is something more to add to this.I dont understand what you are trying to say here.As stateful session bean maintains the state across the method calls and maintains the conversational state which lies is as cache.The Transaction can be aborted either by making the changes to old value and throwing the Exception to client indicating regarding the failure.But this will be great lost of work hence you make(find mechanism) a recovery from the old values which should be saved.
    It is for this the specification has come up with SessionSynchronization interface (useful for only Stateful) Session Bean and with (declarative Transaction) CMT.
    Regards
    Vicky

  • EJB2.0 stateless session BMT beans & open transactions

    It is clearly stated in the EJB2.0 spec that stateless session BMT beans are not allowed to complete a method without closing the transaction... but if that happens, what exactly is the container's action? Is there an exception thrown back to the client or is the bean discarded? (or both?)
    Thanks in advance for any clarification!

    Is there an exception thrown back to the
    client or is the bean discarded? (or both?)Both. This would be considered a programming error and treated as a system exception.
    The bean instance from the faulty invocation would be removed, but the stateless session
    bean itself would be available for subsequent invocations.

  • Adding Set of Session Beans generates client with wrong session bean names

    Hi,
    I am trying to import a set of session beans deployed on Sun Java Sever 8.2 using Netbeans 6.0. on windows XP.
    The problem is that the imported set generated by the IDE has wrong session bean names and out of 8 session beans in the client jar only 6 are shown (and different 6 every time). Also the remote methods of one bean are associated with another bean and every time its a different set of bean clients generated.
    I am really perplexed with this behavior. Any help on this issue will be highly appreciated.

    An RMI/IIOP parameter type must meet one of thefollowing criteria:
    It must be a primitive type, or it must implementeither java.rmi.Remote or java.io.Serializable,
    or it must be an interface for which the runtime typesatisfies the previous criteria,
    or it must be an array containing elements thatsatisfy the previous criteria.This tells you exactly what you need to do.

  • Performance optimization Session beans

    hi
    I want to Optimize the performance of Session Beans , So where i can find the articles regarding this ?
    Thanks in advance

    Hi,
    I hope the information in thesse links help you.
    http://216.239.35.100/search?q=cache:UnpBzk5zDTcC:www.urbancode.com/projects/ejbbenchmark/EjbPerformance.ppt+%22performance%22+%22session+beans%22+%22optimize%22&hl=en
    http://www.theserverside.com/resources/article.jsp?l=Tips-On-Performance-Testing-And-Optimization
    http://servlet.java.sun.com/javaone/javaone2000/pdfs/TS-678.pdf
    http://edocs.bea.com/wle/wle50/tuning/tsejb.htm#1021592
    Hope this helped.
    Regards,
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • Stateless Bean - scope of instance variable in EJB Timer call back function

    Hi,
    I would like to know on the scope of an instance variable of a Stateless Bean object,
    when used in a EJB Timer call back.Let me explain this in more detail below.
    I have a requirement to use a EJB Timer.
    For this, I have created a stateless object since Timer creation needs to be done
    from a stateless bean. I have a member variable "count" of the stateless bean class.
    In the timer call back(ejbTimeout), I am able to use this count variable during
    each time of the call back, and the value of this variable is also updated properly.
    I have a few queries with respect to the above behaviour:
    1) Does stateless bean object not get destroyed once the Timer is created from the Bean?
    2) If the Bean object is not destroyed, then when does the bean object get destroyed?
    3) If both (1) and (2) are not true, then can anyone explain on how the above behaviour is possible?
    Thanks in advance,
    Ulrich

    Hi Ulrich,
    The ejb timer is associated with the stateless session bean component, not with a particular bean instance. There is no formal relationship between the bean instance that called createTimer() and the bean instance on which the timer callback happens. If they're the same in your test run that's just a coincidence and not something your application should be depending on.
    In the stateless session bean model, the container can create and destroy stateless session bean instances at any time. The container is free to pick any stateless session bean instance to service any client invocation or timer callback. If you need to pass context into a timer callback, one way to do it is via the timer "info" object. However, the info object is immutable so it wouldn't be a good match for a counter. You could of course always just use a database for any necessary coordinated state.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Strange Session/Entity Bean Cross-Instance Calls in Cluster

    In one of our enviroments, we are seeing session entity bean cross-instance
              calls that are hard to explain. The following is our configuration:
              The cluster contains 4 instances on 2 machines (2 on each machine). The same
              beans are deployed to each instance. "jndi.properties" is on the classpath
              for the each instance with jndi provider url = mach1inst1-ip, mach1inst2-ip,
              mach2inst1-ip, mach2inst2-ip:70001. Same servlets are also deployed to each
              instances.
              Requests from the web are load balanced through weblogic's proxy plugin for
              IPlanet and are forwarded to the 4 weblogic cluster instances. The servlet
              processing the requests calls a stateless session bean which uses an entity
              bean. The entity bean is configured with "home-is-clusterable" set to
              "false".
              What we have observed is that when all 4 instances are up, sometimes (even
              when the load is not high) the session bean is accessing entity bean from an
              instance on one machine to an instnace on another machine, while if only one
              machine (with 2 instances) is up, we don't see such calls.
              My theory is that because the jndi provider url is the same for all
              instances, the jndi lookup from each instance goes to the instance bound to
              the first IP specified in the provider url: machine 1 istance 1. If the
              request is from machine 2, because of co-location optimization, even though
              the home stub is from machine 1 instance 1, the session bean returned from
              the home stub actually is from machine 2. However, when the session bean
              does jndi lookup to get an entity bean home, the home stub is from machine 1
              and instance 1. And unfortunately, because the entity bean home is not
              clusterable, the stub can only point back to machine 1, co-location can not
              work. Thus entity bean from machine 1 is referenced by the session bean
              located on machine 2. I do not have a chance to verify this. But it seems to
              make sense to me.
              Unfortunately, I don't feel that I have a theory to explain why we don't see
              cross instance session entity bean calls when only 1 machine is up (with 2
              instances).
              Any ideas or hints would be greatly appreciated.
              Thanks,
              David Chen
              

    rs = stmt.executeQuery() , insert statement is not a query. So use executeUpdate.

  • JAAS and stateless bean

    i have a very simple stateless bean with a single "hello" method running in WL 8.1 sp3. to test out Weblogic's behavior, i ran 2 seaparate scenarios on 2 separate occasions. in the first one, i secured all bean methods. in the 2nd one, i secured only the home's "create" mthod, while explicitely denoting all remote methods as "unchecked". next, i wrote a standalone client class where the aforemention bean's EJBHome.create() is called from within a PrivilegedAction-inherited class, while hello() method is called straight up without the use of PrivilegedAction. moreover, the hello() method also prints out the SessionContext.getCallerPrincipal().getName(). finally, an UNsecured servlet utilizing that class was deployed in Tomcat5 and another instance of Weblogic. this is where is gets interesting. when executing the standalone class or the Tomcat's servlet in both scenarios, the results are the same: both create() and hello() get called without a problem, while the latter method prints out correct principal name. however, Weblogic hosting the unsecured servlet behaves differently (and undesirably). in the first scenario where all methods are secured, create() is allowed to be executed, but calling hello() results in an insufficient privileges error. in the 2nd scenario, where only create() method is secured, Weblogic allows hello() to be called without a problem. however, the principal that it returns is "anonymous". my question is how is it possible for not only Tomcat, but even a standalone class to call a secured method without the use of PrivilegedAction and get back a correct principal? yet when absolutely identical code is called from another Weblogic instance, i cannot even obtain a correct principal despite the use of PrivilegedAction!!!
    thanks!

    Hi "werwer" (or is that "wer" :-),
    I haven't checked the forum archives, so I may have already mentioned
    this to you (or I may have already mentioned it to someone else
    on this forum), but there are many resources available on the
    Internet that can answer nearly all your J2EE related questions!
    I would like to mention two. (If you already know about them, then
    I suggest you study them. If you have already studied them and
    still don't know the difference between a stateful and a stateless
    session bean, then perhaps you can be a bit more specific about
    what, in particular, you are having difficulty with.)
    1. "Mastering Enterprise JavaBeans" by Ed Roman
    A book that you can download as a PDF file.
    http://www.theserverside.com/books/masteringEJB/index.jsp
    (Also look for the companion book -- at the same URL -- "EJB
    Design Patterns")
    Note that you need to become a "member" in order to download
    these books -- but registration is free.
    2. "Enterprise Java Beans, 3rd Edition" by Richard Monson-Haefel
    This is an online book -- that you cannot download!
    http://safari.informit.com/main.asp?bookname=entjbeans3
    Note that "Safari" (at "InformIT") are offering a free, two-week
    trial subscription.
    Hope this helps you.
    Good Luck,
    Avi.

  • Stateless Bean - Web Service Context

    Is there anyway to specify the root context of a stateless bean that is also annotated as a webservice
    Example
    @Stateless
    @Local(**)
    @LocalHome(**)
    @WebService(**)
    @WLHttpTransports(contextPath="rootPath", serviceUri="uri")
    Normally i would expect this to be accessible through http://host:port/rootPath/uri?WSDL
    This format does work without the session bean if ran through Weblogics Generators, but is it possible to do the same thing with a bean? Or if it's not possible using WLHttpTransports what would the other method be?
    Thank you

    user8008029,
    The WLS JAX-WS stack does not support all of the proprietary annotations from the JAX-RPC stack. This annotation (@WLHttpTransports) is one example. However, you can still override the context and service mapping using descriptors.
    The descriptor is [weblogic-webservices.xml|http://e-docs.bea.com/wls/docs103/webserv_ref/dd.html] ...
    Here is a sample:
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-webservices xmlns="http://xmlns.oracle.com/weblogic/weblogic-webservices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-webservices http://xmlns.oracle.com/weblogic/weblogic-webservices/1.0/weblogic-webservices.xsd">
    <webservice-description>
    <webservice-description-name>YourEJBService</webservice-description-name>
    <webservice-type>JAXWS</webservice-type>
    <port-component>
    <port-component-name>YourPort</port-component-name>
    <service-endpoint-address>
    <webservice-contextpath>rootPath</webservice-contextpath>
    <webservice-serviceuri>/uri</webservice-serviceuri>
    </service-endpoint-address>
    </port-component>
    </webservice-description>
    </weblogic-webservices>
    Note: you may use the <WLHTTPTransport/> element with the [ jwsc ant task|http://e-docs.bea.com/wls/docs103/webserv_ref/anttasks.html#wp1069899] . This will build your service and automatically create the appropriate descriptors.
    Ryan

Maybe you are looking for

  • Link Tool

    Is the link tool gone in Acrobat Reader 9? I used to use it in previous versions to create interactive PDF's.

  • Recursive file error 6

    Hello,       I am getting the following error when I am using the "Recursive File List" vi,   "Error 6 occurred at List Folder in Recursive File List.vi>file_list.vi".  The dialog box also states that the npossible reasons are that there is a Laview

  • MIgrated two users to the same new account

    Hello, WE had an incident where we did a migrate job as follows 2 different users were migrted to the same account. stsadm.exe -o -migrateuser -oldlogin (domain\XXXX) -newlogin (domain\YYYYY) -ignoresidhistory One of the users has some problems with

  • Opening zipped & exe files

    How do I open downloaded files that are zipped or in .exe format? When I click on them, nothing happens.

  • Photoshop CS4 Extended install problem

    Hi all, have loaded up CS4 Design Premium onto the pc. All software went well except for photoshop - it seems to be CS4 (standard not 'extended') that has installed. The splash screen says Photoshop CS4 (not 'extended'), the file types list mentions