JSP + EJB + IE + resize = lock exceptions

I'm getting odd behavior when I resize IE 5.5 with a Servlet/JSP loaded
          that references some EJB's. I'm getting dozens of page reloads, followed
          (eventually) by the server getting lock exceptions thrown from the
          EJB's.
          I've tried adjust the HTTP headers to allow for caching, but that
          doesn't seem to help. Does this sound familar to anyone?
          --Paul
          A wholly owned subsidiary of:
          Schroendinger: DS Bd+W G+Y 10 Y+ L+ W- C+ I++ T++/---
          A+ E++ H+ S++ V++ F- Q++ P B+ PA PL-
          Dirac : DS Bs+W G+Y 10 X L- W C+ I+ T+
          A E- H+ S V+ F- Q++ P++ B+ PA+ PL+
          

I'm getting odd behavior when I resize IE 5.5 with a Servlet/JSP loaded
          that references some EJB's. I'm getting dozens of page reloads, followed
          (eventually) by the server getting lock exceptions thrown from the
          EJB's.
          I've tried adjust the HTTP headers to allow for caching, but that
          doesn't seem to help. Does this sound familar to anyone?
          --Paul
          A wholly owned subsidiary of:
          Schroendinger: DS Bd+W G+Y 10 Y+ L+ W- C+ I++ T++/---
          A+ E++ H+ S++ V++ F- Q++ P B+ PA PL-
          Dirac : DS Bs+W G+Y 10 X L- W C+ I+ T+
          A E- H+ S V+ F- Q++ P++ B+ PA+ PL+
          

Similar Messages

  • Pessimistic lock exception in a clustered environment

    Hello,
    i am using distributed Cache(DataCache) in a Cluster environment
    (Weblogic 7.0 cluster).
    I got one AdminServer and two ManagedServer running on the same machine.
    The problem occurs when i am using optimistic locking. It seems to be that
    the cache is not beeing synchronized, when i am successivly persisting
    objects and therfore get optimistic lock exceptions.
    When i am using pessimistic locking there is no problem.
    Waht could be the reason for this, maybe the case the all instances
    running on the same machine?
    My properties for the cache are the following:
    com.solarmetric.kodo.DataCacheClass=de.d2vodafone.webe.common.security.
    authorization.jdo.Cache (Cache is a subclass of UDPCache)
    com.solarmetric.kodo.DataCacheProperties=UseMulticast=true
    MulticastGroup=224.0.0.123 (is unique in my environment)
    In the log of my server i got the following messages:
    ignoring update from localhost
    ####<12.02.2003 13:25:11 CET> <Error> <EJB> <pc120514> <ManagedServer2>
    <ExecuteThread: '4' for queue: '__weblogic_admin_rmi_queue'> <kernel
    identity> <> <010026> <Exception during commit of transaction
    4:b57355e6636065c2: javax.jdo.JDOUserException: Errors were detected when
    flushing to the data store. If using optimistic transactions, this could
    indicate that lock violations were detected. The "getNestedExceptions"
    method of this Exception will return the specific errors.
    NestedThrowables:
    javax.jdo.JDOUserException:
    An instance was concurrently modified in another transaction (optimistic
    lock #: 3).
    FailedObject:de.webe.common.security.authorization.DomainImpl-5
         at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:551)
         at
    com.solarmetric.kodo.ee.EEPersistenceManager.beforeCompletion(EEPersistenceManager.java:192)
         at
    weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:540)
         at
    weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:92)
         at
    weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1044)
         at
    weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1581)
         at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:237)
         at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:278)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl.createUser(AuthorizationServiceBean_8zrrq4_EOImpl.java:170)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:785)
         at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    NestedThrowablesStackTrace:
    javax.jdo.JDOUserException: An instance was concurrently modified in
    another transaction (optimistic lock #: 3).
    FailedObject:de.d2vodafone.webe.common.security.authorization.DomainImpl-5
         at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping$1.afterUpdate(ClassMapping.java:611)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:563)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:512)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:406)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:273)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:421)
         at
    com.solarmetric.kodo.runtime.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:296)
         at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:549)
         at
    com.solarmetric.kodo.ee.EEPersistenceManager.beforeCompletion(EEPersistenceManager.java:192)
         at
    weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:540)
         at
    weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:92)
         at
    weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1044)
         at
    weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1581)
         at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:237)
         at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:278)
         at
    de.d2vodafone.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl.createUser(AuthorizationServiceBean_8zrrq4_EOImpl.java:170)
         at
    de.d2vodafone.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:785)
         at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in
    beforeCompletion: sync=com.solarmetric.kodo.ee.EEPersistenceManager@472ddf
    Errors were detected when flushing to the data store. If using optimistic
    transactions, this could indicate that lock violations were detected. The
    "getNestedExceptions" method of this Exception will return the specific
    errors. - with nested exception:
    [javax.jdo.JDOUserException: Errors were detected when flushing to the
    data store.  If using optimistic transactions, this could indicate that
    lock violations were detected.  The "getNestedExceptions" method of this
    Exception will return the specific errors.
    NestedThrowables:
    javax.jdo.JDOUserException: An instance was concurrently modified in
    another transaction (optimistic lock #: 3).
    FailedObject:de.d2vodafone.webe.common.security.authorization.DomainImpl-5]
         at
    weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1561)
         at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:284)
         at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:278)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl.createUser(AuthorizationServiceBean_8zrrq4_EOImpl.java:170)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:785)
         at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    Thanks for your help
    Best Regards
    Orhan Keskin

    Orhan-
    Is this consistently reproducable, or a rare or one-time occurance? If
    the former, it may be a configuration issue, and we will investigatge
    along that path.
    If it is a rare or one-time occurance, keep in mind that data cache
    synchronization does not guarantee that you will be able to avoid
    optimistic locking exceptions. Whenever using optimistic locking, you
    always need to assume that someday, someone is going to violate that
    lock, unless you place some sort of synchronization atop all the
    database access (e.g., an EJB). It makes any application much more error
    prone (especially since an OL exception is a RuntimeException, and
    frequently people forget that it always needs to be checked for).
    Anyway, if you provide us with some more details, we will be able to
    investigate further.
    In article <[email protected]>, Orhan Keskin wrote:
    Hello,
    i am using distributed Cache(DataCache) in a Cluster environment
    (Weblogic 7.0 cluster).
    I got one AdminServer and two ManagedServer running on the same machine.
    The problem occurs when i am using optimistic locking. It seems to be that
    the cache is not beeing synchronized, when i am successivly persisting
    objects and therfore get optimistic lock exceptions.
    When i am using pessimistic locking there is no problem.
    Waht could be the reason for this, maybe the case the all instances
    running on the same machine?
    My properties for the cache are the following:
    com.solarmetric.kodo.DataCacheClass=de.d2vodafone.webe.common.security.
    authorization.jdo.Cache (Cache is a subclass of UDPCache)
    com.solarmetric.kodo.DataCacheProperties=UseMulticast=true
    MulticastGroup=224.0.0.123 (is unique in my environment)
    In the log of my server i got the following messages:
    ignoring update from localhost
    ####<12.02.2003 13:25:11 CET> <Error> <EJB> <pc120514> <ManagedServer2>
    <ExecuteThread: '4' for queue: '__weblogic_admin_rmi_queue'> <kernel
    identity> <> <010026> <Exception during commit of transaction
    4:b57355e6636065c2: javax.jdo.JDOUserException: Errors were detected when
    flushing to the data store. If using optimistic transactions, this could
    indicate that lock violations were detected. The "getNestedExceptions"
    method of this Exception will return the specific errors.
    NestedThrowables:
    javax.jdo.JDOUserException:
    An instance was concurrently modified in another transaction (optimistic
    lock #: 3).
    FailedObject:de.webe.common.security.authorization.DomainImpl-5
         at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:551)
         at
    com.solarmetric.kodo.ee.EEPersistenceManager.beforeCompletion(EEPersistenceManager.java:192)
         at
    weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:540)
         at
    weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:92)
         at
    weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1044)
         at
    weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1581)
         at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:237)
         at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:278)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl.createUser(AuthorizationServiceBean_8zrrq4_EOImpl.java:170)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:785)
         at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    NestedThrowablesStackTrace:
    javax.jdo.JDOUserException: An instance was concurrently modified in
    another transaction (optimistic lock #: 3).
    FailedObject:de.d2vodafone.webe.common.security.authorization.DomainImpl-5
         at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping$1.afterUpdate(ClassMapping.java:611)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:563)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:512)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:406)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:273)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:421)
         at
    com.solarmetric.kodo.runtime.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:296)
         at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:549)
         at
    com.solarmetric.kodo.ee.EEPersistenceManager.beforeCompletion(EEPersistenceManager.java:192)
         at
    weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:540)
         at
    weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:92)
         at
    weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1044)
         at
    weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1581)
         at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:237)
         at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:278)
         at
    de.d2vodafone.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl.createUser(AuthorizationServiceBean_8zrrq4_EOImpl.java:170)
         at
    de.d2vodafone.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:785)
         at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in
    beforeCompletion: sync=com.solarmetric.kodo.ee.EEPersistenceManager@472ddf
    Errors were detected when flushing to the data store. If using optimistic
    transactions, this could indicate that lock violations were detected. The
    "getNestedExceptions" method of this Exception will return the specific
    errors. - with nested exception:
    [javax.jdo.JDOUserException: Errors were detected when flushing to the
    data store.  If using optimistic transactions, this could indicate that
    lock violations were detected.  The "getNestedExceptions" method of this
    Exception will return the specific errors.
    NestedThrowables:
    javax.jdo.JDOUserException: An instance was concurrently modified in
    another transaction (optimistic lock #: 3).
    FailedObject:de.d2vodafone.webe.common.security.authorization.DomainImpl-5]
         at
    weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1561)
         at
    weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:284)
         at
    weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at
    weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:278)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl.createUser(AuthorizationServiceBean_8zrrq4_EOImpl.java:170)
         at
    de.webe.common.security.authorization.jdo.AuthorizationServiceBean_8zrrq4_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:785)
         at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    Thanks for your help
    Best Regards
    Orhan Keskin
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Em.merge does not throw Optimistic Lock Exception

    Hello,
    we are using Optimistic Lock Exception in a stateful bean managed transaction.
    I am wondering that there is no Optimistic Lock Exception is thrown after em.merge
    The Optimistic Lock Exception is primary thrown on em.flush - is this right?
    A similar problem is described on
    http://www.nabble.com/Optimistic-Lock-Exception-expected-td22742662.html#a22742662
    See serveroutput: The EclipseLink-5006-Exception is thrown after an em.flush
    14:03:11,657 INFO [STDOUT] updateItem
    14:03:11,657 INFO [STDOUT] [EL Finest]: 2009-04-09 14:03:11.657--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--Merge clone with references com.tup.model.Person@131a24c
    14:03:11,657 INFO [STDOUT] merged
    14:03:11,657 INFO [STDOUT] [EL Finest]: 2009-04-09 14:03:11.657--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--Execute query UpdateObjectQuery(com.tup.model.Person@196649c)
    14:03:11,657 INFO [STDOUT] [EL Fine]: 2009-04-09 14:03:11.657--ClientSession(21268424)--Connection(25845065)--Thread(WorkerThread#0[192.168.1.217:4518])--UPDATE mku_person_ver SET first_name = ? WHERE ((ID = ?) AND (((last_name = ?) AND (first_name = ?)) AND (version = ?)))
    bind => [Bernd 982, 5, Kuls, Bernd 98, 2009-04-09 13:12:15.0]
    14:03:11,672 INFO [STDOUT] [EL Warning]: 2009-04-09 14:03:11.672--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--Exception [EclipseLink-5006] (Eclipse Persistence Services - 1.1.0.r3634): org.eclipse.persistence.exceptions.OptimisticLockException
    Exception Description: The object [com.tup.model.Person@196649c] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.tup.model.Person Primary Key> [5]
    14:03:11,688 INFO [STDOUT] [EL Warning]: 2009-04-09 14:03:11.688--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--javax.persistence.OptimisticLockException: Exception [EclipseLink-5006] (Eclipse Persistence Services - 1.1.0.r3634): org.eclipse.persistence.exceptions.OptimisticLockException
    Exception Description: The object [com.tup.model.Person@196649c] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.tup.model.Person Primary Key> [5]
    14:03:11,688 INFO [STDOUT] OptimisticLockException throws MyApplicationException
    14:03:11,688 INFO [STDOUT] MyApplicationException
    14:03:11,735 INFO [STDOUT] [EL Finer]: 2009-04-09 14:03:11.735--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--TX afterCompletion callback, status=ROLLEDBACK
    14:03:11,750 INFO [STDOUT] [EL Finer]: 2009-04-09 14:03:11.75--UnitOfWork(14218007)--Thread(WorkerThread#0[192.168.1.217:4518])--release unit of work
    14:03:11,750 INFO [STDOUT] [EL Finer]: 2009-04-09 14:03:11.75--ClientSession(21268424)--Thread(WorkerThread#0[192.168.1.217:4518])--client released
    14:03:11,750 ERROR [BMTInterceptor] BMT stateful bean 'ModelFacade' did not complete user transaction properly status=STATUS_MARKED_ROLLBACK
    And by this Exception the transaction's status is set to status=STATUS_MARKED_ROLLBACK.
    The transaction can no longer be used.
    I want to use this transaction further and wrap the OptimisticLockException into an MyApplicationException
    (see serveroutput).
    But no change!
    Any Ideas ?
    Regards,
    Martin Kubitza
    T&P Bochum/Germany

    Hi,
    are you using JPA or TopLink ? Check if there is another exception thrown that produces the error. You can try and catch (Exception ex), which will catch them all. if this works the obviously you don't catch the right exception
    I found a post saying that: "If you trying commit directly after persist w/o doing an explicit
    flush then OptimisticLocking Exception maybe nested inside
    RollBackException. What is the top most error on stack? You can catch
    javax.persistence.PersistenceException and try to do this kind of
    error translation
    public static void getThrowable(javax.persistence.PersistenceException
    perex, int code) {
    boolean updateError = false ;
    boolean deleteError = false ;
    KentException kentex = null ;
    Throwable th = null ;
    if( perex instanceof org.apache.openjpa.persistence.RollbackException) {
    th = perex.getCause();
    if(th instanceof OptimisticLockException) {
    updateError = true ;
    if(perex instanceof OptimisticLockException ){
    updateError = true ;
    th = perex ;
    if(perex instanceof org.apache.openjpa.persistence.EntityNotFoundException) {
    deleteError = true ;
    th = perex ;
    http://n2.nabble.com/OptimisticLockException-confusion.-td210621.html
    Frank

  • EJB is not throwing exception to calling Action class in Unix environment

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

  • OIM11g: The Message-Driven EJB: oimKernelQueueMDB is throwing exception

    Hi All,
    I am getting the following error always and providing trobule to run schedule job "Issue Aduit Message Task"
    ####<Feb 25, 2013 11:40:21 PM EST> <Warning> <EJB> <oimhp02> <prod-oim_oim_server02> <[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <347b29a9270cc81f:-72dc63f2:13d10f9b16f:-8000-000000000001790a> <1361853621251> <BEA-010216> <The Message-Driven EJB: oimKernelQueueMDB is throwing exception when processing the messages. Delivery failed after *2,033 attempts*. The EJB container will suspend the message delivery for 60 seconds before retry.>
    see now the attempt is 2033, its incresing ....
    Env Detais:
    OIM11g 11.3.3.6
    Weblogic 10.3.3
    DB Oracle 11.2
    platform: linx redhat 5
    Can you please help me to solve this issue? Thank you.

    Check MOS Article: 1369008.1
    -Bikash

  • [CDO] Schema Locked Exception after update to CDO 4.4

    Hi
    after updating to CDO 4.4 i get a Schema locked exception (see below). This happens as soon as i try to commit a new EMF-model to the server (even with a "fresh" server and repository).
    I'm using the Derby embedded DBStore with a Security Manager, audits enabled and ensureReferentialIntegrity enabled.
    H2 does not work either.
    The Exception:
    org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: org.eclipse.net4j.db.DBException: Schema locked: SCHEMA_NAME
    at org.eclipse.net4j.internal.db.ddl.DBSchema.assertUnlocked(DBSchema.java:278)
    at org.eclipse.net4j.internal.db.ddl.DBTable.assertUnlocked(DBTable.java:340)
    at org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:104)
    at org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:89)
    at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.createDBField(AbstractTypeMapping.java:162)
    at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initFields(AbstractHorizontalClassMapping.java:197)
    at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:107)
    at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.<init>(HorizontalBranchingClassMapping.java:205)
    at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingMappingStrategy.doCreateClassMapping(HorizontalBranchingMappingStrategy.java:62)
    at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:659)
    at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:651)
    at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageInfos(AbstractMappingStrategy.java:627)
    at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageUnits(AbstractMappingStrategy.java:616)
    at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createMapping(AbstractMappingStrategy.java:538)
    at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy.createMapping(HorizontalMappingStrategy.java:144)
    at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:849)
    at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:81)
    at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.doWrite(DBStoreAccessor.java:828)
    at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:152)
    at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:651)
    at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:48)
    at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
    at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
    at org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:1133)
    at org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:1126)
    at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:320)
    at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:105)
    at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
    at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:98)
    at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:100)
    at org.eclipse.net4j.signal.Signal.doInput(Signal.java:330)
    at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:73)
    at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:67)
    at org.eclipse.net4j.signal.Signal.runSync(Signal.java:254)
    at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    Hi Samuel,
    This is the typical exception which occurs when you change your
    metamodel and the models stored in CDO repo haven't been migrated.
    Best Regards.
    Le 13/07/2015 17:14, Samuel Leisering a écrit :
    > Hi
    >
    > after updating to CDO 4.4 i get a Schema locked exception (see below).
    > This happens as soon as i try to commit a new EMF-model to the server
    > (even with a "fresh" server and repository).
    > I'm using the Derby embedded DBStore with a Security Manager, audits
    > enabled and ensureReferentialIntegrity enabled.
    >
    > H2 does not work either.
    >
    > The Exception:
    >
    > org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore:
    > org.eclipse.net4j.db.DBException: Schema locked: SCHEMA_NAME
    > at
    > org.eclipse.net4j.internal.db.ddl.DBSchema.assertUnlocked(DBSchema.java:278)
    >
    > at
    > org.eclipse.net4j.internal.db.ddl.DBTable.assertUnlocked(DBTable.java:340)
    > at
    > org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:104)
    > at org.eclipse.net4j.internal.db.ddl.DBTable.addField(DBTable.java:89)
    > at
    > org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.createDBField(AbstractTypeMapping.java:162)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.initFields(AbstractHorizontalClassMapping.java:197)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.<init>(AbstractHorizontalClassMapping.java:107)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.<init>(HorizontalBranchingClassMapping.java:205)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingMappingStrategy.doCreateClassMapping(HorizontalBranchingMappingStrategy.java:62)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createClassMapping(AbstractMappingStrategy.java:659)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:651)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageInfos(AbstractMappingStrategy.java:627)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageUnits(AbstractMappingStrategy.java:616)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.createMapping(AbstractMappingStrategy.java:538)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy.createMapping(HorizontalMappingStrategy.java:144)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:849)
    >
    > at
    > org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:81)
    > at
    > org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.doWrite(DBStoreAccessor.java:828)
    >
    > at
    > org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:152)
    >
    > at
    > org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:651)
    >
    > at
    > org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:48)
    >
    > at
    > org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
    >
    > at
    > org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
    >
    > at
    > org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:1133)
    >
    > at
    > org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:1126)
    > at
    > org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:320)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:105)
    >
    > at
    > org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
    >
    > at
    > org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:98)
    >
    > at
    > org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:100)
    >
    > at org.eclipse.net4j.signal.Signal.doInput(Signal.java:330)
    > at
    > org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:73)
    >
    > at
    > org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:67)
    >
    > at org.eclipse.net4j.signal.Signal.runSync(Signal.java:254)
    > at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
    > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    > at java.lang.Thread.run(Unknown Source)
    >
    Esteban Dugueperoux - Obeo
    Need professional services for Sirius?
    http://www.obeodesigner.com/sirius

  • Good books for learning Java(Servlets,JSP,EJB,etc.,),Javascript.

    Hi Experts,
    Can you suggest me some good books on java , javascript.The books should include the internals of Servlets,JSP,EJB.
    Thanks
    vishal

    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=756427&start=7
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=751055
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=743429
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=742997&start=11
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=750775&start=24
    Just a simple search for this forum....
    It took me 10 seconds tofind these..
    JJ

  • JSP Page threw a non-Exception

    Friends,
    I have Servr JRun 3.1. The application has been workin fine since it has been deployed last year.
    Suddenly, I have started getting the following error.
    javax.servlet.ServletException: JSP Page threw a non-Exception Throwable.
    at jrun__*****__***__************ejsp1d._jspService(jrun__******__***__**************2ejsp1d.java, Compiled Code)
    at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java, Compiled Code)
    at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java, Compiled Code)
    at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java, Compiled Code)
    at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
    at allaire.jrun.session.JRunSessionService.service(JRunSessionService.java, Compiled Code)
    at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
    at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java, Compiled Code)
    at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
    at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
    at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java, Compiled Code)
    at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java, Compiled Code)
    at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
    at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)
    I can tell that none of the file has been changed in last one year. I checked the code but did not understand what I should look for.
    Can anybody help me out ???
    Regards,
    Nirav

    DON'T cross-post. It's considered rude:
    http://forum.java.sun.com/thread.jspa?threadID=5199029&start=0&tstart=0
    %

  • JSP Page threw a non-Exception Throwable

    Friends,
    I have Servr JRun 3.1. The application has been workin fine since it has been deployed last year.
    Suddenly, I have started getting the following error.
    javax.servlet.ServletException: JSP Page threw a non-Exception Throwable.
         at jrun__*****__***__************ejsp1d._jspService(jrun__******__***__**************2ejsp1d.java, Compiled Code)
         at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java, Compiled Code)
         at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java, Compiled Code)
         at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
         at allaire.jrun.session.JRunSessionService.service(JRunSessionService.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
         at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java, Compiled Code)
         at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java, Compiled Code)
         at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
         at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)
    I can tell that none of the file has been changed in last one year. I checked the code but did not understand what I should look for.
    Can anybody help me out ???
    Regards,
    Nirav

    Well what does the jsp being invoked do?
    at jrun__*****__***__************ejsp1d._jspService(jrun__******__***__**************2ejsp1d.java, Compiled Code)
    I presume you have obfuscated this with the asterisks? That should identify which jsp the error is occurring on.
    Do you have your own "throwable" which does not extend exception?
    Is there a more complete message/stack trace in the logs?

  • Thread Locking Exception

    Hi All,
    Many times while working on MDM via MDM API's I received Thread Locking Exception. This Exception is so severe that it leads MDM Data Manager in  hanged state and get resolved only by restarting the server. Sometimes I do not get this exception but Data Manager gets hanged, even I am unable to open Console also. Please answer this question.
    Thanks ..
    Vibha

    Hello All,
    Still we haven't able to resolve this issue. We already have SR with oracle. So many logs were captured.
    Below is the snippet of seedSchedulerdata.log
    ${work.dir}Entered Validate methodExiting Validate method------------------------------------------------------------
    Start seeding task
    job name--> Password Expiration Task
    schTaskName--> Password Expiration Task
    task class name--> com.thortech.xl.schedule.tasks.tcTskPasswordExpiration
    task job disable--> 0
    task frequency--> DAILY
    task maxRetries--> 5
    task retryCount--> 0
    task paramName--> Email Definition Name
    task paramValue--> Password Expired
    task paramTpe--> String
    Updating Job :Password Expiration Task with keys
    java.lang.Exception: Unable to seed scheduler data due to configuration problems. Contact System Administrator
         at oracle.iam.scheduler.seed.SeedSchedulerData.startSeeding(SeedSchedulerData.java:770)
         at oracle.iam.scheduler.seed.SeedSchedulerData.main(SeedSchedulerData.java:113)
    If any of them faced such issue please help.
    Thanks
    DK

  • Optimistic Lock Exceptions

    Another question:
    I'm getting some optimistic lock exceptions for object which I believe
    should only be modified in a single transaction. How can I see the context
    in which each modification took place?
    What is the definition of a 'modification', i.e. what operations on an
    object take an optimistic lock?
    Thanks,
    Tom

    Tom-
    In article <blj328$1i4$[email protected]>, Tom Davies wrote:
    >
    Another question:
    I'm getting some optimistic lock exceptions for object which I believe
    should only be modified in a single transaction. How can I see the context
    in which each modification took place?Try catching the lock exception and getting the FailedObject to see which
    object failed.
    You could also track which objects are being saved by
    implementing javax.jdo.InstanceCallbacks and doing some logging in
    jdoPreStore(). You could also try watching the SQL log to see if any
    suspicious updates are taking place.
    What is the definition of a 'modification', i.e. what operations on an
    object take an optimistic lock?Any field change or the addition/deletion to any related fields.
    Thanks,
    Tom--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Exception : JSP & EJB

    Hi,
    I'm working on a project but it doens't work perfectly.
    It use J2EE, EJB and JSP technology but I'm fresh in this field.
    At the moment, sometimes (but not for each utilisation and I don't unterdstand why !) there is a Servlet exception which is :
    A Servlet Exception Has Occurred
    Exception Report:
    javax.servlet.ServletException: Cannot create bean of class util.DocumentationServicesBean
    Root Cause:
    java.lang.ClassNotFoundException: class util.DocumentationServicesBean : java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException: Client not authorized for this invocation.
         at java.beans.Beans.instantiate(Beans.java:211)
         ... ... ...If someone know the reason of this problem, please let me know.
    Thanks !

    it's not a servlet exception but when ur jsp/servlet is trying to invoke the EJBs, by any means, like creating a new instance, or just getting the pre-existed data by some finder method etc. etc., some times it doesn't have sufficient rights to do that call. Then ur ejb server throws an error, which ultimately comes to the webserver in the form of ServletException.
    java.rmi.RemoteException: Client not authorized for this invocation.
    at java.beans.Beans.instantiate(Beans.java:211)check ur deployment descriptor for the different roles and their rights, and different methods and permissions for them.
    good luck,

  • JSP- EJB Communication

    I have a client-server application where my client is an applet and the server is an EJB.
    The HTML code to launch the applet is dynamically generated by a JSP page. Now i want this JSP page to be able to communicate with the EJB.
    What i need is that the JSP page will pass a parameter to the Applet and the same parameter will be notified to the EJB. So that when the Applet accesses the EJB, the EJB could verify whether the parameter is correct.
    Could someone show me a way to achieve this.
    I am doing all these bcos since it the applet that acceses the EJB anyone who could manage to get the Applet jar file can access the EJB unauthorizedly,with the help of a decompiler.
    If anyone has a better solution to this problem, kindly let me know
    regards
    Raees

    Greetings,
    What i need is that the JSP page will pass a parameter
    to the Applet and the same parameter will be notified
    to the EJB. So that when the Applet accesses the EJB,
    the EJB could verify whether the parameter is correct.Unless you're using a database to hold the verification parameter you're looking at several problems here, especially if your EJB is a Session Bean. Firstly, if your bean is Stateful (SB) you will get an exception when your Applet tries to access the bean since Session Beans are not shareable among multiple threads (meaning, in this case, "clients"). If your bean is Stateless it can store the parameter internally, however, Stateless beans are poolable. This means when your Applet tries to verify itself there's no guarantee that the bean holding the parameter from the JSP is the same bean the Applet verifies against. However...
    Could someone show me a way to achieve this. One way this can be handled is with a "verification" Stateless SB and a temporary database table. The bean can have a method to generate a temporary "key" which it stores in the temporary table and passes back to the caller (JSP). The JSP then passes this as a parameter to the Applet which invokes a method to validate the key. This method would then check the table for the specified key and delete it upon successful verification. However, since you would be embedding a security construct within the web page it is advisable to perform the page loading over SSL...
    I hope this helps.
    regards
    Raees Regards,
    Tony "Vee Schade" Cook

  • JSP/EJB sample-problem

    Hi,
    I'm having difficulties to get the Oracle JSP sample to wrok.
    I deployed the JSP App and also the StackDemo app and changed the envrionment variables as requested .
    But each time I try to use the DemoStack bean by submitting a 'create stack' I get the message :
    "The requested access method is not allowed for that object"
    Can anybody help me with this problem?
    Michel.

    Alex,
    I use OAS 4.0.8.1.
    I also reloaded the application after deployment.
    I used a clinet snippet that is compiled in JDevelope 3.0 and I run it from there .
    It finds THE EJB , ic reated and deployed without giving any error messages. The problem rises the moment I try to use one of the functions of the remote interface of the EJB. In these functions I try to use functionality of viewObjects that are provided by a bussines component that I generated using JDeveloper 3.0.
    The wrb log file mentions a 'null pointer exeption'.
    I think that I do something wrong when initializing the application module that wraps the business component, but I can't see what is wrong.
    This is the code I use in my EJB :
    String theAM = "EDMpackage.EDMAppModule";
    ApplicationModule root = null;
    String sessionDefName = ApplicationModule.DEFAULT_DEF_FULL_NAME;
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    try
    Context ic = new InitialContext(env);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(sessionDefName);
    root = home.create();
    catch(Exception e)
    e.printStackTrace();
    localAppMod = root.createApplicationModule( "EDMAppMod",theAM );
    This works fine , but when I try to get a ViewObject through the localAppMod, I get the error. So I think I am wrong somewhere here.
    Michel.

  • JSP, EJB in Jboss 4 with mySQL database. Error in connecting to database

    Hi, i using JBoss 4-0-1 with jsp and mySQL database. I get this example from a book using stateless session beans. However i modify it so it can connect to mySQL database.
    This is my code for jsp.
    <%@ page import="asg.MusicEJB.*,
    java.util.*,
    javax.naming.Context,
    javax.naming.InitialContext,
    javax.rmi.PortableRemoteObject" errorPage="error.jsp" %>
    <%--
         The following 3 variables appear in a JSP declaration.
         They appear outside the generated _jspService() method,
         which gives them class scope.
         Since we want to initialize our Music EJB object once
         and read the Music Collection database to get the
         recording titles once, we place this code inside
         method jspInit().
         The EJB business method getMusicList()
         returns a collection of RecordingVO objects which we
         store in ArrayList albums.
    --%>
    <%!
         MusicHome musicHome;
         Music mymusic;
         ArrayList albums;
         Properties properties=new Properties();
         public void jspInit() {
                   properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                   properties.put(Context.PROVIDER_URL, "localhost:3306");
                   System.out.println("............................in properties");
              try {
                   //Context initial = new InitialContext();
                   InitialContext jndiContext = new InitialContext(properties);
                   //Object ref  = jndiContext.lookup("MusicEJB");
                   Object objref = jndiContext.lookup("java:comp/env/ejb/EJBMusic");
                   musicHome = (MusicHome)PortableRemoteObject.narrow(objref, MusicHome.class);
                   mymusic = musicHome.create();
                   albums = mymusic.getMusicList();
                   System.out.println(".............................in line 64");
              } catch (Exception ex) {
                   System.out.println("Unexpected Exception............: " +
                             ex.getMessage());
                   ex.printStackTrace();
    %>
    <%--
         The following scriptlet accesses the implicit
         request object to obtain the current URL
         and saves it to the session object for later retrieval. 
         It also saves variable mymusic, so we can
         make remote calls to our Music EJB, and the collection of
         RecordingVO objects.  These variables will all be available
         to other pages within the session.
    --%>
    <%
         String requestURI = request.getRequestURI();
         session.putValue("url", requestURI);
         session.putValue("mymusic", mymusic);
         session.putValue("albums", albums);
    %>
    <html>
    <head>
    <title>Music Collection Database Using EJB & JSP Version 9.7</title>
    </head>
    <body bgcolor=white>
    <h1><b><center>Music Collection Database Using EJB & JSP</center></b></h1>
    <hr>
    <p>
    There are <%= albums.size() %> recordings.
    <form method="post" action="musicPost.jsp">
    <p>
    Select Music Recording:
    <select name="TITLE">
    <%
         // Generate html <option> elements with the recording
         // titles stored in each RecordingVO element.
         // Obtain the current title from the session object
         // (this will be null the first time).
         String title;
         String currentTitle = (String)session.getValue("curTitle");
         if (currentTitle == null) currentTitle = "";
         RecordingVO r;
         Iterator i = albums.iterator();
         while (i.hasNext()) {
              r = (RecordingVO)i.next();
              title = r.getTitle();
              if (title.equals(currentTitle)) {
                   out.println("<option selected>" + title + "</option>");
              else {
                   out.println("<option>" + title + "</option>");
    %>
    </select><p><p>
    <%--
         Provide a "View Tracks" button to submit
         the requested title to page musicPost.jsp
    --%>
    <input TYPE="submit" NAME="View" VALUE="View Tracks">
    </form>
    </body>
    </html>Message was edited by:
    chongming

    This is the deployment descriptor for the .ear file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
      <display-name>MusicDAOApp</display-name>
      <description>Application description</description>
      <module>
        <web>
          <web-uri>war-ic.war</web-uri>
          <context-root>music</context-root>
        </web>
      </module>
      <module>
        <ejb>ejb-jar-ic.jar</ejb>
      </module>
    <!--
      <module>
        <java>app-client-ic.jar</java>
      </module>
    -->
    </application>
    And this is the deployment for the ejb class files:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
      <display-name>MusicEJB</display-name>
      <enterprise-beans>
        <session>
          <display-name>MusicEJB</display-name>
          <ejb-name>MusicEJB</ejb-name>
          <home>asg.MusicEJB.MusicHome</home>
          <remote>asg.MusicEJB.Music</remote>
          <ejb-class>asg.MusicEJB.MusicBean</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Bean</transaction-type>
          <env-entry>
            <env-entry-name>MusicDAOClass</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>asg.MusicEJB.MusicDAOCloudscape</env-entry-value>
          </env-entry>
         <env-entry>
         <env-entry-name>dbUrl</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>jdbc:mysql://localhost/music</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>dbUserName</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>chongming</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>dbPassword</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>kcm82</env-entry-value>
         </env-entry>
          <security-identity>
            <description></description>
            <use-caller-identity></use-caller-identity>
          </security-identity>
        </session>
      </enterprise-beans>
    </ejb-jar>I can combine the jar and war files into a ear file. deploying is alright without any errors.
    However when i run the jsp, it prompt this error:
    You Have Encountered an Error
    Stack Trace
    java.lang.NullPointerException
         at org.apache.jsp.musicGet_jsp._jspService(org.apache.jsp.musicGet_jsp:111)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    How to i solve the error? I look at he catch results in the command prompt of JBoss , i found that when running, the code will be caught by the exception and display this:int.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
    kerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    13:55:21,375 INFO [STDOUT] Unexpected Exception............: EJBException:; nes
    ted exception is:
    javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
    The url cannot be null
    13:55:21,375 INFO [STDOUT] java.rmi.ServerException: EJBException:; nested exce
    ption is:
    javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
    The url cannot be null 13:55:21,375 INFO[STDOUT] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
    13:55:21,375 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
    What can i do to solve the problem? please helpMessage was edited by:
    chongming
    Message was edited by:
    chongming
    Message was edited by:
    chongming

Maybe you are looking for