Custom Indirection Container throwing exception in constructor

Hi I've following the how-to and implemented my own custom indirection container. However, when reading an object from the database I'm getting the following exception. I'm guessing that it could be related to having null references stored as 0 in id columns. Any help would be greatly appreciated.
Thanks,
Jon
Exception thrown in main Exception [TOPLINK-152] (OracleAS TopLink - 10g (9.0.4.8) (Build 050712)):
oracle.toplink.exceptions.DescriptorException
Exception Description: The operation [buildContainer constructor (null) Failed: java.lang.NullPointe
rException] is invalid for this indirection policy [oracle.toplink.internal.indirection.ContainerInd
irectionPolicy@cc0e01].
Mapping: oracle.toplink.mappings.OneToOneMapping[ryFromMail]
Descriptor: Descriptor(com.peoplesoft.crm.omk.design.PsRyedocVar --> [DatabaseTable(PS_RYEDOC_VAR)])
Local Exception Stack:
Exception [TOPLINK-152] (OracleAS TopLink - 10g (9.0.4.8) (Build 050712)): oracle.toplink.exceptions
.DescriptorException
Exception Description: The operation [buildContainer constructor (null) Failed: java.lang.NullPointe
rException] is invalid for this indirection policy [oracle.toplink.internal.indirection.ContainerInd
irectionPolicy@cc0e01].
Mapping: oracle.toplink.mappings.OneToOneMapping[ryFromMail]
Descriptor: Descriptor(com.peoplesoft.crm.omk.design.PsRyedocVar --> [DatabaseTable(PS_RYEDOC_VAR)])
at oracle.toplink.exceptions.DescriptorException.invalidIndirectionPolicyOperation(Descripto
rException.java:669)
at oracle.toplink.internal.indirection.ContainerIndirectionPolicy.buildContainer(ContainerIn
directionPolicy.java:62)
at oracle.toplink.internal.indirection.ContainerIndirectionPolicy.valueFromQuery(ContainerIn
directionPolicy.java:254)
at oracle.toplink.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java
:898)
at oracle.toplink.mappings.OneToOneMapping.valueFromRow(OneToOneMapping.java:1302)
at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:876)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder
.java:164)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:322)
at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:
242)
at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:368)
at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:510)
at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:125)
at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1962)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
at oracle.toplink.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolic
y.java:254)
at oracle.toplink.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java
:898)
at oracle.toplink.mappings.OneToOneMapping.valueFromRow(OneToOneMapping.java:1302)
at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:876)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder
.java:164)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:322)
at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:
242)
at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:368)

Clients of your class might not like you throwing
exceptions from the ctor. If they're checked
exceptions it'll mean try/catch blocks. If there are
LOTS of checked exceptions that'll mean lots of catch
blocks. Could get messy fast. You could catch in the
ctor and wrap in a subclass of
java.lang.RuntimeException. Those are unchecked, like
java.lang.IllegalArgumentException.I would strongly advise against making your checked exceptions unchecked just so that the caller's code will compile without try/catch blocks. Either way--checked or unchecked--if I do Foo foo = new Foo();
foo.doStuff(); I won't get to doStuff() if the ctor threw an exception.
You'd throw unchecked exceptions in those cases where it's appropriate--e.g., the caller passed you invalid args (bad code on the caller's part, appropriated for unchecked exception), or the VM couldn't get enough memory to create your object (probably not something the caller can do anything about, so, again, appropriate for unchecked).
But if, for example, he's passing you database login parameters that an end user provided, and the password is wrong or the host is unreachable, then you'd want to throw a checked exception, because it's not bad code on the caller's part, and there might be something he can do to recover.
Note that the example of the incorrect password above is quite different from the "invalid args" example in the previous paragraph. Your method would throw IllegalArgumentException if the caller passed args that violate your method's precondition--e..g. lie outside some range of numbers. That is, it's a value that your method simply can't use. A bad password for a db login, on the other hand, is legal as far as your method is concerned, it just failed authentication in the db.
@%: I know you're aware of the proper use of checked/unchecked exceptions, but the way you worded you post kind of sounded like you were saying, "just use unchecked if you find the caller has too many try statements."
¶

Similar Messages

  • Custom XSLT Functions Throw Exception

    Hi,
    I have following requirement-
    1. I have defined and configured some custom XSLT functions in Jdev and BPEL, which throw exception in case of an error.
    2. Now I want to catch that exception in my BPEL process
    3. In My BPEL process I have defined transformation step ( which is using those Custom XSLT functions) in a scope and added a catch branch to that
    4. But even XSLT java function throw an exception , it is not being catch by catch branch.
    Could you please help me regarding this and tell me any other way to catch an exception in BPEL process thrown by Custom XSLT function within transformation step?
    Thanks.

    Hi,
    Its the problem with the date. In the configuration file i used dateTime for java.util.Date, because of this i cant see "User Defined" option in Jdeveloper component pallete. I checked at XML data types i had seen dateTime for java.util.Date Class, but its not working.
    Do anyone created a custom xslt function which has date as parameter or return type?, If so wht they had used as data type for xml and java.
    Thanks,
    RR

  • Can I throw exception in constructor?

    I just want to add some constraints on the object.
    I'm thinking to add the constraints to the constructor, when every time create a new object , check first. If obey the rule, that's fine. If not, just throw it? Can I do like this way??
    e.g Class Distance
    Distance(x){if x >= 0.0  dist = x  else throw...}
    float dist;
    }

    The best exception to throw in that case is IllegalArgumentException..
    class Distance {
        float dist;
        Distance(float x) {
            if (x < 0.0) {
                throw new IllegalArgumentException("x must be non-negative");
            dist = x;
    }

  • Custom adapter module throwing exception

    Hi,
         We have written an adapter module (EJB) to convert a file structure into XML for conversion in XI. Using file adapter(FTP), we are getting the files converted into XML without any problem. However, when there is no file in the directory the module is throwing an exception and writing an entry into the log (polling interval is 1 minute).
    The requirement is when there is no file in the directory, the adapter should keep on polling, but without generating any exception or making an entry in the log.
    Can anyone help out with this please?

    strange...
    if a file is not found in the specified directory where your file adapter is polling, it is not possible that the control comes to the adapter module you have specified in the module chain.
    have you done something unusual in your CC config i.e. added only your module in the module chain and removed CallSAPAdapter

  • Groupwise Custom Field Creation throws exception

    Hi,
    When I am trying to create a new field definition (String type) using the object API (8.0.1)(gwoapi_800.h), I got the following exception
    System Message #1: "An error occurred in allocating memory.", System Message #2: "Error Message: "Exception occurred.", Source "FieldDefinitions.Object"",
    IGWFieldDefinitionPtr pDIGWFieldDefinitions;
    pIGWFieldDefinitions->Add()
    Is this a known API issue?
    Thanks.

    I put a fix to 8.0.3 and the next major release
    or GroupWise. The problem was there is a custom
    field table that gets created. If the user had
    no custom fields, there was a problem creating
    the first custom field.
    You can get around the problem (until the fix
    is available) by first creating a custom field
    using the GW Client.
    Preston
    >>> On Tuesday, June 15, 2010 at 1:28 PM, Preston
    Stephenson<[email protected]> wrote:
    > I created a bug to investigate the issue.
    > I'll get to it when time permits.
    >
    > Thanks.
    > Preston
    >
    >>>> On Tuesday, June 15, 2010 at 12:46 PM,
    > pranov2001<pranov2001@no‑mx.forums.novell.com> wrote:
    >
    >> Preston
    >> Thanks a lot for your response. Here is the snapshot of the code that I
    >> am trying to achieve.
    >>
    >> _COM_SMARTPTR_TYPEDEF(DIGWAddressBooks, DIID_DIGWAddressBooks);
    >> _COM_SMARTPTR_TYPEDEF(IGWAddressBooks2, IID_IGWAddressBooks2);
    >> _COM_SMARTPTR_TYPEDEF(IGWAccount4, IID_IGWAccount4);
    >> _COM_SMARTPTR_TYPEDEF(DIGWCAddressBook, DIID_DIGWCAddressBook);
    >> _COM_SMARTPTR_TYPEDEF(IGWCAddressBook2, IID_IGWCAddressBook2);
    >>
    >> _COM_SMARTPTR_TYPEDEF(DIGWFieldDefinitions,IID_DIG WFieldDefinitions);
    >> _COM_SMARTPTR_TYPEDEF(IGWFieldDefinitions,
    >> IID_IGWFieldDefinitions);
    >> _COM_SMARTPTR_TYPEDEF(DIGWFieldDefinition,
    >> DIID_DIGWFieldDefinition);
    >>
    >> DIGWAddressBooksPtr pDIGWAddressBooks;
    >> IGWAddressBooks2Ptr pIGWAddressBooks;
    >> IGWAccount4Ptr pIGWAccount;
    >> LPCTSTR AddrBookName = _T("Test Contacts");
    >> CComVariant vName(AddrBookName);
    >> DIGWCAddressBookPtr pDIGWCAddressBook;
    >> HRESULT hr;
    >> DIGWFieldDefinitionsPtr pDIGWFieldDefinitions;
    >> IGWFieldDefinitionsPtr pIGWFieldDefinitions;
    >> DIGWFieldDefinitionPtr pDIGWFieldDefinition;
    >> IGWCAddressBook2Ptr pIGWCAddressBook;
    >> LPCTSTR FieldName = _T("AliasName");
    >>
    >> //Opening an Addressbook
    >> pIGWAccount‑>get_AddressBooks(&pDIGWAddressBooks );
    >>
    >>
    >
    pDIGWAddressBooks‑>QueryInterface(IID_IGWAddress Books2,((LPVOID*)&pIGWAddr
    > essBo
    >> oks));
    >> hr = pIGWAddressBooks‑>Item(vName, &pDIGWCAddressBook);
    >> if (hr>=0)
    >>
    >>
    >
    pDIGWCAddressBook‑>QueryInterface(IID_IGWCAddres sBook2,((LPVOID*)&pIGWCAdd
    > ressB
    >> ook));
    >>
    >> //Adding the field to the Addressbook
    >> pIGWCAddressBook‑>get_FieldDefinitions(&pDIGWFie ldDefinitions);
    >>
    >>
    >
    pDIGWFieldDefinitions‑>QueryInterface(IID_IGWFie ldDefinitions,((LPVOID*)&p
    > IGWFi
    >> eldDefinitions));
    >> _bstr_t btFieldName(FieldName);
    >> pIGWFieldDefinitions‑>Add(btFieldName, 1, &pDIGWFieldDefinition);
    >>
    >> The interesting fact is, it works in one worstation and not in other,
    >> even if there is no OS or Groupwise client version difference between
    >> those workstations.
    >>
    >> Preston Stephenson;1987092 Wrote:
    >>> The error is reporting something missing.
    >>> Can you support more of your code that you
    >>> are trying to use?
    >>> A small test app would be even better.
    >>>
    >>> Thanks.
    >>> Preston
    >>>
    >>> >>> On Thursday, June 10, 2010 at 3:26 PM,
    >>> pranov2001<pranov2001@no‑mx.forums.novell.com> wrote:
    >>>
    >>> > Hi,
    >>> >
    >>> > When I am trying to create a new field definition (String type)
    >>> using
    >>> > the object API (8.0.1)(gwoapi_800.h), I got the following exception
    >>> >
    >>> > System Message #1: "An error occurred in allocating memory.", System
    >>> > Message #2: "Error Message: "Exception occurred.", Source
    >>> > "FieldDefinitions.Object"",
    >>> >
    >>> > IGWFieldDefinitionPtr pDIGWFieldDefinitions;
    >>> > ....
    >>> > pIGWFieldDefinitions‑>Add()
    >>> >
    >>> > Is this a known API issue?
    >>> >
    >>> > Thanks.

  • Throw difference exception in constructor

    Have a base class constructor that throws an exception of class XException
    Have an exception class YException that inherit exception XException
    If I inherit the base class, can I make it throw exception Y instead of X, since Y is a subclass of exception X?
    Example:
    public class Base {
    public Base() throws XException {
    public class XException extends Exception {
    public XException() {
    // etc...
    public YException extends XException {
    YException() {
    super();
    public MyClass extends Base {
    // Can this work in a constructor since YException is a subclass of XException?
    // Anyway to make this possible?
    public MyClass() throws YException {
    super();

    Have a base class constructor that throws an exception
    of class XException
    Have an exception class YException that inherit
    exception XException
    If I inherit the base class, can I make it throw
    exception Y instead of X, since Y is a subclass of
    exception X?
    Example:
    public class Base {
    public Base() throws XException {
    public class XException extends Exception {
    public XException() {
    // etc...
    public YException extends XException {
    YException() {
    super();
    public MyClass extends Base {
    // Can this work in a constructor since YException is
    a subclass of XException?
    // Anyway to make this possible?
    public MyClass() throws YException {
    super();
    Apart from what you are asking in normal circumstances a no args constructor throwing an exception is never a good idea. The reason being that from then on anybody who extends this class would have to face problems. Consider the following
    public class MyTest
          public MyTest() throws Exception
    class Test extends MyTest
    {}this would not compile and throw the following error
    Default constructor cannot handle exception type Exception thrown by implicit super constructor. Must define an explicit constructor     
    So thats not a good practice
    cheers

  • Throw different exception in constructor

    Have a base class constructor that throws an exception of class XException
    Have an exception class YException that inherit exception XException
    If I inherit the base class, can I make it throw exception Y instead of X, since Y is a subclass of exception X?
    Example:
    public class Base {
    public Base() throws XException {
    public class XException extends Exception {
    public XException() {
    // etc...
    public YException extends XException {
    YException() {
    super();
    public MyClass extends Base {
    // Can this work in a constructor since YException is a subclass of XException?
    // Anyway to make this possible?
    public MyClass() throws YException {
    super();

    An overriding method in a sub-class may throw a sub-class of the Exception thrown in the extended class.
    Constructors are not overridden, the super() may generate an exception of type XException, which the constructor in the sub-class does not specifiy.

  • Constructor can throw exception or Not ?

    Anybody please tell me if the constructor throws an exception or not ?
    Please reply soon
    Thanks
    Amitindia

    A constructor can throw an Exception. However I
    would suggest throwing the generic Throwable, Error,
    Exception or RuntimeException rather than a specific
    exception is bad practice and you should choose an
    appropirate exception to throw.All depends on wich kind of exception you are throwing,checked or unchecked. It's an even worse form to throw a RE, Error, or Throwable when you are throwing in fact a checked exception.
    Nevertheless, I do agree, you must always strive to not throw exceptions, of any kind, in your construtor code. Construtors should be simple and reliable. Unles you have a very compelling reason to not do it, try to isolate the risky parts of the code where they are called ofter object construction or class loading.
    May the code be with you.

  • Throws Exception - a newcomer...

    I have written a small amount of code that takes information from a text file and displays it in a GUI (swing) - this is called my RasterDisplay class. However, I am now creating another part of the GUI which will have a button that makes a new RasterDisplay. However, when I try and call my RasterDisplay constructor from within my actionPerformed method (see below) It tells me I have an "unhandled Exception type Exception". I can't throw Exception in the actionPerformed method so how do I get this method to work? Any help would be greatly appreciated - I am a total newcomer to Java and can't make head nor tail of related topics in all the forums...
    Cheers!
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    public class RasterToolbar extends JFrame implements ActionListener{
         JButton open;
         public static void main(String[] args) throws Exception{
              new RasterToolbar();
         //method to make display panel with buttons
         public RasterToolbar()throws Exception{
                   super("Raster Viewer 1.0 beta");
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                   Container contentPane = getContentPane();
                   JPanel p1 = new JPanel();
                   p1.setLayout(new FlowLayout());
                   p1.setBorder(BorderFactory.createEmptyBorder(4,4,4,4));
                   open = new JButton("Open Viewer");
                   p1.add(open);
                   contentPane.add(p1,BorderLayout.WEST);
                   open.addActionListener(this);
                   pack();
                   setVisible(true);
         public void actionPerformed(ActionEvent ev){
         if(ev.getSource()== open){
              System.out.println("Open pressed");
              RasterDisplay viewer = new RasterDisplay(); // HERE IS THE PROBLEM LINE!
    }

    public void actionPerformed(ActionEvent ev){
         if(ev.getSource()== open){
              System.out.println("Open pressed");
              try {
                   RasterDisplay viewer = new RasterDisplay(); // HERE IS THE PROBLEM LINE!
              } catch(Exception e) {
                   // do what ever you want here!
                   e.printStackTrace();
    }

  • Using sql bulk copy throwing exception -The given value of type String from the data source cannot be converted to type int of the specified target column

    Hi All,
    I am reading notepads files and inserting data in sql tables from the notepad-
    while performing sql bulk copy on this line it throws exception - "bulkcopy.WriteToServer(dt); -"data type related(mentioned in subject )".
    Please go through my  logic and tell me what to change to avoid this error -
    public void Main()
    Dts.TaskResult = (int)ScriptResults.Success;
    string[] filePaths = Directory.GetFiles(@"C:\Users\jainruc\Desktop\Sudhanshu\master_db\Archive\test\content_insert\");
    for (int k = 0; k < filePaths.Length; k++)
    string[] lines = System.IO.File.ReadAllLines(filePaths[k]);
    //table name needs to extract after = sign
    string[] pathArr = filePaths[0].Split('\\');
    string tablename = pathArr[9].Split('.')[0];
    DataTable dt = new DataTable(tablename);
    |
    string[] arrColumns = lines[1].Split(new char[] { '|' });
    foreach (string col in arrColumns)
    dt.Columns.Add(col);
    for (int i = 2; i < lines.Length; i++)
    string[] columnsvals = lines[i].Split(new char[] { '|' });
    DataRow dr = dt.NewRow();
    for (int j = 0; j < columnsvals.Length; j++)
    //Console.Write(columnsvals[j]);
    if (string.IsNullOrEmpty(columnsvals[j]))
    dr[j] = DBNull.Value;
    else
    dr[j] = columnsvals[j];
    dt.Rows.Add(dr);
    SqlConnection conn = new SqlConnection();
    conn.ConnectionString = "Data Source=UI3DATS009X;" + "Initial Catalog=BHI_CSP_DB;" + "User Id=sa;" + "Password=3pp$erv1ce$4";
    conn.Open();
    SqlBulkCopy bulkcopy = new SqlBulkCopy(conn);
    bulkcopy.DestinationTableName = dt.TableName;
    bulkcopy.WriteToServer(dt);
    conn.Close();
    Issue 1:-
    I am reading notepad: getting all column and values in my data table now while inserting for date and time or integer field i need to do explicit conversion how to write for specific column before bulkcopy.WriteToServer(dt);
    Issue 2:- Notepad does not contains all columns nor in specific sequence in that case i can add few column ehich i am doing now but the issue is now data table will add my columns + notepad columns and while inserting how to assign in perticular colums?
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    I think you'll have to do an explicit column mapping if they are not in exact sequence in both source and destination.
    Have a look at this link:
    https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopycolumnmapping(v=vs.110).aspx
    Good Luck!
    Kaur.
    Please mark as answer if this resolves your issue.

  • Throw exception in Java mapping and handle this in BPM

    Hi,
    I'll use a Java mapping in a BPM transform step. Is it possible to throw an exception inside this Java mapping and handle this in a BPM exception handler?
    thanks and regards
    Verena

    Hi Verena,
    In a BPM transformation step, I think you can throw exceptions only for system errors.
    Let me explain with an example, one of the ways to handle your scenario:
    Lets assume your Java Mapping fails then you can trap that exception in your Java mapping and compose an XML message which indicates that an error has occurred.
    say for e.g.
    <intermediateStructure>
    <SatusDocument>
    <StatusCode>ERROR</StatusCode>
    <ErrCode>123</ErrCode>
    <ErrDesc><!populate the thrown exception details></ErrDesc>
    </StatusDocument>
    <Payload>
    <!contains actual XML message with data>
    </Payload>
    </intermediateStructure>
    if Java mapping is Successful, you can compose the XML message as follows:
    <intermediateStructure>
    <SatusDocument>
    <StatusCode>SUCCESS</StatusCode>
    <ErrCode>0</ErrCode>
    <ErrDesc></ErrDesc>
    </StatusDocument>
    <Payload>
    <!contains actual XML message with data>
    </Payload>
    </intermediateStructure>
    You can use BPM switch operation to switch to different processing branches say for e.g. "error" branch or "success" branch by examining the value of <StatusCode> tag.
    Hope it helps !
    Regards,
    Sridhar

  • Custom Single Container not showing up in the Admin console

    I developed a custom single container and deployed the java files and xml's successfully.
    But the container doesnt show up in the admin console as a container channel.
    I am not able to add and delete new channels into this container .Can anyone throw light on this issue..
    raj

    I'm seeing the same thing as Simon, I changed the iOS device name in both places on an iOS device and the name in the Intune console is still "iPhone" which is really unhelpful as I'm sure you can imagine.  Is there some other place
    that we should be going to rename devices so they are more easily identifiable in the Intune console?
    Thanks!

  • F.27(Statement should be emailed if customer master contains email address)

    Hi All,
    I am working for the tcode f.27. A standard form F140_ACC_STAT_01 is assigned to tcode. Here my requirement is i need to do some changes in the form and output should be in pdf format and statement should be emailed if customer master contains email address.
    Can any body please help me how to send the email if the customer master contains email address.
    Please reply.
    Thanks,
    Nagendra

    Hi Nagendra
    change the customer email address on home and bussiness email field first and then make following changes to function module 'Z_CORR_PROCESS_00002310' or whatever name you  have got , this is working for us, let me know if y ou have any problem, You might have to tweak a code a bit , here we are decide whether to send customer statements to two email or not based on customer group selection
    data: w_output_type(10).  "Output type
       data: w_kunnr like i_kna1-kunnr.
       data: w_ktokd like i_kna1-ktokd.
       data: l_addressdtls type zaddressdtls.
       data: l_atype(1).  " Address type
    DATA: w_mailtxt TYPE finaa-namep VALUE 'ZCITY_STATEMENT_MAIL_BODY'.
    * Variables are imported - set in ZFKORD10_STUD
    * Import variable w_output_type from memory
       clear: w_output_type.
       IMPORT w_output_type FROM MEMORY ID 'ZOUTPUT_TYPE'.
       move 'B' to  l_atype.      "Business e-mail
       if w_output_type = 'EMAIL'. "Email option chosen
         c_finaa-nacha = 'I'.
         c_finaa-tdfaxuser = sy-uname.
          c_finaa-namep = w_mailtxt.
    * Get the Relevant e-mail address
         move I_KNA1-KUNNR to w_kunnr.
         clear: l_addressdtls, c_finaa-intad.
         call function 'Z_GET_CUSTOMER_ADDRESS'
              EXPORTING
                   kunnr                   = w_kunnr
                   atype                   = l_atype  "B Business H Home
              IMPORTING
                   addressdtls             = l_addressdtls
              EXCEPTIONS
                   invalid_customer_number = 1
                   no_customer_partner     = 2
                   invalid_address_type    = 3
                   others                  = 4.
         if sy-subrc eq 0.
           if l_atype = 'H'.  "Home e-mail address
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-home_email.
           else.
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-business_email.
           endif.
         endif.
         concatenate i_kna1-kunnr
                     'Account statement from City University'
                      into c_itcpo-tdtitle separated by space.
         c_itcpo-tdfaxuser = sy-uname.
         if ( c_finaa-intad is initial            " No email address
              and c_itcpo-tdpreview is initial ). " and not print preview
           c_finaa-nacha = '1'.        "Print output type
           c_itcpo-tdgetotf = 'X'.     "Do not print
           c_itcpo-tdpreview = space.  "No print preview
           c_itcpo-tdnoprev = 'X'.     "No print preview
         endif.
       endif.
    if w_ktokd = 'stud'.
        move 'H' to  l_atype.      "Business e-mail
       if w_output_type = 'EMAIL'. "Email option chosen
         c_finaa-nacha = 'I'.
         c_finaa-tdfaxuser = sy-uname.
         c_finaa-namep = w_mailtxt.
      "Get the Relevant e-mail address
         move I_KNA1-KUNNR to w_kunnr.
         clear: l_addressdtls, c_finaa-intad.
         call function 'Z_GET_CUSTOMER_ADDRESS'
              EXPORTING
                   kunnr                   = w_kunnr
                   atype                   = l_atype  "B Business H Home
              IMPORTING
                   addressdtls             = l_addressdtls
              EXCEPTIONS
                   invalid_customer_number = 1
                   no_customer_partner     = 2
                   invalid_address_type    = 3
                   others                  = 4.
         if sy-subrc eq 0.
           if l_atype = 'H'.  "Home e-mail address
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-home_email.
           else.
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-business_email.
           endif.
         endif.
         concatenate i_kna1-kunnr
                     'Account statement from City University'
                      into c_itcpo-tdtitle separated by space.
         c_itcpo-tdfaxuser = sy-uname.
         if ( c_finaa-intad is initial            " No email address
              and c_itcpo-tdpreview is initial ). " and not print preview
           c_finaa-nacha = '1'.        "Print output type
           c_itcpo-tdgetotf = 'X'.     "Do not print
           c_itcpo-tdpreview = space.  "No print preview
           c_itcpo-tdnoprev = 'X'.     "No print preview
         endif.
    endif.
    endif.

  • Web part throwing exception at run time but not in debug mode

    The below code is throwing exception at run time but does not throw exception while debugging in Visual Studio. This is really causing difficulty for me to detect the cause of exception. Below I have also placed the exception image for reference.
    namespace CheckforContractorLogin.VisualWebPart1
    public partial class VisualWebPart1UserControl : UserControl
    protected void Page_Load(object sender, EventArgs e)
    if (!IsPostBack)
    string loginName = string.Empty;
    string coc_url = string.Empty;
    SPQuery spQuery = new SPQuery();
    spQuery.Query = "<Where><Eq><FieldRef Name='LoginName' /><Value Type='Text'>" + currentUser + "</Value></Eq></Where>";
    Guid _spSiteID = SPContext.Current.Site.ID;
    Guid _spWebID = SPContext.Current.Site.OpenWeb().ID;
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite _spSite = new SPSite(_spSiteID))
    using (SPWeb _spWeb = _spSite.OpenWeb(_spWebID))
    //if user has already accepted the COC
    SPList getSPList = _spWeb.Lists["RedirectUrl"];
    SPListItemCollection getspItemColl = getSPList.Items;
    foreach (SPListItem item in getspItemColl)
    if (Convert.ToString(item["Title"]) == "Policy Acceptance")
    coc_url = Convert.ToString(item["Url"]);
    SPList spList = _spWeb.Lists["Policy Acceptance Status"];
    SPListItemCollection spItemColl = spList.GetItems(spQuery);
    bool result = getADUserInfo();
    if ((spItemColl.Count == 0) && (result))
    Response.Redirect(coc_url);
    protected string currentUser
    get
    string currentUser1 = HttpContext.Current.User.Identity.ToString();
    int index = currentUser1.IndexOf("\\") + 1;
    string currentLoginUser = currentUser1.Substring(index);
    return currentLoginUser;
    protected bool getADUserInfo()
    DirectoryEntry dentry = null;
    DirectorySearcher dsearcher = null;
    string ldap = string.Empty;
    string empID = string.Empty;
    string _empID = string.Empty;
    try
    Guid spSiteGUID = SPContext.Current.Site.ID;
    Guid spWebGUID = SPContext.Current.Site.OpenWeb().ID;
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite elevatedSiteColl = new SPSite(spSiteGUID))
    using (SPWeb elevatedWeb = elevatedSiteColl.OpenWeb(spWebGUID))
    SPList spList = elevatedWeb.Lists["LDAP_Paths"];
    SPQuery spQuery = new SPQuery();
    spQuery.Query = "<Where><Eq><FieldRef Name='OU'/>"
    + "<Value Type='Text'>QD</Value></Eq></Where>";
    SPListItem spItem = spList.GetItemById(1);
    ldap = spItem["Path"].ToString();
    dentry = new DirectoryEntry();
    dentry.Path = ldap;
    dentry.Username = "******\\sp_admin";
    dentry.Password = "******";
    dsearcher = new DirectorySearcher(dentry);
    dsearcher.Filter = String.Format("(&(ObjectCategory=Person)(sAMAccountName=" + currentUser + "))");
    SearchResult searchResult = dsearcher.FindOne();
    dentry = searchResult.GetDirectoryEntry();
    if (searchResult != null)
    if (dentry.Properties.Contains("physicalDeliveryOfficeName"))
    empID = dentry.Properties["physicalDeliveryOfficeName"][0].ToString();
    if (empID.Contains("QA-"))
    return true;
    else
    return false;
    catch (Exception e)
    throw e;
    finally
    dentry.Close();
    dentry.Dispose();
    dsearcher.Dispose();

    Hi Zakir,
    I am not sure but it would be nice if you can do following
    Try search ULS log with correlation id and find exact error and share here. If not able to find do following
    Or in catch block write
    Response.Write(ex.ToString());
    and check what exception its giving.

  • 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

Maybe you are looking for