OC4J 10.1.3: EJB3 - How to catch SQLExceptions in a SessionBean

Hi,
originally I posted this a few minutes ago in the toplink forum, but I'm
unsure if this better suits here. So exceptionally, I post it here as well with a
reference to:
EJB3 - How to catch SQLExceptions from within a stateful session bean
I would like to catch any exception while persisisting the data right in my stateful
session bean and don't have to wait until the client receives an SQLException
wrapped in a bunch of other exceptions.
Here some code fragments to illustrate my problem:
// in Client:
InitialContext ctx = new InitialContext();
statefulWork =  (StatefulWork) ctx.lookup("StatefulWork");
try {
  statefulWork.doIt();
} catch (Throwable t) {
  // don't want to implement db-failover here, even though this works
// in SSB
@Resource
private EntityManager em;
public void doIt() {
        try {
            // create some entites here, do some loops, long running transaction
            em.persist(oneOfMyEntityObjects);
            // set some state in the SSB here
        } catch (Throwable t) {
            // I want to catch all exceptions the persistence provider (toplink) gets
            // but I don't get any here :-(
            // this should be to implement proper retry after reconnect (RAC with TAF)
}In my testcase I issue a shutdown abort while insert statements are executed.
The client receives an EJBException, but within the SSB nothing...
How to change this behavior?
Here is what one can find in the OC4J log:
[TopLink Warnung]: 2006.03.27 03:25:32.220--UnitOfWork(13386)--Thread(Thread[RMICallHandler-0,5,RequestThreadGroup])--Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Interne Exception: java.sql.SQLException: ORA-25402: transaction must roll back
Fehlercode:25402
Call:INSERT INTO T_RUN_DETAILS (ID, INS_TIME, COUNTER, RUN_ID) VALUES (105781, '2006.03.27 03:23:55', 450, 801)After that the transaction is properly rolled back (automatically) and the client
could implement the failover code, but I could not find a possibility to control this
at server side. Even with BMT I could not manage to catch this exception. I
wouldn't have a problem if I had to call ctx.setRollbackOnly() myself.
Hope someone can help. I'm getting a little desperate here.
Thanks,
Eric

Thanks to the help of James Sutherland I managed to get this working.
I had to add a call to em.flush() and use BMT for the SSB. For details please follow my link to the toplink-forum!
James thinks OC4J can handle automatic transaction retries but wasn't sure about how to configure this in OC4J. Anyone can help?
Regards,
Eric

Similar Messages

  • How to catch SQLException from a session bean

    Hello
    I have a stateless session bean which has a method to persist an entity (User) in the database. In User there is a foreign key (addressId) from another entity (Address). While i was persisting User, i entered a value of addressId which was not present in the Address table. Since there was a foreign key constraint on this field in User i got the following exception:
    8:49:49,421 ERROR [JDBCExceptionReporter] ORA-02291:
    integrity constraint (FK_USER_ADD) violated - parent key not
    found 18:49:49,421 ERROR [AbstractFlushingEventListener]
    Could not synchronize database state with session
    org.hibernate.exception.ConstraintViolationException: could
    not insert: [com.User] at org.hibernate.exception.SQLStateConverter.convert(SQLState
    Converter.java:71)So i placed the persist code inside a try block and was catching all the exceptions thrown by persist() method. But these exception are not caught. Instead the exception is sent to the Client end and printed on the client console.
    Any clue on how to catch the ConstraintViolationException in the session bean?
    Thanks

    The problem is that the qry is not executed until you leave your method, so, the exception is catched by the Container. You should issue a entityManager.flush(); rigth "before" leaving the method and you are going to catch all the exceptions given
    Cheers

  • How to catch SQLException  in the hibernate ?

    Hi ~ , I am a newbie to java , recently I do a project that need to use hibernate to do insert data into database(db2) , but my program always encounter a DB deadlock problem , which throw an exception indicated that
    "{code}DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 2{code}"
    so, in this case , i want to try catch block handle this exception , and the code is as follows:
    public static void main(String[] args){
    try {
    Configuration cfg =
    new Configuration().configure();
    SessionFactory sf = cfg.buildSessionFactory();
    Session session = sf.openSession();
    Transaction tx = session.beginTransaction();
    try {
    session.save(obj1);
    session.save(obj2);
    tx.commit();
    session.close();
    }catch (SQLException se) {
    // ***** here it indicate an error that "This exception is never thrown from the try statement body" *****
    }catch (HibernateException e) {
    e.printStackTrace();
    }but in fact , while running the programe , it does throw a SQLException that abend the program , how would I not be able to catch it ? , here I provide the error info :
    Hibernate: insert into TBCUSRPQ (CUST_NAME, CUST_SALUT, LAST_UPDT_BY, LANG, VER, FNL_RSK_LVL_CDE, SYS_RSK_LVL_CDE, CUS_RSK_LVL_CDE, NO_OF_ANS, ANS_REF_ID, DTL_INFO, BANK_NO, CTRY_CDE, RPQ_GP, CUST_ID_TYPE, CUST_ID_NO, LAST_UPDT_DT, LAST_UPDT_TM) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    Hibernate: insert into TBCUSANS (ANS_LIST, ANS_REF_ID, QUEST_NUM) values (?, ?, ?)
    Nov 5, 2008 12:04:17 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
    WARNING: SQL Error: -911, SQLState: 40001
    Nov 5, 2008 12:04:17 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
    SEVERE: DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 2
    Nov 5, 2008 12:04:17 PM net.sf.hibernate.impl.SessionImpl execute
    SEVERE: Could not synchronize database state with session
    net.sf.hibernate.exception.GenericJDBCException: could not insert: [com.hsbc.rpq.importer.vo.ris.CustomerAnswer#com.hsbc.rpq.importer.vo.ris.CustomerAnswer@87235980]
    at net.sf.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:80)
    at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
    at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)
    at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:472)
    at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436)
    at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
    at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)
    at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
    at com.hsbc.rpq.importer.TestDB.main(TestDB.java:78)
    {color:#ff0000}Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 2{color}
    at com.ibm.db2.jcc.c.fg.e(fg.java:1596)
    at com.ibm.db2.jcc.b.gb.o(gb.java:727)
    at com.ibm.db2.jcc.b.gb.g(gb.java:143)
    at com.ibm.db2.jcc.b.gb.a(gb.java:39)
    at com.ibm.db2.jcc.b.w.a(w.java:34)
    at com.ibm.db2.jcc.b.vb.g(vb.java:139)
    at com.ibm.db2.jcc.c.fg.n(fg.java:1177)
    at com.ibm.db2.jcc.c.gg.eb(gg.java:1862)
    at com.ibm.db2.jcc.c.gg.d(gg.java:2295)
    at com.ibm.db2.jcc.c.gg.W(gg.java:457)
    at com.ibm.db2.jcc.c.gg.executeUpdate(gg.java:440)
    at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
    at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462)
    ... 8 moreI tried a lot , but couldn't solve the problem, could anyone help me , how to catch a SQLExcepion in this case , thanks in advance !!

    Hi,
    as corlettk said, you may only catch exceptions that are thrown at you directly (at least for checked exceptions...). If you really want to handle this specific error situation in any reasonable way, there is the possibility to catch what is thrown at you and inspect the cause of the exception provided.
    try {
        // some hibernate calls
    } catch (GenericJdbcException ge) {
        if(ge.getCause() != null && ge.getCause() instanceof SQLException) {
            SQLException se = (SQLException)ge.getCause();
            if(se.getErrorCode() == -911) {
                // your error handling for this case
            }else{
                throw ge; // do not swallow unhandled exceptions
        }else{
            throw ge // do not swallow unhandled exceptions
    }But such things quickly get quite ugly, e.g. if the SQLException is not the direct cause of the GenericJdbcException...so you should be aware what you are doing.
    Bye.

  • How to catch SQLException in CMP bean

    Hi there,
    I am using CMP beans to set columns, one of which has referential integrity.
    Because the abstract set() method does not declare to throw SQLException, I
    can not catch SQLException in my session bean (which calls local CMP bean
    for creating and setting entity beans), the compiler complains "unreachable
    block".
    I can only try catching RemoteException in my delegate class. I do not like
    that, I even tried to catch all exceptions, i.e., catch Exception, in my
    session bean, I still did not catch the SQLException.
    The update calls are made into DB probably right before the transaction
    completes, however, since it is the container generated classes that does DB
    calls and throw SQLException, I could not catch it there since I do not have
    the source code for generated classes.
    Call stack is attached.
    Any suggestion is welcome. Basically I would like to catch SQLException in
    session bean.
    Thanks.
    Yan
    <Oct 18, 2004 10:09:06 AM EDT> <Error> <EJB> <BEA-010026> <Exception
    occurred during commit of transaction Name=[EJB com.med
    lus.serviceHub.rx.ejb.pharmacy.PharmacyMgrSession.updatePharmacy(java.util.A
    rrayList,long,java.lang.String)],Xid=BEA1-0153A4
    2892EE25246C3(29499284),Status=Rolled back.
    [Reason=weblogic.utils.NestedRuntimeException: Error writing from
    beforeCompleti
    n - with nested exception:
    [java.sql.SQLException: ORA-02291: integrity constraint
    (DX_OWNER.STATEABBR_RXPHARM_FK) violated - parent key not found
    ]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds
    left=30,XAServerResourceInfo[weblogic.jdbc.wrappe
    .JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceI
    mpl]=(state=rolledback,assigned=myserver),xar=we
    logic.jdbc.wrapper.JTSXAResourceImpl@1a7491e,re-Registered =
    false),SCInfo[hubservices+myserver]=(state=rolledback),properti
    s=({weblogic.transaction.name=[EJB
    com.medplus.serviceHub.rx.ejb.pharmacy.PharmacyMgrSession.updatePharmacy(jav
    a.util.ArrayL
    st,long,java.lang.String)], weblogic.jdbc=t3://172.18.15.54:7001}),local
    properties=({modifiedListeners=[weblogic.ejb20.inte
    nal.TxManager$TxListener@71de6e]}),OwnerTransactionManager=ServerTM[ServerCo
    ordinatorDescriptor=(CoordinatorURL=myserver+172
    18.15.54:7001+hubservices+t3+,
    XAResources={},NonXAResources={})],CoordinatorURL=myserver+172.18.15.54:7001
    hubservicest3+)
    java.sql.SQLException: ORA-02291: integrity constraint
    (DX_OWNER.STATEABBR_RXPHARM_FK) violated - parent key not found
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
    at
    oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:18
    1)
    at
    oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatemen
    t.java:543)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
    :1027)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedSta
    tement.java:2885)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
    ment.java:2957)
    at
    weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java
    :115)
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.Pharmacy_i7s2ww__WebLogic_CMP_RDBMS._
    WLstore(Pharmacy_i7s2ww__WebLogic_C
    P_RDBMS.java:3564)
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.Pharmacy_i7s2ww__WebLogic_CMP_RDBMS.e
    jbStore(Pharmacy_i7s2ww__WebLogic_CMP
    RDBMS.java:3390)
    at
    weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:965)
    at
    weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java
    :653)
    at
    weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInf
    o.java:1010)
    at
    weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCI
    nfo.java:115)
    at
    weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(
    ServerTransactionImpl.java:1184)
    at
    weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerT
    ransactionImpl.java:1910)
    at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTra
    nsactionImpl.java:273)
    at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransaction
    Impl.java:244)
    at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
    at
    weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.jav
    a:140)
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.PharmacyMgr_kb6mwa_EOImpl.updatePharm
    acy(PharmacyMgr_kb6mwa_EOImpl.java:16
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.PharmacyMgr_kb6mwa_EOImpl_WLSkel.invo
    ke(Unknown Source)
    at
    weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :108)
    at
    weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
    t.java:363)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    --------------- nested within: ------------------

    Hi there,
    I am using CMP beans to set columns, one of which has referential integrity.
    Because the abstract set() method does not declare to throw SQLException, I
    can not catch SQLException in my session bean (which calls local CMP bean
    for creating and setting entity beans), the compiler complains "unreachable
    block".
    I can only try catching RemoteException in my delegate class. I do not like
    that, I even tried to catch all exceptions, i.e., catch Exception, in my
    session bean, I still did not catch the SQLException.
    The update calls are made into DB probably right before the transaction
    completes, however, since it is the container generated classes that does DB
    calls and throw SQLException, I could not catch it there since I do not have
    the source code for generated classes.
    Call stack is attached.
    Any suggestion is welcome. Basically I would like to catch SQLException in
    session bean.
    Thanks.
    Yan
    <Oct 18, 2004 10:09:06 AM EDT> <Error> <EJB> <BEA-010026> <Exception
    occurred during commit of transaction Name=[EJB com.med
    lus.serviceHub.rx.ejb.pharmacy.PharmacyMgrSession.updatePharmacy(java.util.A
    rrayList,long,java.lang.String)],Xid=BEA1-0153A4
    2892EE25246C3(29499284),Status=Rolled back.
    [Reason=weblogic.utils.NestedRuntimeException: Error writing from
    beforeCompleti
    n - with nested exception:
    [java.sql.SQLException: ORA-02291: integrity constraint
    (DX_OWNER.STATEABBR_RXPHARM_FK) violated - parent key not found
    ]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds
    left=30,XAServerResourceInfo[weblogic.jdbc.wrappe
    .JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceI
    mpl]=(state=rolledback,assigned=myserver),xar=we
    logic.jdbc.wrapper.JTSXAResourceImpl@1a7491e,re-Registered =
    false),SCInfo[hubservices+myserver]=(state=rolledback),properti
    s=({weblogic.transaction.name=[EJB
    com.medplus.serviceHub.rx.ejb.pharmacy.PharmacyMgrSession.updatePharmacy(jav
    a.util.ArrayL
    st,long,java.lang.String)], weblogic.jdbc=t3://172.18.15.54:7001}),local
    properties=({modifiedListeners=[weblogic.ejb20.inte
    nal.TxManager$TxListener@71de6e]}),OwnerTransactionManager=ServerTM[ServerCo
    ordinatorDescriptor=(CoordinatorURL=myserver+172
    18.15.54:7001+hubservices+t3+,
    XAResources={},NonXAResources={})],CoordinatorURL=myserver+172.18.15.54:7001
    hubservicest3+)
    java.sql.SQLException: ORA-02291: integrity constraint
    (DX_OWNER.STATEABBR_RXPHARM_FK) violated - parent key not found
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
    at
    oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:18
    1)
    at
    oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatemen
    t.java:543)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
    :1027)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedSta
    tement.java:2885)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
    ment.java:2957)
    at
    weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java
    :115)
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.Pharmacy_i7s2ww__WebLogic_CMP_RDBMS._
    WLstore(Pharmacy_i7s2ww__WebLogic_C
    P_RDBMS.java:3564)
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.Pharmacy_i7s2ww__WebLogic_CMP_RDBMS.e
    jbStore(Pharmacy_i7s2ww__WebLogic_CMP
    RDBMS.java:3390)
    at
    weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:965)
    at
    weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java
    :653)
    at
    weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInf
    o.java:1010)
    at
    weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCI
    nfo.java:115)
    at
    weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(
    ServerTransactionImpl.java:1184)
    at
    weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerT
    ransactionImpl.java:1910)
    at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTra
    nsactionImpl.java:273)
    at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransaction
    Impl.java:244)
    at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
    at
    weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.jav
    a:140)
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.PharmacyMgr_kb6mwa_EOImpl.updatePharm
    acy(PharmacyMgr_kb6mwa_EOImpl.java:16
    at
    com.medplus.serviceHub.rx.ejb.pharmacy.PharmacyMgr_kb6mwa_EOImpl_WLSkel.invo
    ke(Unknown Source)
    at
    weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :108)
    at
    weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
    t.java:363)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    --------------- nested within: ------------------

  • How to catch following error ---- JBO-25013: -----plz reply

    can any one plz tell me how to catch and display this error.....
    as an arror message box?
    please reply as early as possible....
    thanx
    detail error page---
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[06927 ].     at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelect(OracleSQLBuilderImpl.java:796)     at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5585)     at oracle.jbo.server.EntityImpl.populate(EntityImpl.java:4712)     at oracle.jbo.server.EntityImpl.merge(EntityImpl.java:5058)     at oracle.jbo.server.EntityCache.add(EntityCache.java:565)     at oracle.jbo.server.ViewRowStorage.entityCacheAdd(ViewRowStorage.java:1762)     at oracle.jbo.server.ViewRowImpl.entityCacheAdd(ViewRowImpl.java:2151)     at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1070)     at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2943)     at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:2842)     at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:2203)     at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:2088)     at oracle.jbo.server.QueryCollection.get(QueryCollection.java:1468)     at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:3650)     at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2818)     at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2687)     at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2634)     at oracle.jbo.server.ViewRowSetIteratorImpl.getRowAtRangeIndex(ViewRowSetIteratorImpl.java:722)     at oracle.jbo.server.ViewRowSetImpl.getRowAtRangeIndex(ViewRowSetImpl.java:3672)     at oracle.jbo.server.ViewObjectImpl.getRowAtRangeIndex(ViewObjectImpl.java:6263)     at oracle.adfinternal.view.faces.model.binding.FacesCtrlRangeBinding$FacesModel._bringInToRange(FacesCtrlRangeBinding.java:541)     at oracle.adfinternal.view.faces.model.binding.FacesCtrlRangeBinding$FacesModel.setRowIndex(FacesCtrlRangeBinding.java:504)     at oracle.adf.view.faces.component.UIXCollection.setRowIndex(UIXCollection.java:378)     at oracle.adf.view.faces.component.UIXTable._processStamps(UIXTable.java:496)     at oracle.adf.view.faces.component.UIXTable.processFacetsAndChildren(UIXTable.java:377)     at oracle.adf.view.faces.component.UIXCollection.decodeChildrenImpl(UIXCollection.java:141)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:803)     at oracle.adf.view.faces.component.UIXCollection.processDecodes(UIXCollection.java:136)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:818)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:803)     at oracle.adf.view.faces.component.UIXComponentBase.processDecodes(UIXComponentBase.java:673)     at javax.faces.component.UIForm.processDecodes(UIForm.java:144)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:818)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:803)     at oracle.adf.view.faces.component.UIXComponentBase.processDecodes(UIXComponentBase.java:673)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:818)     at oracle.adf.view.faces.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:803)     at oracle.adf.view.faces.component.UIXComponentBase.processDecodes(UIXComponentBase.java:673)     at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)     at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:306)     at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)

    Hi,
    have a look at SRDemo that you can download through JDeveloper (help--> check for updates) and see
    SRDemoADFPhaseListener.java
    and
    SRDemoPageLifecycle.java
    in the oracle.srdemo.view.frameworkExt package
    Frank

  • How to catch the ApplicationStart event??

    how to catch the application start event??
    i want to do some actions (Java code) that will be run once when the application started
    this like ApplicationStart event in ASP.NET
    how ???

    Google for javax.servlet.ServletContextListener. You need to write a class that implements this interface and register it in web.xml.
    Please ask questions like this in the JDeveloper or OC4J forum since they are not related to JHeadstart.
    Steven Davelaar,
    JHeadstart Team.

  • How to catch up Exception message?

    i have a question while using try{ ... }catch{ ... } clauses. for when update, delete, databse, there might be error occurred. all to often i do not deal with the message, only if to check log when serious problem i have to find it out; but i hope to learn how if i am able to display message of my own while erro occurrs. for instance, when falling into SQLException, originaly i might just utilize
    }catch(SQLException e){
    e.printStackTrace();
    is it possible for me to catch up message inside the printStackTrace that may happen while errors appearing? (or only down to catch{} clause be the last deadline that i am able to use? because i hope i am able to capture error code like ora-1234 and tranlate it into messages that user, who doesn't know too much about pc, can understand easily while reporting bug; and not just saying "we have problem here!")
    that is, if 'A' situation popping out, i hope to direct it to error page with special message shown. so does the same error page with different message specified while 'B' situation found out!
    any suggestions would be appreciated~
    thanks in advice,

    printStackTrace isn't obligatory. It's basically what you do with an exception when you don't have anything more specific to do with it.
    You can certainly catch a specific exception at any level, including inside another try {} block.
    Even having caught an exception you can decide that you don't want to handle it at this point in the code, and throw it again.
    You might do:
    try {
         try {
           ... statment which migh cause a particular database exception
            } catch(SQLException e) {
            if(e.getMessage().startsWith("ORA-1232")) {
              .. do somthing usefull
             } else
            throw e;   // the particular SQL exception was unexpected so go on and crash
       catch(Exception e) {
         e.printStackTrace();   // unexpected program failure

  • How to catch SAP application errors in BPM.

    Hi,
    I have a IDOC to Soap Sync Scenario where I send the message to a Webservice. I have used a BPM since we need to catch the resposne of this message and map it to a RFC. For ex if I get a success resposne I need to map success if not than I need to catch the error and map it to the RFC. Now here in some cases like if the target system (webservice) is down than XI raises a sap application error:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Connection refused (errno:239)</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Normally XI stops the process in these cases and does not proceed to the next step but I need to catch this message and map the content in the AdditionalText to the target RFC. Can anyone let me know how to catch this SAP Application Error in BPM and map it to the RFC.
    Thanks,
    Bhargav

    Hi Gaurav,
    As I have mentioned I need to catch the application error in the BPM. If you see the discussion that is mentioned after the blog you have mentioned it is stated that the fault messages or the application error cannot be caught in BPM.
    In the blog that you stated we can catch the fault message and map it to a message structure but only to that extent after that it would stop the BPM process at that step but would not proceed further as shown in the screenshot given in the blog it would fail as "application error restart not possible".
    I need to proceed further and capture this error to an RFC Structure and call a proxy.
    Here after the error it does not proceed to the next step.
    Thanks,
    Bhargav

  • How to catch and display a link content in another portlet page?

    Can you tell me how to display a URL content into next page after an user click s on this link? I am developing a JSR 168 portlet under a Portal. I have 3 pages so far in my portlet. view.jsp, view2.jsp and IpByHourPage.jsp. view2.jsp displays a lis of IP address. When an user clicks on an IP in view2.jsp, it goes to IpByHourPage.jsp. How to catch the IP address such as 123.23.89.21 that an user just click displayed in IpByHourPage.jsp. I don't know why I got null value returned.
    Also, I don't know how to do a "go back to previous page". I want to go back to view2.jsp from IpbyHourPage.jsp
    Here is my code
    in view2.jsp
    <portlet:renderURL var="aURL">
    <portlet:param name="goto" value="IpByHourPage"/>
    </portlet:renderURL>
    <a href="<%=aURL.toString() %> "><%=MyIP%></a>
    in IpByHourPage.jsp
    <%
    String MyIPHour = request.getParameter("goto");
    %>
    <h1>IP Report by Hour ( <%=MyIPHour%> )</h1>
    <portlet:renderURL var="Ret_IPByHour">
    <portlet:param name="Ret_IPHourPage" value="Ret_IPByHourPage"/>
    </portlet:renderURL>
    <center> <a href="<%=Ret_IPByHour.toString() %> "><b>Choose Another IP</b></a></center>
    in my .java file
    protected void doView(RenderRequest request, RenderResponse response)
    throws PortletException, IOException, UnavailableException {
    response.setContentType("text/html");
    String MyBegDate = request.getParameter("BegDate");
    String MyEndDate = request.getParameter("EndDate");
    String MyNetworks = request.getParameter("networks");
    String MyYourName = request.getParameter("yourname");
    PortletURL renderURL = response.createRenderURL();
    renderURL.setPortletMode(PortletMode.VIEW);
    request.setAttribute("renderURL", renderURL.toString() )
    String GotoRenderAction = request.getParameter("goto");
    String MyIPHourAction = request.getParameter("Ret_IPHourPage");
    if ( (MyIPHourAction!=null) && MyIPHourAction.equals("Ret_IPByHourPage") )
    PortletRequestDispatcher kk = getPortletContext().getRequestDispatcher("/view2.jsp");
    kk.include(request, response);
    if (MyIPHourAction != null && MyIPHourAction.equals("Ret_IPByHourPage"))
    PortletRequestDispatcher mm = getPortletContext().getRequestDispatcher("/view2.jsp");
    mm.include(request, response);
    if (GotoRenderAction != null && GotoRenderAction.equals("IpByHourPage"))
    request.setAttribute("BegDate", "MyBegDate");
    request.setAttribute("EndDate", "MyEndDate");
    System.out.println("BegDate" + MyBegDate);
    System.out.println("Endate" + MyEndDate);
    PortletRequestDispatcher mm = getPortletContext().getRequestDispatcher("/IpByHourPage.jsp");
    mm.include(request, response);
    if(MyEndDate!= null )
    PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view2.jsp");
    prd.include(request, response);
    else if (MyEndDate==null && GotoRenderAction == null)
    PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view.jsp");
    prd.include(request, response);
    The problem for above code is the clicked single IP can not be displayed in IpByHourPage.jsp. and I cannot go back to view2.jsp from IpByHourPage.jsp. when I click "Choose Another IP"
    I find out that the MyBegDate and MyEndDate values are all null when I click Choose Another IP link. I got the following error message
    Caused by: javax.servlet.ServletException: Unparseable date: "null null"
         at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         at org.apache.jsp.view2_jsp._jspService(view2_jsp.java:651)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    How to fix above problems. Thanks

    I think the problems are related to portletsession. But I don't know how to use it. How to put portletsession into doview method or my jsp pages. Can anyone tell me in my code? Thanks a lot.

  • How to catch exception throw bc4j

    Dear Forum
    I am user of JDeveloper Swing application.
    while exception throw from bc4j some particular
    type error such as (oracle.jbo.DMLException) JBO-26041
    message display.
    i want to catch error no 26041 inorder to display own
    messageBox.
    There is two methods
    1-:
    i used messageBundle class i overite message string but unable to change dialogBox,i want to use own dialog.
    2-:
    And i fund ,DML exception message return from JUErrorHandlerDlg class.So using this subclass how
    to catch and throw own message.
    Plase send me some code to write sub class of JUErrorHandlerDlg.

    You want this method System to throw an exception if the String[] is empty?
    public void system( ObjectOutputStream output, String cmd []  ) {
       if (cmd.length == 0)
          throw new IllegalArgumentException("Hey! This is an empty array!");
    //...rest of your method
    }You can choose for yourself which exception type is most appropriate. You can in theory always use the base Exception but is not very specific nor recommended. In this case, I think an existing unchecked exception such as IllegalArgumentException would be the most appropriate.

  • How to catch exception when have max connection pool

    hi,
    i have define in oracle user that i could have max 10 sessions at the same time.
    I have jdbc datasource & connection pool defined at glassfish server(JSF application).
    now, if in application is too many queries to the database then i have error: nullpointer exception - becouse when i try to do:
    con = Database.createConnection(); - it generates nullpointer exception becouse there isn't free connection pool
    i try to catch exception like this:
    public List getrep_dws_wnioski_wstrzymane_graph() {     int i = 0;     try {     con = Database.createConnection();     ps =    (Statement) con.createStatement();     rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");     while(rs.next()){       rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));       i++;     }     } catch (NamingException e) {         e.printStackTrace();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 1     } finally {     try {         con.close();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 2     }     } return rep_dws_wnioski_wstrzymane_graph; }
    but at line:
    con.close();
    i have nullpointerexception
    and
    at line
    throw new NoConnectionException(); // catch null 2
    i have: caused by exception.NoConnectionException
    what's wrong with my exception class? how to resolve it?
    public class NoConnectionException extends RuntimeException{     public NoConnectionException(String msg, Throwable cause){       super(msg, cause);     }     public NoConnectionException(){       super();     } }
    at web.xml i have defined:
    <error-page>         <exception-type>exception.NoConnectionException</exception-type>         <location>/NoConnectionExceptionPage.jsp</location>     </error-page>

    thanks,
    i did it and i have error:
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
    at logic.Database.createConnection(Database.java:37): conn = ds.getConnection();
    public class Database {
         public static Connection createConnection() throws NamingException,
                    SQLException {
                Connection conn = null;
                try{
                    Context ctx = new InitialContext();
              if (ctx == null) {
                   throw new NamingException("No initial context");
              DataSource ds = (DataSource) ctx.lookup("jdbc/OracleReports");
              if (ds == null) {
                   throw new NamingException("No data source");
              conn = ds.getConnection();  // here's exception when max connections to database
              if (conn == null) {
                   throw new SQLException("No database connection");
                } catch (NamingException e) {
                    e.printStackTrace();
                    throw new NoConnectionException(); 
             } catch (SQLException e) {
                 e.printStackTrace();
                    throw new NoConnectionException(); 
                catch (NullPointerException e) {
                 e.printStackTrace();
                    throw new NoConnectionException();  // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
            return conn;
    }and at my ealier code i have error:
    at logic.GetDataOracle.getrep_dws_wnioski_wstrzymane_graph(GetDataOracle.java:192)
    at line: con = Database.createConnection();
    in code:
    public List getrep_dws_wnioski_wstrzymane_graph() {
        int i = 0;
        try {
        con = Database.createConnection();
        ps =    (Statement) con.createStatement();
        rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");
        while(rs.next()){
          rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));
          i++;
        } catch (NamingException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException();
        } finally {
        try {
            if(con != null)
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException(); 
    return rep_dws_wnioski_wstrzymane_graph;
    }so what's wrong?
    i have limit max sessions 10 at oracle so i set at my connection pool 5 connections as max. But when i get max 5 sesssins and try to execute next query then i can't catch exception..

  • How to catch Exception in a JSP

    Hi there,
    I'm building my first JSP application. I still don't know what happens to an exception thrown inside a scrptlet in a JSP page.
    My JSP page is resultados.jsp (it processes a DB query):
    <%@ page contentType="text/html; charset=iso-8859-1" language="java"
    import="java.lang.*,java.sql.*,pcliente.*" errorPage="error.jsp" session="true" %>
    <html>
    <head>
    <title>PCliente - Hist?rico de Mainframe</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body background="imagens/sm_bg.gif">
    <TABLE border=0 cellPadding=0 cellSpacing=0>
    <TR>
    <TD width=5><IMG alt="" height=1 src="imagens/pixel.gif" width=5></TD>
    <TD vAlign=top width=125><jsp:include page="menu.jsp" flush="true" /> </TD>
    <TD width=25><IMG alt="" height=1 src="imagens/pixel.gif" width=25></TD>
    <TD vAlign=top width=365>
    <%
    try
    PCliente pcliente = new PCliente(request.getParameter("maquina"),
                        request.getParameter("acessorio"),
                        request.getParameter("contrato"),
                        request.getParameter("estabelecimento"),
                        request.getParameter("ifiscal"));
    ResultSet rs = pcliente.executarQuery();
    while (rs.next())
    out.println("<BR>" + rs.getString("nome_estab_instalacao"));
    out.print(" -----" + rs.getString("num_serie_equipamento"));
    out.print(" -----" + rs.getString("num_contrato"));
    /*** SQL exception is thrown by pcliente.executarQuery() ***/
    catch (SQLException sqlEx)
    out.println("<P>" + "There was an error doing the query:");
    out.println ("<PRE>" + sqlEx + "</PRE> \n <P>");
    application.log("Exception lan?ada", sqlEx);
    throw new Exception(sqlEx.toString());
    finally
    out.println("<P>" + "FINALLY !!!");
    %>
    </TD>
    </TR>
    </TABLE>
    </body>
    </html>
    The error.jsp is
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,pcliente.*" isErrorPage="true" session="true" %>
    <html>
    <head>
    <title>PCliente - Hist?rico de Mainframe - Erro</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <strong>Pagina de Erro</strong>
    </body>
    </html>
    The java class I'm using in this JSP is pcliente/PCliente with the source code:
    package pcliente;
    import java.sql.*;
    public class PCliente
    private String numSerieMaquina, numSerieAcessorio, numContrato, numEstabelecimento, ifiscal;
    private String strQuery;
    private Connection conn;
    private ResultSet rs;
    private Statement stmt;
    public PCliente(String numSerieMaquina, String numSerieAcessorio,
                        String numContrato, String numEstabelecimento,
                        String ifiscal)
    conn = null;
    rs = null;
    stmt = null;
    this.numSerieMaquina = numSerieMaquina;
    this.numSerieAcessorio = numSerieAcessorio;
    this.numContrato = numContrato;
    this.numEstabelecimento = numEstabelecimento;
    this.ifiscal = ifiscal;
    construirQuery();
    public ResultSet executarQuery() throws SQLException
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    /* This causes SQLException as a 'c' was taken from oracle in
    "jdbc:orale:oci8:@PROD" */
    conn = DriverManager.getConnection("jdbc:orale:oci8:@PROD","histmain", "histmain");
    stmt = conn.createStatement();
    rs = stmt.executeQuery(strQuery);
    return rs;
    private void construirQuery()
    strQuery = "SELECT num_serie_equipamento, num_contrato,
    nome_estab_instalacao" +
         " FROM anmpf04" +
         " WHERE 1 = 1";
    if (numSerieMaquina != null)
    if (numSerieMaquina.indexOf('%') == -1)
    strQuery += " AND num_serie_facturacao = " + numSerieMaquina;
    else     
    strQuery += " AND num_serie_facturacao LIKE '" + numSerieMaquina + "'";
    When I execute the JSP I see a page with the text FINALLY !!!
    But an exception was thrown and I can't,
    see
    out.println("<P>" + "There was an error doing the query:");
    out.println ("<PRE>" + sqlEx + "</PRE> \n <P>");
    in the jsp page
    application.log("Exception lan?ada", sqlEx);
    don't know where to find the log file
    throw new Exception(sqlEx.toString());
    isn't caught by the error page error.jsp
    What am I missing here ? a lot of stuff no doubt !
    Can anyone give me suggestion(s) on how to detect an Exception ?
    I would also apreciate a site with documentation regarding Exception processing inside JSP.
    Many thanks,
    MGoncalv

    Hi there,
    I'm building my first JSP application. I still don't
    know what happens to an exception thrown inside a
    scrptlet in a JSP page.I believe that any scriptlet exceptions get wrapped into a ServletException. At that time, if you have an errorPage defined for you JSP page, then it will go there. If you don't then the server will try to find the particular exception type in an <error-page> stanza in the web.xml. If it finds a mapping, it will go to that mapping, otherwise it will go to a default error page (container specific).
    A quick glance at your design shows some big problems though that you may or may not hit (depending on how often you hit the page in your testing). The primary one is that in your PCliente class, you are opening up database connections/statements/results sets w/o closing them. You will run out of connections/cursors at some point b/c of this. You need to do your reads from the database and then close those resources (in a finally block to make sure they get closed). Read the data in a lightweight java object that the JSP can use to actually get the data.
    Also, you only need to register the driver manager once. You can do this in static initialization block.
    ncuka

  • How to catch click event on BAR or a BAR GRAPH???

    Hello
    I want to implemnt following things,
    1. there is Bar Graph containing 10 Bars.
    2. So i want to navigate to 10 diff. pages on click of each bar.
    So how to catch click event on BAR or a BAR GRAPH.????

    Hi,
    You can set Destination URI on a graph. The URL can be specifically associated to a particular data point plotted in the graph.
    Detail for the same is provided in OAF developer guide under 'Charts and Graphs' topic.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to catch the value in sum(control break statement).

    hi,
    can any one tell me how to catch the value in sum in control break satament.
    ex.
    at end of brtwr.
    sum.
    endat.
    I need to print the value in sum only.
    I tried to declare a varaible of type i and assigned sum to this variable.
    it is giving syntax error that sum is not identified.
    How should i do this.
    regards.

    Hi Siva,
    In control break statement when we use SUM. it added all the amount fields and stores its in the work area of that field.
    look below code.
    DATA : BEGIN OF itab OCCURS 0,
               name(10),
               num TYPE i,
           END OF itab.
    DATA : num TYPE i .
    itab-name = 'salman'.
    itab-num  = 100.
    APPEND itab.
    itab-name = 'salman'.
    itab-num  = 200.
    APPEND itab.
    itab-name = 'akshay'.
    itab-num  = 500.
    APPEND itab.
    LOOP AT itab.
      AT END OF name.
        SUM.
        WRITE : / itab-num.
      ENDAT.
    ENDLOOP.
    here the SUM value is stored in Workarea,
    the output will be 300 & 500.
    regards
    Kumar M

  • How to catch the error occurred in Integration Process, and then save it?

    1. how to catch the error occurred in Integration Process, and then save the detailed error message to the file?
    2. there are fault message type for inbound message interface, how to use the fault message type in IR?
    Thanks,
    Michael
    Message was edited by: Spring Tang
    inital
    Message was edited by: Spring Tang
    detailed message output
    Message was edited by: Spring Tang
    fault message type

    Hi Spring,
    If u give an exception step along with your Transformation Step, whenever some error occurs in your message mapping, this exception block wil be triggered.
    You can configure your exception block to do all exception processing that you want. This exception handling is like any other java Exceptio n Handler. You can do anything that you want in your exception handler block on the basis of your requirements.
    <i>If an exception is triggered at runtime, the system first searches for the relevant exception handler in surrounding blocks. If it does not find the correct exception handler, it continues the search in the next block in the block hierarchy.
    When the system finds the correct system handler, it stops all active steps in the block in which the exception handler is defined and then continues processing in the exception handler branch. Once the exception handler has finished processing, the process is continued after the block.
    If the system fails to find an exception handler, it terminates the integration process with an error.</i>
    Regards,
    Bhavesh

Maybe you are looking for

  • Logic Pro X all of a sudden can't detect input from M-Audio Mobile Pre

    I was recording guitars when I had to step away for a while. I closed the lid on my MBP and left. When I came back, all of a sudden, Logic can't detect any inputs coming from my USB interface. I have tried everything from rebooting, switching to the

  • How can you loop a CD

    I and using Garageband to edit several interviews together. The total length of this project will be somewhere around 20 minuets. This interview will be incorporated in to an art project that will be up for a week, where the audio will need to loop a

  • 11G Pivot Query with parameters

    Hello all, I would like to find some way, any way to pass parameters to a pivot query. The following pivot query works, but I would like segment2 to be a variable as well as the period names so.... select * from select segment2, accounted_dr, period_

  • Notification words "Text Messages" in BB Hub is in French - "Missatges de text"

    Just got my Z10 a week ago and I love it.  still figuring out some of the workings, but in general I'm enjoying it.  Only weird thing is that in my BB Hub, the words "Text Message" actually appear in French - "Missatges de text" and I can't figure ou

  • New file default settings???

    Hi Guys, how do I change the default settings so it's always the same when I open a new file? For Instance, I'm trying to set the sample rate to 44.1k so that everytime I open a new file it defaults to that sample everytime. It was set to that sample