Check if an exception is thrown during my JUnit test

Hi all,
I've been writing unit tests for the application I'm writing.
I'm trying to write one very generic test which will simply open up the application, press some buttons, and close it back down, and confirm that no exceptions were thrown at any time during the test.
Unfortunately, while I figured I could just wrap the whole thing in a try/catch block, it seems that I have an exception that is being thown in the AWT-EventQueue which isn't being caught. The test passes fine, but I want it to fail.
What is the best way to go about checking for this? Should I be running the test in the event queue? Or should I have my own error handler to catch the exceptions?
Thanks!
Tim

jschell wrote:
TimQuinn wrote:
I'm not trying to fix the bug. I'm trying to make my JUnit tests catch the exception. I think we're going around in circles here.Yep. Because the problem was stated incorrectly.
Exceptions are returned up the call stack within the thread of execution.
You have two threads. The one that the test runs in A, and another B.
You can't catch or even see an exception in A that originated in B as an exception (you can't catch it.)
So you need to find some other way, some other place, to put a catch, in thread B and then create data which indicates whether it worked or not. Or find some other existing data that changes state because of that.Well, the question that I asked in my original post was exactly that: how do I find out about an exception that is thrown in another thread? If something got stated incorrectly, maybe it was in the later posts?
It can't be impossible: I can think of one very simple solution to my question, but it isn't very good. I can simply replace the Standard Error writer with one that sets a"fail" flag every time it is called. Then my test can fail every time Standard Error is written to, no matter which thread it's in. Obviously, this isn't a great solution, because, while it would fail the test every time an exception was printed, it would fail other times as well.
So with a bit more work I could parse what's written to stderr myself, to check if it's a real exception. But this really seems like re-inventing the wheel. Is there no standard pattern for creating a test that confirms that you can run something without generating exceptions?

Similar Messages

  • EJB5018: An exception was thrown during an ejb invocation on [ResultFacade]

    I have a problem to access from application client to methods of session beans
    the problem haw to call this method "getcodesresultcampbean("ARTV")"
    EJB5018: An exception was thrown during an ejb invocation on [ResultFacade]
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoClassDefFoundError: org/postgresql/jdbc3/Jdbc3PreparedStatement
    at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:3591)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3436)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:71)
    at $Proxy306.findByRefCampagne(Unknown Source)
    at com.bellconsulting.praxys.stats.service.StatCampagneBean.getcodesresultcampbean(StatCampagneBean.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:589)
    at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
    at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:67)
    at $Proxy305.getcodesresultcampbean(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:589)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    Caused by: java.lang.NoClassDefFoundError: org/postgresql/jdbc3/Jdbc3PreparedStatement
    at org.postgresql.jdbc3.Jdbc3Connection.prepareStatement(Jdbc3Connection.java:37)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdbc3Connection.java:266)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.prepareStatement(AbstractJdbc2Connection.java:151)
    at com.sun.gjc.spi.ConnectionHolder.prepareStatement(ConnectionHolder.java:413)
    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
    at org.hibernate.loader.Loader.doQuery(Loader.java:661)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
    at org.hibernate.loader.Loader.doList(Loader.java:2211)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
    at org.hibernate.loader.Loader.list(Loader.java:2090)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
    at com.bellconsulting.praxys.stats.facades.ResultFacade.findByRefCampagne(ResultFacade.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    **************************code source************** ResultFacade******
    package com.bellconsulting.praxys.stats.facades;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import com.bellconsulting.praxys.stats.entities.Result;
    * @author idriss
    @Stateless
    public class ResultFacade implements ResultFacadeLocal {
    @PersistenceContext
    private EntityManager em;
    /** Creates a new instance of ResultFacade */
    public ResultFacade() {
    public void create(Result result) {
    em.persist(result);
    public void edit(Result result) {
    em.merge(result);
    public void destroy(Result result) {
    em.merge(result);
    em.remove(result);
    public Result find(Object pk) {
    return (Result) em.find(Result.class, pk);
    public List findAll() {
    return em.createQuery("select object(o) from Result as o").getResultList();
    public List findByRefCampagne (String campaignCode) {
    return em.createNamedQuery("Result.findByRefcampagne").setParameter("refcampagne", campaignCode).getResultList();
    *****************StatCampagneBean********
    package com.bellconsulting.praxys.stats.service;
    import com.bellconsulting.praxys.stats.facades.ResultFacadeLocal;
    import java.sql.Date;
    import javax.ejb.EJB;
    import javax.ejb.Stateful;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import com.bellconsulting.praxys.stats.entities.Campaign;
    import com.bellconsulting.praxys.stats.entities.Result;
    import com.bellconsulting.praxys.stats.facades.CampaignFacadeLocal;
    import java.util.Iterator;
    import java.util.List;
    * @author idriss
    @Stateful
    public class StatCampagneBean implements StatCampagneRemote {
    @EJB
    private CampaignFacadeLocal campaignFacade;
    private @EJB ResultFacadeLocal resultFacade;
    private String _campagnecode;
    /** Creates a new instance of StatCampagneBean */
    public StatCampagneBean() {
    public StatCampagneBean(String campagnecode)
    this._campagnecode= campagnecode;
    @PersistenceContext
    private EntityManager _manager;
    public int getnbreOKbean(String codecampagne) {
    //TODO implement getnbreOK
    Campaign camp= _manager.find(Campaign.class,codecampagne);
    return camp.getNbRepPositive();
    public void statCodesResultats(String nomcamp, String codecamp, Date datedebut, Date datefin) {
    //TODO implement statCodesResultats
    public String[ ] getcodesresultcampbean(String codecamp) {
    //TODO implement getcodesresultcampbean
    // _manager.getTransaction().begin();
    /* EntityManagerFactory emf = Persistence.createEntityManagerFactory("Result");
    EntityManager em = emf.createEntityManager();
    String querystring = "select object(r) from Result r"+" where r.refcampagne = ?1";
    Query query =em.createQuery(querystring).setParameter(1,codecamp);
    *for (Result r : coderesultList)
    coderesult[j++]= r.getResultPK().getCode().toString();
    // List<Result> coderesultList = query.getResultList();
    List<Result> coderesultList = resultFacade.findByRefCampagne(codecamp);
    Iterator<Result> itr = coderesultList.iterator();
    String[]codesresult =null;
    int j= 0;
    while (itr.hasNext()){
    codesresult[j++] =itr.next().getResultPK().getCode().toString();
    // _manager.getTransaction().commit();
    return codesresult;
    *********************Application client *************
    package application.praxys;
    import com.bellconsulting.praxys.stats.service.StatCampagneRemote;
    import javax.swing.JOptionPane;
    import stats.praxys.*;
    * @author idriss
    public class Main {
    /** Creates a new instance of Main */
    public Main() {
    * @param args the command line arguments
    public static void main(String[] args) {
    // TODO code application logic here
    // InitialContext ctx;
    String[] nbreok =null ;
    int c =0;
    /* try {
    ctx = new InitialContext();
    StatCampagneRemote simpleSession = (StatCampagneRemote) ctx.lookup(StatCampagneRemote.class.getName());
    nbreok = simpleSession.getnbreOK("ARTV");
    System.out.println("voici un resultaaaaaaaaaaaaaaaaaaaaa"+" "+nbreok);
    } catch (NamingException ex)
    TeleVenteServiceLocator tvLocator = new TeleVenteServiceLocator();
    StatCampagneRemote statCampagneBean = (StatCampagneRemote)tvLocator.getCampaignService();
    JOptionPane.showMessageDialog(null, "dfsdfsdfsfsq");
    nbreok=statCampagneBean.getcodesresultcampbean("ARTV");
    //nbreok =statCampagneBean.getnbreOKbean("ARTV");
    System.out.println("voici un resultaaaaaaaaaaaaaaaaaaaaa "+ nbreok[1]);
    JOptionPane.showMessageDialog(null, "dfsdfsdfsfsq"+nbreok[2]);
    ***************Result entity bean*********
    package com.bellconsulting.praxys.stats.entities;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.EmbeddedId;
    import javax.persistence.Entity;
    import javax.persistence.JoinColumn;
    import javax.persistence.ManyToOne;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    * Entity class Result
    * @author idriss
    @Entity
    @Table(name = "result")
    @NamedQueries( {
    @NamedQuery(name = "Result.findByCode", query = "SELECT r FROM Result r WHERE r.resultPK.code = :code"),
    @NamedQuery(name = "Result.findByLibelle", query = "SELECT r FROM Result r WHERE r.libelle = :libelle"),
    @NamedQuery(name = "Result.findByPriorite", query = "SELECT r FROM Result r WHERE r.priorite = :priorite"),
    @NamedQuery(name = "Result.findByPrix", query = "SELECT r FROM Result r WHERE r.prix = :prix"),
    @NamedQuery(name = "Result.findByResType", query = "SELECT r FROM Result r WHERE r.resType = :resType"),
    @NamedQuery(name = "Result.findByRefcampagne", query = "SELECT r FROM Result r WHERE r.resultPK.refcampagne = :refcampagne"),
    @NamedQuery(name = "Result.findByRetValue", query = "SELECT r FROM Result r WHERE r.retValue = :retValue"),
    @NamedQuery(name = "Result.findByRetUnit", query = "SELECT r FROM Result r WHERE r.retUnit = :retUnit")
    public class Result implements Serializable {
    * EmbeddedId primary key field
    @EmbeddedId
    protected ResultPK resultPK;
    @Column(name = "libelle")
    private String libelle;
    @Column(name = "priorite", nullable = false)
    private int priorite;
    @Column(name = "prix", nullable = false)
    private float prix;
    @Column(name = "resType")
    private Integer resType;
    @Column(name = "retValue")
    private Integer retValue;
    @Column(name = "retUnit")
    private String retUnit;
    @JoinColumn(name = "refcampagne", referencedColumnName = "code", insertable = false, updatable = false)
    @ManyToOne
    private Campaign campaign;
    /** Creates a new instance of Result */
    public Result() {
    * Creates a new instance of Result with the specified values.
    * @param resultPK the resultPK of the Result
    public Result(ResultPK resultPK) {
    this.resultPK = resultPK;
    * Creates a new instance of Result with the specified values.
    * @param resultPK the resultPK of the Result
    * @param priorite the priorite of the Result
    * @param prix the prix of the Result
    public Result(ResultPK resultPK, int priorite, float prix) {
    this.resultPK = resultPK;
    this.priorite = priorite;
    this.prix = prix;
    * Creates a new instance of ResultPK with the specified values.
    * @param refcampagne the refcampagne of the ResultPK
    * @param code the code of the ResultPK
    public Result(String refcampagne, String code) {
    this.resultPK = new ResultPK(refcampagne, code);
    * Gets the resultPK of this Result.
    * @return the resultPK
    public ResultPK getResultPK() {
    return this.resultPK;
    * Sets the resultPK of this Result to the specified value.
    * @param resultPK the new resultPK
    public void setResultPK(ResultPK resultPK) {
    this.resultPK = resultPK;
    * Gets the libelle of this Result.
    * @return the libelle
    public String getLibelle() {
    return this.libelle;
    * Sets the libelle of this Result to the specified value.
    * @param libelle the new libelle
    public void setLibelle(String libelle) {
    this.libelle = libelle;
    * Gets the priorite of this Result.
    * @return the priorite
    public int getPriorite() {
    return this.priorite;
    * Sets the priorite of this Result to the specified value.
    * @param priorite the new priorite
    public void setPriorite(int priorite) {
    this.priorite = priorite;
    * Gets the prix of this Result.
    * @return the prix
    public float getPrix() {
    return this.prix;
    * Sets the prix of this Result to the specified value.
    * @param prix the new prix
    public void setPrix(float prix) {
    this.prix = prix;
    * Gets the resType of this Result.
    * @return the resType
    public Integer getResType() {
    return this.resType;
    * Sets the resType of this Result to the specified value.
    * @param resType the new resType
    public void setResType(Integer resType) {
    this.resType = resType;
    * Gets the retValue of this Result.
    * @return the retValue
    public Integer getRetValue() {
    return this.retValue;
    * Sets the retValue of this Result to the specified value.
    * @param retValue the new retValue
    public void setRetValue(Integer retValue) {
    this.retValue = retValue;
    * Gets the retUnit of this Result.
    * @return the retUnit
    public String getRetUnit() {
    return this.retUnit;
    * Sets the retUnit of this Result to the specified value.
    * @param retUnit the new retUnit
    public void setRetUnit(String retUnit) {
    this.retUnit = retUnit;
    * Gets the campaign of this Result.
    * @return the campaign
    public Campaign getCampaign() {
    return this.campaign;
    * Sets the campaign of this Result to the specified value.
    * @param campaign the new campaign
    public void setCampaign(Campaign campaign) {
    this.campaign = campaign;
    * Returns a hash code value for the object. This implementation computes
    * a hash code value based on the id fields in this object.
    * @return a hash code value for this object.
    @Override
    public int hashCode() {
    int hash = 0;
    hash += (this.resultPK != null ? this.resultPK.hashCode() : 0);
    return hash;
    * Determines whether another object is equal to this Result. The result is
    * <code>true</code> if and only if the argument is not null and is a Result object that
    * has the same id field values as this object.
    * @param object the reference object with which to compare
    * @return <code>true</code> if this object is the same as the argument;
    * <code>false</code> otherwise.
    @Override
    public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Result)) {
    return false;
    Result other = (Result)object;
    if (this.resultPK != other.resultPK && (this.resultPK == null || !this.resultPK.equals(other.resultPK))) return false;
    return true;
    * Returns a string representation of the object. This implementation constructs
    * that representation based on the id fields.
    * @return a string representation of the object.
    @Override
    public String toString() {
    return "com.bellconsulting.praxys.stats.entities.Result[resultPK=" + resultPK + "]";
    Message was edited by:
    081283

    Try posting this on the EJB forum:
    http://forum.java.sun.com/forum.jspa?forumID=13

  • [svn] 1043: Bug: LCDS-184 - Concurrent modification exception thrown during remote subscription management

    Revision: 1043
    Author: [email protected]
    Date: 2008-03-31 15:22:13 -0700 (Mon, 31 Mar 2008)
    Log Message:
    Bug: LCDS-184 - Concurrent modification exception thrown during remote subscription management
    QA: Yes
    Doc: No
    Details:
    Make the 'subscriptions' set in MessageClient/RemoteMessageClient concurrent modification safe.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-184
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/RemoteMess ageClient.java

  • [svn] 1044: Bug: LCDS-184 - Concurrent modification exception thrown during remote subscription management

    Revision: 1044
    Author: [email protected]
    Date: 2008-03-31 15:23:07 -0700 (Mon, 31 Mar 2008)
    Log Message:
    Bug: LCDS-184 - Concurrent modification exception thrown during remote subscription management
    QA: Yes
    Doc: No
    Details:
    Make the 'subscriptions' set in MessageClient/RemoteMessageClient concurrent modification safe.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-184
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/MessageClient.java

  • Check Conditions and exceptions

    I have the two tables:
    The first is a Chequing accounts table. This table has two
    number fields, the first is called balance, and the second is
    called Overdraft.
    The second is a Savings accounts table. This table has one
    field of importance, and that is the balance alone.
    I was thinking of making triggers that would fire after the
    transactions are executed. If the trigger finds that the either
    the Chequing balance is lesser than the negative overdraft, or
    if the Savings balance is lesser than 0, then the trigger would
    prevent the changes from being made.
    I was considering the use of a trigger that would spread an
    exception to the Transaction procedure. This would work as
    follows (Pardon me if the code has problems, I'm just writing
    from scratch):
    create trigger chq_acct after update on chq_acct for each row
    declare
    declare exception insufficient_funds here
    begin
    if balance < (- overdraft) then
    raise insuffiecient_funds
    end
    The things I need to know is how to pass this exception onto the
    procedure that is handling the update. However, I have not seen
    examples on how this is done yet.
    Another possibility is more modest and probably easier to
    handle: using a check constraint to verify data. In the savings
    acct, I can simply add a check constraint and if it is violated
    during update, catch the exception with the appropriate code
    (which I don't know what it is). However, I do not know about
    the check constraint for the Chequing accounts. It should be
    Balance > (- Overdraft), but this is a "variable" constraint as
    different customers have different levels of overdraft. Does
    Oracle handle this kind of constraint? If not, how should one
    handle it?
    Thanks

    hi....
    Trigger is a good idea.
    You can raise an application error in the trigger. Carefully
    define the two constants, ...msg and ...num - especially since
    the num should not be used for other exceptions. I usually put
    them in the specification of an PL/SQL block for global access.
    I added them to your code an example of what's needed.
    create trigger chq_acct after update on chq_acct for each row
    declare
    kc_sqlerrmsg_insufficientfunds CONSTANT VARCHAR2
    () := 'Insufficient funds.' ;
    kn_sqlerrmum_insufficientfunds CONSTANT NUMBER(5,0) := -
    20000 ; -- between -20000 and -20999
    begin
    if balance < (- overdraft) then
    --raise insuffiecient_funds
         RAISE_APPLICATION_ERROR ( kn_sqlerrmum_insufficientfunds
    kc_sqlerrmsg_insufficientfunds
    end Then when ever an update throws the exception, the query will be
    rolled back UNLESS you handle your new exception.
    Put your update query into an PL/SQL block with the exception.
    Be sure to tie the exception in the trigger using your defined
    exception and the all important ...num.
    The WHEN OTHERS THEN RAISE allows other exceptions to be handled
    by other, containg PL/SQL blocks.
    In the EXCEPTION part of the PL/SQL block, when the
    insuficient_funds exception is thrown, the variable SQLCODE will
    have your ...num in it and SQLERRM will have your ...msg in it.
    This is cool because when another UPDATE not in a block throws
    the exception in the trigger, whoever is trying to figure out
    what happened can use these!
    DECLARE
      kn_sqlerrmum_insufficientfunds CONSTANT NUMBER(5,0) := -
    20000 ; -- between -20000 and -20999
         insufficient_funds     EXCEPTION ;
         PRAGMA EXCEPTION_INIT ( insufficient_funds,
    kn_sqlerrmum_insufficientfunds )
    BEGIN
         UPDATE  .... SET balance .... ;
    EXCEPTION
         WHEN insufficient_funds THEN
          ...code to handle the potential overdraft...
         WHEN OTHERS THEN RAISE ;
    END ;
    Hope this helps. Good Luck.

  • NO EXCEPTION IS THROWN FROM THE PERSIST

    We are using Glassfish and MySQL. When we do a persist with a bad object/query, internal DB errors are NOT being reported back to the caller in any way, but Glassfish knows that the error occurred. Here is a schematic of the situation:
         Glassfish starts a CMP transaction and calls our bean
              Inside the bean we have code like this:
                   obj = (a new object that will cause a DB error when persisted)
                   try {
                        entityManager.persist(obj)
                   } catch (Throwable t) {
                        report to the user that the throwable happened
              bean returns
         Glassfish manages CMP transaction
    What we see is the following:
         - The persist has an internal failure and generates error messages in the Glassfish system.log file.
         - NO EXCEPTION IS THROWN FROM THE PERSIST, so the application code thinks that the persist completed correctly
         - At the end of the bean operation, Glassfish (correctly) rolls back the transaction.
    At the user level the result is that the request succeeds but nothing is put into the Database!
    We are not asking about the cause of the DB error. From reading the system log we know what happened and can fix it. Our problem is that problems in our field-deployed systems cannot be detected by the application code so failures cannot be reported to the user.
    The critical question is:
         Is there a way for the application code in the bean to see that an error occurred?
    By the way, we also have a secondary question: Why is the erroneous persist tried 6 times before deciding it won't work? Is there an option somewhere that says to try 6 times?
    The Exception as reported in the system log (only one copy of it) is included below.
    [#|2008-10-22T08:32:25.992-0400|WARNING|sun-appserver9.1|oracle.toplink.essentials.session.file:/opt/localVendors/glassfish/tems-glassfish-v1/domains/domain1/applications/j2ee-apps/im-app/im-ejb_jar/-local|_ThreadID=138;_ThreadName=p: thread-pool-1; w: 156;_RequestID=509e7043-21bb-410c-b795-19e9953afeec;|
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'STATIONCODE' cannot be null
    Error Code: 1048
    Call: INSERT INTO <exact operation and table contents elided from this trace file>
         at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:654)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:703)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:492)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeCall(AbstractSession.java:690)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:346)
         at oracle.toplink.essentials.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:191)
         at oracle.toplink.essentials.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:205)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:564)
         at oracle.toplink.essentials.queryframework.InsertObjectQuery.executeCommit(InsertObjectQuery.java:89)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(DatabaseQueryMechanism.java:750)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(DatabaseQueryMechanism.java:714)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.insertObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:602)
         at oracle.toplink.essentials.queryframework.WriteObjectQuery.executeCommitWithChangeSet(WriteObjectQuery.java:162)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:390)
         at oracle.toplink.essentials.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:109)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:555)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:138)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:110)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2233)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:269)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:190)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:2657)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1044)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:403)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1126)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:2443)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:202)
         at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:131)
         at oracle.toplink.essentials.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:91)
         at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:99)
         at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:158)
         at com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2548)
         at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:278)
         at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:249)
         at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
         at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:309)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1030)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
         at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1226)
         at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1197)
         at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:79)
         at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:139)
         at $Proxy364.afterDelivery(Unknown Source)
         at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:324)
         at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'STATIONCODE' cannot be null
         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
         at com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:840)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:647)
         ... 53 more
    |#]

    This is because the persistent context is not synchronized with the database until the commit is being executed.
    You might 'force' this by calling entityManager.flush() right after the call to persist(...).
    Or you register a transaction synchronizer and check the transaction status on afeterCompletion().
    - Roy

  • Sun J2EE SDK 1.3_01, java.lang.ClassCastException thrown during deployment

    I encountered a bug while using the deploytool to deploy
    an EAR file to the Sun J2EE 1.3_01 server.
    I submitted a bug report to Sun via the Sun Java Developer Connection.
    (Sorry, it has not been assigned a BugID yet)
    Question:
    Does anybody know if the web container in Sun's
    J2EE 1.3_01 server supports access to local enterprise beans?
    Screenshots of the bug are available at
    http://sync4j.sourceforge.net/deploymentbug/
    Full details below....
    -Sean
    category: j2ee
    subcategory: deployment
    release: 1.3_01
    hardware: x86
    OSversion: windows_2000
    synopsis: java.lang.ClassCastException thrown during deployment of Session bean
    java -version
    java version "1.3.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
    Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
    C:\j2sdkee1.3\bin>j2ee -version
    Java 2 Enterprise Edition version 1.3_01, build 1.3_01-b01
    I built a EJB 2.0 compliant stateful session bean.
    The session bean has a remote interface (ISyncRemote),
    a remote home interface (ISyncHomeRemote),
    a local interface (ISyncLocal),
    and a local home interface (ISyncHomeLocal).
    I built an HTTP Servlet that is supposed to access
    the Stateful Session Bean using ISyncHomeLocal and
    ISyncLocal
    I run "deploytool.bat" in GUI mode to perform the deployment.
    During deployment, the deploytool GUI displays a message
    box which states:
    "There was a deployment error.
    java.rmi.ServerException: RemoteException occurred in server thread;
    nested exception is:
    java.rmi.RemoteException: An error was encountered while loading
    a web component.
    Please refer to
    <J2EE_HOME>/logs/<machine-name>/j2ee//j2ee/error.log
    for more information. Please verify your Application with the
    Verifier tool."
    The "error.log" file did not contain any useful information.
    I ran the J2EE "verifier.bat" tool to verify that my EAR archive is OK.
    The Sun J2EE server output this error string:
    "java.lang.ClassCastException:
    com.sun.enterprise.deployment.EjbExternalDescriptor"
    Here is the full output from the Sun J2EE server:
    C:\j2sdkee1.3\bin>j2ee -verbose
    J2EE server listen port: 1050
    Naming service started:1050
    Binding DataSource, name = jdbc/EstoreDB, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/Cloudscape, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/DB1, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/DB2, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/InventoryDB, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
    Binding DataSource, name = jdbc/XACloudscape__xa, dataSource =
    COM.cloudscape.core.RemoteXaDataSourc
    e@245536
    Starting JMS service...
    Initialization complete - waiting for client requests
    Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
    Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
    Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
    Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
    >
    Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
    Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
    >
    Starting web service at port: 8000
    Starting secure web service at port: 7000
    J2EE SDK/1.3
    Starting web service at port: 9191
    J2EE SDK/1.3
    J2EE server startup complete.
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_LocalHomeImpl.java ....
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_EJBLocalObjectImpl.java ....
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_RemoteHomeImpl.java ....
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_EJBObjectImpl.java ....
    rmic sync4j.server.syncbean.SyncBean_RemoteHomeImpl...
    rmic sync4j.server.syncbean.SyncBean_EJBObjectImpl...
    c:\j2sdkee1.3\repository\rbi\applications\Sync4j Server enterprise
    application1004172068449Server.ja
    r
    Binding name:`java:comp/env/ejb/ISyncHomeRemote`
    Binding name:`java:comp/env/ejb/ISyncHomeLocal`
    java.lang.ClassCastException:
    com.sun.enterprise.deployment.EjbExternalDescriptor
    at com.sun.enterprise.deployment.EjbReferenceDescriptor.getValue
    (EjbReferenceDescriptor.java
    :202)
    at com.sun.enterprise.naming.NamingManagerImpl.bindObjects
    (NamingManagerImpl.java:394)
    at com.sun.web.server.WebService.addContext(WebService.java:148)
    at com.sun.web.server.ServletDeployerImpl.loadWebComponents
    (ServletDeployerImpl.java:214)
    at
    com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployWebComponent
    s
    (JarInsta
    llerImpl.java:791)
    at
    com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployApplication
    (JarInstall
    erImpl.java:219)
    at
    org.omg.stub.com.sun.enterprise.tools.deployment.backend._JarInstallerImpl_Tie.
    invoke(Un
    known Source)
    at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch
    (ServerDelegate.java:355)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process
    (RequestProcessor.java:84)
    at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run
    (ThreadPool.java:99)
    Does the Sun J2EE server implementation support the invocation
    of Session EJB's via a Local interface?
    Does the Sun J2EE server implementation allow a Servlet to invoke
    Session EJB's via the bean's Local interface?
    While researching this issue, I read the J2EE 1.3 final specification.
    The spec says:
    "The EJB container is required to access to local enterprise beans.
    We recommend that the web container also support access to local
    enterprise beans."
    Does the web container in Sun's J2EE server support access to local enterprise beans?

    I'm pretty much sure that you cannot access a
    local Session bean from outside the EJB container.Please read the J2EE 1.3 specification before posting messages about EJB and J2EE.
    According to the J2EE 1.3 specification:
    "The EJB container is required to support access to local enterprise beans. We recommend that the web container also support access to local enterprise beans.
    No support is provided for access to local enterprise beans from the application client container or the applet container."
    If you use local interfaces for your session bean,
    than your client must be local too. A local client is
    a client that is collocated in the same JVM with the
    session/entity that provides the local view and which
    can be tightly coupled to the bean.My client is running in the same JVM as my EJB. The client is a servlet. The servlet is running in the same JVM as the EJB.
    For what its worth, the error that I observed occurs during deployment. I haven't figured out why deployment is failing.

  • No exception is thrown when my server socket dies

    I have a server application running on sunOS 5.7.
    To this I have both Windows and SunOS clients connected via TCP/IP. (Server built with jdk 1.2.2 and client with 1.3.0)
    If the Server socket dies an exception is thrown in the windows clients but not in the sunOS client.
    I need the exception to be thrown in the sunOS as well.
    Is there anybody who knows how to get this done?
    Thanks in advance.
    /Henrik

    You could poll the connection to see if its there.
    If you want the client to register the event then have your client create a sort of listener of your own when it connects. By 'sort of listener' I mean extend the thread class and have it check the connection is not null every n seconds. If it is null then raise the exception yourself.
    Would this do it?
    Rob.

  • SCSM 2012 R2 error 'An exception was thrown while processing ProcessDiscoveryData for session ID uuid:

    Hi All,
    My environment details:
    SCSM 2012 R2
    SCCM 2012 R2 connector configured
    When I looked into the event viewer , I find the following error occurring continuously while the SCCM 2012 synchronization
    Error Event 26319
    An exception was thrown while processing ProcessDiscoveryData for session ID uuid:xxxxx
    Exception message: The relationship source specified in the discovery data item is not valid.
    Relationship source ID: xxxx
    Rule ID: xxxxxx
    Full Exception: Microsoft.EnterpriseManagement.Common.DiscoveryDataInvalidRelationshipSourceException: The relationship source specified in the discovery data item is not valid.
    This error is accompanied by the below warning
    Event:34113
    Connector SCCM Connector -Primary Site 
    Error writing changes to entity of type Microsoft.Windows.Peripheral.LogicalDisk with DisplayName XXXXXXX
    Message: The relationship source specified in the discovery data item is not valid.
    Relationship source ID: XXXXXXX
    Rule ID: XXXXXXX
    If this error occurs with every synchronization, examine view Cached_CMv5_LogicalDisks for correctness or the schema for type Microsoft.Windows.Peripheral.LogicalDisk in management pack Microsoft.Windows.Peripheral.Library.
    Event:33333
    Data Access Layer rejected retry on SqlError:
    Request: p_RelationshipDiscovered -- (RelationshipId=f449d88a-ecbf-5b16-40be-c085391a6380), (SourceEntityId=ccdf084d-254f-0ad4-ba2e-189b75ff109a), (TargetEntityId=07734206-0880-a4ec-a638-df20ccbdcbaf), (RelationshipTypeId=e4c6f8ce-0763-51c6-6421-c424a93a1eb6),
    (DiscoverySourceId=df6eae9f-f14f-4e6e-9f3c-c1effa193fbe), (HealthServiceEntityId=34b1c704-120c-1175-9fe3-411e2c0aac30), (PerformHealthServiceCheck=False), (TimeGenerated=09/01/2015 04:15:26), (SourceEntityLastModified=), (IsRelationshipAlreadyDiscovered=False),
    (RelationshipInserted=False), (LastModified=), (ChangeId=), (RETURN_VALUE=1)
    Class: 16
    Number: 777980002
    Message: The specified relationship doesn't have a valid source.
    From the events, it is clear that the problem is with SCCM connector and in the warning it mention to check the management pack ,
    Microsoft.Windows.Peripheral.Library
    whether need to update any MP ??
    I tried to resolve this, but ended up in aforum which suggested to do a restart of server .But since it is Prod , restart will not be easy.
    If any suggestions , it will be good to resolve this
    Thank you  

    Hi,
    Please install UR3 and check the result:
    Update Rollup 3 for System Center 2012 R2 Service Manager
    http://support.microsoft.com/kb/2962041
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Detecting when exception was thrown using custom class loader

    Hello all,
    I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
    Thanks!
    Edited by: user9355666 on Sep 28, 2010 10:48 PM

    user9355666 wrote:
    I think I'm missing something fundumental, forgive me for being slow...
    This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
    In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it.

  • How can the eclipse debugger break in the code when an exception is thrown

    Is there a way in eclipse to break into the bebugger when an exception is thrown in debug mode like Visual Studio 2003 or 2005?
    Thanks

    For 3.x, select "Add Java Exception Breakpoint" from the "Run" menu.
    Check "Caught" to break even if your code handles the exception, "Uncaught" to break when your code doesn't handle the exception.

  • Exception of type  'System.OutOfMemory Exception' was thrown while running

    We have a web application develeoped in ASP.Net, SQL Server 2005 , Crystal Reports 10.2. When I try to run a report which has around 5 lakh records (the query to fetch the records in sql server takes around 1.5 to 2 minutes) gives an error Exception of type  'System.OutOfMemory Exception' was thrown.
    Can anybody help !!
    Thanks

    Hello, Balla;
    the first thing to check is that the ASP.NET Worker process has rights to your Temp folder. You will find where it is by checking your Environment variables.
    Use the correct name for the ASP.NET worker process depending on your operating system - LocalMachine\IIS_WPG(Windows 2003 Server) or ASPNET(XP) or (Vista) IIS_IUSRS
    To give the IIS_WPG account full control of a folder:
    1. Right-click the folder and select 'Properties'.
    2. Go to the 'Security' tab and click the 'Add' button.
    3. Click the 'Locations' button and select the
    computer name. Click 'OK'.
    4. Type "IIS_WPG" under the 'Enter the object names to
    select' box.
    5. Click 'Check Names'. <Your machine name>\IIS_WPG
    appears. Click 'OK'.
    6. Check 'Full Control' from 'Permissions for IIS_WPG'.
    Click 'OK'.
    ====================
    NOTE:
    The IIS_WPG includes the LocalService,
    System, and NetworkService accounts.
    ====================
    If that is not the issue:
    What database driver are you using in the design of your report? Go to Database|Set datasource location and tell me the properties of the database connection.
    Do you logon to the database in your code or pass the data to it using Datasets?
    Are there subreports in the design? How many are there? What section are they in? What data source does each one use?
    Do you have a lot of formulas in the report?
    Elaine

  • Exceptions not thrown on interrupted SocketChannel.write()

    I just noticed a behaviour of java.nio.channels.SocketChannel.write() that makes me wonder. If write() blocks(), and the channel is closed during this blocking by another thread, AsynchronousCloseException should be thrown.
    However, in most cases this does not happen in my little test app. If any part of the data passed to write() has already been written to TCP before the socket was closed, write() returns without exception.
    Similar behaviour is observed with intterupting. If the thread blocked in write() is interrupted by another thread, it returns immediately and has the interrupted Flag set, but in most cases no Exception is thrown.
    ClosedByInterruptException is only thrown if not any part of the data passed to write() has been passed to TCP.
    Is this a bug or a feature ?

    Yes, i'm pretty sure that it blocks. In my test, the server just accepts the connection and then goes to sleep for a looooong time. The client just connects, and sends 10Meg of fata in one write() call. If i do not interrupt the client, it blocks as long as the server sleeps. In this case, this is the client's stack while blocking:
    Thread [main] (Suspended)     
         FileDispatcher.write0(FileDescriptor, long, int) line: not available [native method]     
         SocketDispatcher.write(FileDescriptor, long, int) line: 29     
         IOUtil.writeFromNativeBuffer(FileDescriptor, ByteBuffer, long, NativeDispatcher, Object) line: 104     
         IOUtil.write(FileDescriptor, ByteBuffer, long, NativeDispatcher, Object) line: 75     
         SocketChannelImpl.write(ByteBuffer) line: 334     
         Channels.write(WritableByteChannel, ByteBuffer) line: 60     
         Channels.access$000(WritableByteChannel, ByteBuffer) line: 47     
         Channels$1.write(byte[], int, int) line: 134     
         Channels$1(OutputStream).write(byte[]) line: 58     
         SocketClient.main(String[]) line: 75     If i start another thread before calling write(), that closes the socket after 3 seconds, the following happens: The call of IOUtil.write() returns ( with a value n that i cannot see in the debugger ), This value n is tested inside SocketChannelImpl.write() via (n > 0 || (n == IOStatus.UNAVAILABLE), what return true. For that reason, AbstractInterruptibleChannel.end(boolean), does not throw an exception.
    Once the server wakes up later, it is able to read about 200K from the socket...
    I tried this on a linux system (kernel 2.6.17, glibc 2.4) with jdk 1.6.0_03. I'm now gonna try it under windows, hold on..
    Of course, if anybody is interested, i'll post the test proggy...

  • Exception has occurred during data insertion ... Wrong number of parameters

    I am using an ADO dataflow source and an ADO dataflow destination to move data from a table on an IBM iSeries DB2 database to another IBM iSeries DB2 database on another machine.  The connection managers for source and destination both use .Net Providers\Odbc
    Data Provider with the Data Source Specification being ODBC connections specified on the Windows Server 2008 r2 machine hosting bids.  All the test connections work...so far so good.
    Issue is when I execute the control flow task the rows get picked up from the source DB2 database no problem but it fails on the insert to the destination DB2 table...The progress tab specifies the exceptions...
    [ADO NET Destination [601]] Error: An exception has occurred during data insertion, the message returned from the provider is: ERROR [07002] [IBM][System i Access ODBC Driver]Wrong number of parameters.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "ADO NET Destination" (601) failed with error code 0xC020844B while processing input "ADO NET Destination Input" (604). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the
    failure.
    I put a data viewer on the data flow connection and the records I expect are  getting picked up and look ok. I checked to make sure the source and destination tables have the same number of columns in their record layout and identical data
    types and they look fine.
    Could someone kindly tell me whats going wrong?  Does the error message indicate that some of the columns are getting dropped from the dataset before the insert?
    Thanks much in advance for any help, Roscoe

    Hi Roscoe,
    Glad to hear that you have found the root cause. So, the issue occurs because numeric values with no decimal cannot be inserted into the Decimal data type column in the DB2 table. In SSIS, data type Decimal of DB2 database is mapped to data type DT_NUMERIC.
    To address the issue, you can do a data conversion for the column in question to define its precision and scale such as DT_NUMERIC(9,2) by using the Data Conversion Transformation before the ADO NET Destination.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Which exception is thrown in overidding method

    Hi ,
    I have a doubt in doubt in overriding method. What type of exception is thrown in overidding method.

    Hi all,
    I have a doubt.. I read some where that an overriding
    method can throw a different exception from the
    orignal one. Does that exception has a restriction
    that ..it shouldn't be more Generic than that of the
    original?
    Yes, this is what the jls in section 8.4.4 has to say about throws and overriding
    A method that overrides or hides another method (�8.4.6), including methods that implement abstract methods defined in interfaces,
    may not be declared to throw more checked exceptions than the overridden or hidden method.
    More precisely, suppose that B is a class or interface, and A is a superclass or
    superinterface of B, and a method declaration n in B overrides or hides a
    method declaration m in A. If n has a throws clause that mentions any checked
    exception types, then m must have a throws clause, and for every checked
    exception type listed in the throws clause of n, that same exception class or one
    of its superclasses must occur in the throws clause of m; otherwise, a compile-time error occursLets take an example
    public class A
       public void meth() throws IOException
            //some code that throws IOException
    class B extends A
       //this is ok bcos FNFException inherits from IOException
       public void meth() throws FileNotFoundException
          //code that throws FNFException
       /*  THIS WILL FAIL TO COMPILE
       public void meth() throws Exception
          //code that throws FNFException
    I think the access modifier in the over riden method
    can't be more restrictive than the original one.. For
    example..The overriden method can change the access
    modifier from default to protected..But not vice
    versa..correct.
    Cheers,
    ram.

Maybe you are looking for

  • Cost estimate missing for a material in sales order

    Hi All Users have opened sales orders with materials which does not have a  valid costestimates. These missing cost estimate sales orders did not flow to COPA. Is there any report,  I can run to view all those sales orders which did not flow to COPA?

  • Star schema cannot be mapped to multiple tables

    Hello! I am mapping dimension in AWM. When I am drawing lines from the source columns to the target objects "Member". I get the message "star schema cannot be mapped to multiple tables". Sometimes I can workaround the problem by drawing the lines in

  • Regular Expressions like feature in 9i

    Hi Friends, The sample data stored in one of the columns in the database is as follows: SELECT * FROM SELECT 'MTC-1039195130-Elcoteq' location FROM DUAL UNION ALL SELECT 'MTC Foxconn India' FROM DUAL UNION ALL SELECT 'MTC_Hosiden_1798467' FROM DUAL U

  • DUAL SIM PHONE OPTIONS

    I need to get a dual sim phone so that i can have my own personal mobile sim in it and my work mobile sim in too However, I need the option to be able to USE ONE SIM ONLY , so that I can 'turn off' my work mobile when I am not working. I was looking

  • How to use Percent_Rank to knock out the bottom and top 10% of query?

    Hi, I'm trying to use Percent_Rank to knock off the bottom and top 10% of a query result, and then take an average of what's left. The query is of the form: SELECT 'Average Resolution Time Days' Service_Time_Type, ROUND(NVL(AVG(NVL(hds.hds_working_du