Duplicate method at internal Class

Hi All:
I was working in my Web Dynpro when I got these errors in the build:
The method wdCreateUITreeForTransparentContainer() is undefined for the type InternalCreatePolitics     InternalCreatePolitics.java     NWD_agiletrk_Dpmg_hr_politicswebdynpro~agile.com/gen_wdp/packages/com/agile/pmg/politics/comp/wdp     line 279
Duplicate method wdCreateUITreeForTransparentContainer in type InternalCreatePolitics     InternalCreatePolitics.java     NWD_agiletrk_Dpmg_hr_politicswebdynpro~agile.com/gen_wdp/packages/com/agile/pmg/politics/comp/wdp     line 304
These is from a class that the Developer Studio autogenerate. I don´t know how to solve it.
Thanks

Looks like something went wrong with the code generation. I has happened to me sometimes too, mainly because sometimes it allowed me to create two ui elements with the same name (ussually transparent containers as your case) and later I got the error in the internal class.
Check if you have done something wrong with your ui elements (two of them with the same name, a transparent container in which an invalid parent like a toolbar...) and fix it. If everything is ok with you ui elements but you still get the error then just modify the internal class and remove the method that is giving you the error.

Similar Messages

  • Methods in Intern classes using ActionListener

    As the title said, I have a problem with getting the method in the intern class to work. I want to make an applet that makes an connection to a mySQL-database and van do an edit-action via a JButton. I tried to make that work via an JButton linked to an ActionListener, and then make an intern class for this ActionListener in which the method for the edit action is. However for some reason it doesn't recognize the instance variables that are in the main class. I have made public getters so that can't be the problem.
    second I tried to make the edit action just a normal method in the main class, but how do you then make the button use it?
    Here is the code:
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.*;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.*;
    public class Kreta extends JApplet{
         private Connectie con;
         private int menu_id;
         private String naam_gerecht;
         private String prijs;
         private String ingredienten;
         private String recept;
         private JFrame frame;
         private JPanel west;
         private JPanel north;
         private JPanel south;
         private JPanel east;
         private JList overzicht;
         private JTextField n_naam;
         private JTextField n_prijs;
         private JTextField n_gerecht;
         private JTextArea s_recept;
         private JTextArea s_ingredienten;
         public int getID(){
              return this.menu_id;
         public void setID(int menu_id){
              this.menu_id = menu_id;
         public String getNaam_Gerecht(){
              return this.naam_gerecht;
         public void setNaam_Gerecht(String naam_gerecht){
              this.naam_gerecht = naam_gerecht;
         public String getPrijs(){
              return this.prijs;
         public void setPrijs(String prijs){
              this.prijs = prijs;
         public String getIngredienten(){
              return this.ingredienten;
         public void setIngredienten(String ingredienten){
              this.ingredienten = ingredienten;
         public String getRecept(){
              return this.recept;
         public void setRecept(String Recept){
              this.recept = recept;
         public Kreta(int menu_id, String naam_gerecht, String prijs, String ingredienten, String recept){
              this.menu_id = menu_id;
              this.naam_gerecht = naam_gerecht;
              this.prijs = prijs;
              this.ingredienten = ingredienten;
              this.recept = recept;
         public Kreta(){
              con = new Connectie();
              frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         // maak knoppen paneel met listeners, knoppen worden onder elkaar gezet met BoxLayout
              west = new JPanel();
              west.setBackground(Color.darkGray);
              west.setLayout(new BoxLayout(west, BoxLayout.Y_AXIS));
              JButton newButton = new JButton("Nieuw");
              JButton addButton = new JButton("Voeg toe");
              JButton editButton = new JButton("bewerk");
              JButton delButton = new JButton("wis");
              west.add(newButton);
              west.add(addButton);
              west.add(editButton);
              west.add(delButton);
              newButton.addActionListener(new newListener());
              addButton.addActionListener(new addListener());
              editButton.addActionListener(new editListener());
              delButton.addActionListener(new delListener());
         // maak northpanel met 2x textfields
              north = new JPanel();
              n_naam = new JTextField(20);
         // n_naam.setText(menu_id);
              JLabel n_naamlabel = new JLabel("naam");
              n_gerecht = new JTextField(50);
              n_gerecht.setText(naam_gerecht);
              JLabel n_gerechtlabel = new JLabel("naam gerecht");
              n_prijs = new JTextField(6);
              n_prijs.setText(prijs);
              JLabel n_prijslabel = new JLabel("prijs");
              n_naam.add(BorderLayout.NORTH, n_naam);
              n_gerecht.add(BorderLayout.NORTH, n_naamlabel);
              n_prijs.add(BorderLayout.NORTH, n_prijslabel);
              north.add(BorderLayout.NORTH, n_naam);
              north.add(BorderLayout.CENTER, n_gerecht);
              north.add(BorderLayout.SOUTH, n_prijs);
         // maak zuidpanel met 2x JTextArea
              south = new JPanel();
              s_recept = new JTextArea(5,5);
              JLabel s_receptLabel = new JLabel("recept");
              JScrollPane receptScroller = new JScrollPane(s_recept);
              s_recept.setLineWrap(true);
              receptScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
              receptScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              south.add(receptScroller);
              south.add(BorderLayout.NORTH, s_recept);
              s_ingredienten = new JTextArea(10, 20);
              JLabel s_ingredientenLabel = new JLabel("ingredienten");
              JScrollPane ingrScroller = new JScrollPane(s_ingredienten);
              s_ingredienten.setLineWrap(true);
              ingrScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
              ingrScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              south.add(ingrScroller);
              south.add(BorderLayout.SOUTH, s_ingredienten);
              // Maak een oostpaneel met JList
              east = new JPanel();
              String[]listEntries = {"1", "2", "3"}; // later moet dit van SQL komen?
              overzicht = new JList(listEntries);
              JScrollPane overzichtScroller = new JScrollPane(overzicht);
              overzichtScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
              overzichtScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              east.add(overzichtScroller);
              east.add(overzicht);
              frame.getContentPane().add(BorderLayout.WEST, west);
              frame.getContentPane().add(BorderLayout.NORTH, north);
              frame.getContentPane().add(BorderLayout.SOUTH, south);
              frame.getContentPane().add(BorderLayout.EAST, east);
              frame.setSize(500, 500);
              frame.setVisible(true);
         // eind GUI code
         public void leesAction(int menu_id){
                   // met deze methode lees je een kaart door het id op te geven
                   try{
                        Statement st = con.connection.createStatement();
                        String gget;
                        gget = "SELECT DISTINCT * FROM mailingregels WHERE (id = \""+ menu_id + "\");";
                        ResultSet rs = st.executeQuery(gget);
                        rs.next();
                        this.menu_id = rs.getInt(1);
                   // moet int nog omzetten naar String!!
                        this.naam_gerecht = rs.getString(2);
                        this.prijs = rs.getString(3);
                        this.recept = rs.getString(4);
                        this.ingredienten = rs.getString(5);
                        }catch(Exception ex){
                        System.out.println("Kan de gegevens uit de database niet lezen");
                        ex.printStackTrace();
         public void newAction(){
              // creeer een leeg scherm
         public void addAction(){
                                    // voeg gegevens toe aan database
         public void editAction(){
              try{
                   Statement statement = con.connection.createStatement();
                   String sset;
                   sset = "UPDATE afhaalmenus "+
                   "SET menu_id = '" + this.menu_id + "', '"+
                   "naam_gerecht = '" + this.naam_gerecht + "', '"+
                   "prijs = '" + this.prijs + "', '"+
                   "ingredienten = '" + this.ingredienten + "', '"+
                   "recept = '"+ this.recept + "', '"+
                   " WHERE afhaalmenus.id = "+ this.menu_id;
                   statement.executeUpdate(sset);
              }catch(Exception e){
                   System.out.println("edit failed");
         public void delAction(){
              System.out.println("del");
         public class newListener implements ActionListener{
              public void actionPerformed(ActionEvent ev){
                   System.out.println("new");
         public class addListener implements ActionListener{
              public void actionPerformed(ActionEvent ev){
                   System.out.println("add");
         public class editListener implements ActionListener{
              public void actionPerformed(ActionEvent ev){
         public class delListener implements ActionListener{
              public void actionPerformed(ActionEvent ev){
    }I tried to put the method that is under editAction() into the public class of editListener, which would then give this:
    public class editListener implements ActionListener{
              public void actionPerformed(ActionEvent ev){
              try{
                   Statement statement = con.connection.createStatement();
                   String sset;
                   sset = "UPDATE afhaalmenus "+
                   "SET menu_id = '" + this.menu_id + "', '"+
                   "naam_gerecht = '" + this.naam_gerecht + "', '"+
                   "prijs = '" + this.prijs + "', '"+
                   "ingredienten = '" + this.ingredienten + "', '"+
                   "recept = '"+ this.recept + "', '"+
                   " WHERE afhaalmenus.id = "+ this.menu_id;
                   statement.executeUpdate(sset);
              }catch(Exception e){
                   System.out.println("edit failed");
         }then it doesn't recognize the variables any more... How to solve this?
    I hope my problem is clear for everyone... thanks in advance!
    Edited by: boofer on Aug 28, 2008 3:25 AM

    this always points to the object instance the code is in. So in your editListener actionPerformed this point to the action listener instance.
    You need to either explicitly point to the outer class with Kreta.this.menu_id or just leave this out (the compiler then looks to all variables in the current scope and not just the action listener field variables).

  • Syntax error caused by duplicate methods in class.

    We've applied service patches to CRM 7 and afterwards I found that there were two versions of a method in a class. There was the original (shown in blue) which should point to the superclass, but does not and point to the ZL.... class. Then there's the second copy of the method, shown in black, which is the Redefined method. But, I have never seen both in existance at the same time when view via se24 or the component workbench.
    This is what I have tried:
    Redefined the method (shown in blue). But then I have two methods of the same name (SET_COUNTRY)  both shown in black. If I reverse the redefiniation it does successfully remove one of the redefintions, so I'm back to the state that started with, having the origianl superclass method and its redefiinition present. 
    This problem is in out QAS environment. I corrected this issue in DEV by deleting the Redefined method. However, the transport created fails when moved into QAS and gives a syntax error saying that duplicate methods exist, or is called twice. Which happens to be the problem that the transport should fix.
    Can anyone suggest anything to try and fix this?.
    As a last resort I opened our QAS envirnment for changes and within SE24 choose the option Utilities/Check.... But this did not resolved anything as all the sub-options said that everything was okay.
    Desperate now, the ledge of this window is not very wide but it's starting to look appealing, even though the building is only one storey high.
    [RESOLVED]
    My sanity is restored. No matter what I tried I could not get a transport through to correct this issue. In the end I had to open up QAS for changes and delete the redefined method from ZL... class by commenting out the call statement, and then answer yes to the question 'Do you want to delete the method?'. After this I re-activated all and the WebUI now works okay.
    The trouble is I'll need to repeat this process in production after the upgrade.
    When the problem was fixed in DEV a transport was created, but this just gave an error 8 when imported into QAS. The message given was exactly the problem that it was trying to fix.
    Jason
    Edited by: Jason Stratham on Sep 14, 2010 3:10 PM

    I think you should ask this on the ML or open a feture request on the bugtracker.

  • Exporting parameter of type table in Method of a Class

    Hi Experts,
    I want to pass an internal table from my method in ABAP class to a workflow.
    For thi spurpose i have cretaed a parameter of type table in the method.
    My problem is that i am not able to bind this to a workflow/task  container.
    I can see all the other parameters of the method in thw workflow while binding except for the parameter of type table ( i.e internal table ).
    Any idea ?
    Thanks,
    Radhika.

    Assuming that you are trying to export the internal table from class method to task conatiner.
    I have cretaed a Structure 'zemails' in se11
    Already you have created a Structure in the SE11 , why don't you just create one Table Type of ZEMAILS in SE11. Once you hvae created in DDIC then in the class signature declare the ltmails of type the tabale type that you create. and then in the task conatiner also try to declare the container element with the same name and same table type.
    In the class method declare the lt_mails as Exporting. save and actiavte. And one more thing if that element is not present in the Task conatiner then as soon as you try to open in the change mode and click on the binding button of the task it will prompt you asking whether you want to trnasfer the mssing elements if you clcik Yes then the same element which you have declared in the class will created with the same type. but make sure in the task conatiner you delcare the lt_mails as IMport export element.

  • Method declaration in Class

    Hi Experts,
             In Classes and Methods i got one requirement like this , Please respond it.
    I have to create the method , where class is already defined(ZCL_CONFIGURABLE_ITEM )
    Create Method:  IS_SEQUENCE_NOT_TO_PRINT .
    Class name :ZCL_CONFIGURABLE_ITEM
    They had given me example logic also. But iam not able to do this because i have no idea on classes and methods.
    Please see this example and respond me .
    Create Method:  IS_SEQUENCE_NOT_TO_PRINT .  This must be a value method in class ZCL_CONFIGURABLE_ITEM , passing document number VBDKR-VBELN that returns a parameter value: X = True, Blank = false.
    GET BILLTO_PARTNER customer number for the document (reading VBPA where VBELN = document number VBDKR-VBELN and partner PARVW = ‘RE’ / ‘BP’)Read table KNA1 to get field KNA1-KATR6 where KUNNR equals Billto partner, and fields VBDKR-VKORG, VBDKR-VTWEG, VBDKR-SPART, Store first character of field KNA1-KATR6 in a work field e.g. W_ KATR6.
    Add the entry below to the ZLITERAL table in all clients
    Read the records from ZLITERAL table (reading key1 = C_ZLIT_GENOSYS_KEY, and key2 = C_KATR6_1) where C_KATR6_1 = attribute on class, with value = KATR6_1 .  You must add this attribute on the class.  Populate the internal table L_ZLITERAL_TAB type ZLITERAL_TAB_TYPE.

    Hi,
        You can create the method from the CLASS BUILDER. SE24. There navigate to methods tab and enter you method name. Then select visibility public or private.
    Then click on the parameters button to add parameters to the method. Selec IMPORT, EXPORT or RETURNING parameter for the function.
    Regards,
    Sesh

  • Count lines of code present in methods of a class

    Hi Friends,
    Can anyone suggest how to count lines of abap code in methods of a class?I have used the function module  'SEO_CLASS_GET_INCLUDE_SOURCE' but this function module doesnt counts the code for methods of a class.
    Kindly help.
    Regards
    ST

    Hi siji,
    once try the below info.
    data: itab type table of string.
    data: w_lines type i.
    read report <reportname> into itab.
    describe table itab lines w_lines.
    write: / 'Report lines:', w_lines.
    It is however important to find the exact report name.
    For standard ABAP reports it is easy, it is the name of the report itself.
    For classes and function modules this is somewhat different.
    Correct report name for function modules can be found as follows :
    Use table TFDIR, field FUNCNAME is your function module.
    PNMAME contains the main program name of the function group, not of the function module.
    Function module report can be created as follows PNAME+3 concatenated with 'U' and field INCLUDE.
    Example for the function module RFC_PING this will be
    'LSRFC' + 'U' + 07 = report name LSRFCU07
    Also take a look at the function module FUNCTION_INCLUDE_CONCATENATE
    Hint: lines( ) is a built-in (system class) static function returning the number of lines in a given internal table. You will like it much better than old-fashioned DESCRIBE TABLE statement where you make us of a count variable an need one more statement for the summing up.
    Note:  If you dont want to count blank line and comments, try this code
         delete itab where table_line is initial or table_line(1) = '*'.
           add lines( itab ) to total_linecount.
    Regards,
    Ravi

  • Internal class implementing interface extending abstract interface :P

    Confused ha? Yeah me too. RIght here it goes.
    Theres an abstract interface (abstractIFace) that has for example method1() method2() and method3(). There are two other interfaces iFace1 and iFace2 that extend abstractIFace. Still with me? :P iFace1 only uses method2() whereas iFace2 uses method1(), method2() and method3(). Internal classes implementing these are then used. The reason is so that when returning an object one method can be used that will return different types of objects. But this doesnt work. It says that all the classes in the abstractIFace must be used/implemented but I only want method2() in iFace1 and all in iFace2.
    Just say what the f*ck if this is too confusing cos i think it is and i did a crap job explaining!! :P

    public interface IFace {
        void method1();
        void method2();
        void method3();
    public class Test {
        private static class Class1 implements IFace {
            public void method1() {
                System.out.println("method1");
            public void method2() {
                System.out.println("method2");
            public void method3() {
                System.out.println("method3");
        private static class Class2 implements IFace {
            public void method1() {
                throw new UnsupportedOperationException();
            public void method2() {
                System.out.println("method2");
            public void method3() {
                throw new UnsupportedOperationException();
        public static IFace createObject(boolean flag) {
            return flag ? (IFace) new Class1() : new Class2();
    }

  • Reg - how to find the purpose of methods in a class

    hi everyone,
               can u plz help me with how to find the purpose of methods in a class???????
    a description abt the methods in a class??????
                        thx in advance,
    regards,
    balaji.s

    Hi Balaji
    Pls find some stuff.
    reward pts if help.
    The following statements define the structure of a class:
    ·        A class contains components
    ·        Each component is assigned to a visibility section
    ·        Classes implement methods
    The following sections describe the structure of classes in more detail.
    Class Components
    The components of a class make up its contents. All components are declared in the declaration part of the class. The components define the attributes of the objects in a class. When you define the class, each component is assigned to one of the three visibility sections, which define the external interface of the class. All of the components of a class are visible within the class. All components are in the same namespace. This means that all components of the class must have names that are unique within the class.
    There are two kinds of components in a class - those that exist separately for each object in the class, and those that exist only once for the whole class, regardless of the number of instances. Instance-specific components are known as instance components. Components that are not instance-specific are called static components.
    In ABAP Objects, classes can define the following components. Since all components that you can declare in classes can also be declared in interfaces, the following descriptions apply equally to interfaces.
    Attributes
    Attributes are internal data fields within a class that can have any ABAP data type. The state of an object is determined by the contents of its attributes. One kind of attribute is the reference variable. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
    Instance Attributes
    The contents of instance attributes define the instance-specific state of an object. You declare them using the DATAstatement.
    Static Attributes
    The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement. They are accessible for the entire runtime of the class.
    All of the objects in a class can access its static attributes. If you change a static attribute in an object, the change is visible in all other objects in the class.
    The technical properties of instance attributes belong to the static properties of a class. It is therefore possible to refer in a LIKE addition to the visible attributes of a class – through the class component selector or through reference variables, without prior creation of an object.
    Methods
    Methods are internal procedures in a class that define the behavior of an object. They can access all of the attributes of a class. This allows them to change the data content of an object. They also have a parameter interface, with which users can supply them with values when calling them, and receive values back from them The private attributes of a class can only be changed by methods in the same class.
    The definition and parameter interface of a method is similar to that of function modules. You define a method meth in the definition part of a class and implement it in the implementation part using the following processing block:
    METHOD meth.
    ENDMETHOD.
    You can declare local data types and objects in methods in the same way as in other ABAP procedures (subroutines and function modules). You call methods using the CALL METHOD statement.
    Instance Methods
    You declare instance methods using the METHODSstatement. They can access all of the attributes of a class, and can trigger all of the events of the class.
    Static Methods
    You declare static methods using the CLASS-METHODSstatement. They can only access static attributes and trigger static events.
    Special Methods
    As well as normal methods, which you call using CALL METHOD, there are two special methods called constructor and class_constructor that are automatically called when you create an object or when you first access the components of a class.
    reward pts if help.
    deepanker

  • Issue with close() method of BufferedReader class and FileInputStream class

    I have written the following code to a text file, called hello,txt from Windows. Everything works fine but I am trying to figure out whether calling of close() method of aforemetioned class is appropriate or necessary thing to do.
    Here are the questions:
    1. Is it necessary to call close method in this senario? And why? [it seems to me that everything gets cleaned up automatically anyways at the end of each call to the method when called from main()]
    2. If the answer for No.1 is yes, then in which order each close method should be called? Or, does the order of calling close method matter anyways?
    3. Is the reason for why in No.1 is that because calling close method on each object is a necessary step to do when dealing with mutli-thread?
    Thanks for your help in advance!
          * Below is an example to clarify my questions
         void readWinFile() {
              File objFile = new File("hello.txt");
              FileInputStream fileStream = null;
              BufferedReader bfReader = null;
              try {
                   fileStream = new FileInputStream(objFile);
                   bfReader = new BufferedReader(
                                      new InputStreamReader(fileStream, "MS932"));
                   int tmp;
                   while ((tmp = bfReader.read()) != -1) {
                        System.out.print((char)tmpLine);
              } catch (FileNotFoundException e) {
                   System.err.printf("File: %s Not Found @ DIR = %s",
                                       objFile.getName(), objFile.getParent());
              } catch (UnsupportedEncodingException e) {
                   System.err.printf("Internal failure: %s", e);
              } catch (IOException e) {
                   System.err.printf("File: %s close failure", objFile.getName());
    *          } finally {*
    *               if (bfReader != null) {*
    *                    try {*
    *                         bfReader.close();*
    *                    } catch (IOException e) {*
    *                         e.printStackTrace();*
    *               if (fileStream != null) {*
    *                    try {*
    *                         fileStream.close();*
    *                    } catch (IOException e) {*
    *                         e.printStackTrace();*
    }Edited by: Jay-K on Feb 14, 2010 8:50 PM
    Edited by: Jay-K on Feb 14, 2010 8:52 PM

    Hello CeciNEstPasUnProgrammeur,
    Thank you for taking your time and doing all these write-up for me.
    CeciNEstPasUnProgrammeur wrote:
    Pretty much every native resource, most notably DB connections because those even remain open after the client process terminates. But ports or file handlers are similar; note that a JVM does not necessarily terminate just because you close your program in "extreme cases" (shared use of JVM). In an app server this is certainly never the way. And even if it does, as long as your app is running, the stuff is certainly never released.What you meant is that if my app runs on an app server, which shared the use of JVM with multiple apps, without properly closing ports or file handlers could cause JVM to keep retaining the native resource allocated for my app. In case of that, the resource leaks would occur.
    On the other hand, if my app runs on an app server, which do not share the use of JVM, the leaks would be less likely to happen even if the ports or file handlers are not manually closed. (It could be a very poor design but technically I could reply on their finalizers to clean up the mess)
    >
    Another misconception seems to be that objects are automatically GCed the moment they run out of scope. This is not true.Is there any documentation somewhere that you could refer me to? I would like to figure out why objects are not auto-GCed when they run out of their scope.
    >
    And lastly, objects should not rely on their finalizers to release native resources, and should rather provide close/release methods. This is a common paradigm, and that's also why releasing the file handle won't work by simply letting the reader instance run out of scope. Nobody notifies the underlying OS.I see, so the JVM here interacts with the underlying OS to acquire sufficient native resource for its apps to run. Without explicit closing, which would make JVM not to notify underlying OS to release acquired resource. Am I on the ball here?
    Thanks,
    Jay

  • 'System.AccessViolationException' occurred in method 'Read' of class 'OpsDa

    Exception Stack Trace:_
    An exception of type *'System.AccessViolationException'* occurred in method *'Read' of class 'OpsDac'*
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    The stack trace given is: at Oracle.DataAccess.Client.OpsDac.Read(IntPtr opsConCtx, IntPtr opsErrCtx, IntPtr opsSqlCtx, IntPtr& opsDacCtx, OpoSqlValCtx* pOpoSqlValCtx, OpoMetValCtx* pOpoMetValCtx, OpoDacValCtx* pOpoDacValCtx) at Oracle.DataAccess.Client.OracleDataReader.Read()
    Environment Details:_
    Oracle Database- Oracle Database 11g Enterprise Edition Release 1 (11.1.0.6) Patch set 11.1.0.7
    ODP.NET- ODTwithODAC1110621- Oracle Data Access Components for Oracle Client 11.1.0.6.21
    Downloaded ODP.NET from the below link- http://www.oracle.com/technology/software/products/database/oracle11g/111060_win32soft.html
    *.NET Framework* – v3.5
    ORM layer (Object Relation Mapping) - NHibernate (it is the data access layer used in my project- which internally uses ADO.NET in the background)
    Coding Language - C#
    Test Case:*
    I don’t have a particular test case for this exception, but below is the similar code that caused the exception.
    Code:_
    void Main()
    //Placeholder for saving ID of new record that is saved through ADO.
    static decimal ADOSavedObjectID;
    private ADONewTestRecord obj = new ADONewTestRecord();
    //ADO.NET code to save this returns saved object db ID.
    ADOSavedObjectID = SaveThroughADOViaNHibernate(obj);
    //Fetch the Saved record through NHibernate.
    TestNewRecordFromNHibernateViaADO = GetTestRecordThroughNHibernateViaADO(ADOSavedObjectID )
    public decimal SaveThroughADOViaNHibernate(ADONewTestRecord obj)
    //here we have NHibernate API to save the record which uses ADO.NET (sorry I am not providing any lines of code, as I don’t have the source code of NHibernate that is accessing –ADO.NET )
    public TestNewRecordFromNHibernate
    GetTestRecordThroughNHibernateViaADO(decimal ADOSavedObjectID)
    // here we have NHibernate API to fetch the record which uses ADO.NET (sorry I am not providing any lines of code, as I don’t have the source code of NHibernate that is accessing –ADO.NET )
    // Exception is raised.
    Please share your thoughts on this exception in ODP.NET, and request me if you need any additional details.
    Thanks

    Hi,
    How often does this occur? Is this consitently reproducible with certain code? Is it always that code that has the problem? Can you generally reproduce this in a test environment?
    For issues regarding 3rd party libraries that cannot be reproduced with a source code testcase, I'd generally recommend testing latest software versions if that's an option.
    If the behaivor still occurs on current versions, it may be best to open a SR with support so we can get some tracing, and also a memory dump of the access violation to see if we can match it to known issues. You can get a memory dump via setting ODP tracing to level 8, or also via the use of adplus, debugdiag, etc.
    Hope it helps, but realize it may not,
    Greg

  • Reflection: get an instance of a internal class by default constructor

    Hi there
    first the structure (reduced):
    public class ConvertionFactors { //singelton
    private HashMap<String,Class> factors = new HashMap<String,Class>();
    private class M_TO_FT implements DataFilter{
    public double convert(double value) {
    return value*M_IN_FT;
    public DataFilter getFilter(String from, String to)
    String name = from.toUpperCase()+convertionMethodNameSeparator+to.toUpperCase();
    Class c = factors.get(name); //retrieve the class
    Object o = c.newInstance(); //generate a instance.... not working
    return (DataFilter)o;
    The problem i want an instance of the internal class without defining a construktor like
    public M_TO_FT(){} because there are many classes like this one :-(
    (that was already working with a constructor that wants an instance of the container class.... thats what i am missing in the call c.newInstance() which uses the default constructor (i gues))
    i want something like
    new M_TO_FT() ; just the reflection version of it which calls the default constructor
    thanks for help

    well i get a Exception like this:
    java.lang.InstantiationException: com.eads.jpinfinity.data.unit.ConvertionFactors$M_TO_FT
         at java.lang.Class.newInstance0(Class.java:335)
         at java.lang.Class.newInstance(Class.java:303)
         at com.eads.jpinfinity.data.unit.ConvertionFactors.getFilter(ConvertionFactors.java:315)
         at com.eads.jpinfinity.data.unit.junit.ConvertionFactorsTest.testGetFilter(ConvertionFactorsTest.java:50)
         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:585)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
    i think because i never told the method which is the containing class for this internal class. if i defina a constructor in the inner class it always needs a instance of the containter. by calling c.newInstance() there is no relation to the container class and because the inner class cant exist without the outer class it may not be constructed.
    It is possible to get an instance with "new FT_TO_M();" (the traditional way) with the default constructor but jet i have not found a way to get a instance of a inner class with reflection without defining a constructor.

  • Returning a HashMap K, M from a method of a class typed M

    So, this is what I have. I have a class parameterized for a bean type of a collection it receives, and in a method of the class, I need (would like) to return a HashMap typed as <K, M> as in:
    public class MyClass<M> {
       private Collection<M> beanList;
       public HashMap<K, M> getMap(  /* what do I do here */ );
    }I tried to cheat from looking at the Collections.sort method, knowing it uses the List type in its return type as in:
    public static <T extends Comparable<? super T>> void sort(List<T> list)So, I am trying:
    public HashMap<K, M> getMap(Class<K> keyType)But, it is telling me I need to create class K.
    So... how does the Collections.sort method get away with it and I can't????
    I suppose I could write the method as:
    public HashMap<Object, M> getMap()but became somewhat challenged by my first guess.
    Any ideas... or just go with the HashMap with the untyped key?

    ejp wrote:
    provided K is inferable from the arguments.Or from the assignment context:
    Set<String> empty = Collections.emptySet();
    Otherwise you have to parameterise the class on <K, M>.You may also specifically provide K when you use the method if the context doesn't give the compiler enough information or if you want to override it.
    Example:
    Set<Object> singleton1 = Collections.singleton("Hello"); //error
    Set<Object> singleton2 = Collections.<Object>singleton("Hello"); //fineEdited by: endasil on 14-May-2010 4:13 PM

  • Function Module to open a new session displaying a method of a class

    Hello All,
    I have a method A of class B.
    Now, in my current session, I have a button. When the user clicks on this button, what I expect is that a new session be opened and in the new session method A of class B be displayed.
    This is similar to the debugger, wherein, in the debugging mode, we can bring up the context menu in the Source Code (Edit Control) tool, and then select "Go To Source Code".
    So basically, I am looking for a Function Module which does the same.
    I came across Function Module CC_CALL_TRANSACTION_NEW_TASK, however, this will only create a new session.
    I could specify the transaction as SE24, but it then opens a new session with this transaction. That is it.
    My objective is to display the method of a class in a new session.
    Is there any Function Module in this case?
    Regards,
    Mithun
    Edited by: Mithun Kamath on Aug 9, 2011 5:35 PM

    Hello Sandra,
    Thank you very much. That was exactly what I was looking for.
    However, instead of calling EDITOR_PROGRAM directly, what I instea did was the following:
    1) Created a RFC enabled Function module.
    2) Inside this function module, I wrote the following code:
      SUBMIT tpda_editor_start AND RETURN
       WITH prgm  = is_alert_det-program_name
       WITH incl = is_alert_det-include_name
       WITH dynp = space
       WITH line = is_alert_det-line_no.
    The parameters above were similar to the one proposed by you.
    Borrowed the above from the class CL_TPDA_SERVICES_TOOLS, method NAVIGATE_TO_SOURCE.
    The above is basically called in the debugger, when we use the context menu in the editor tool and invoke the "Goto Source Code" functionality. This eventually calls the EDITOR_PROGRAM FM.
    The reason why I did this is because when I was testing the FM, it did not allow me to specify the include as CL_TEST=====CM01. I do not know why, probably I was doing it wrong. But it gave me a message saying that the object does not exist in table TADIR.
    Anyway, I did the above steps and it worked exactly as I wanted it to.
    I would like to thank you again.
    Best Regards,
    Mithun
    P.S. Forgot to add, I called the above RFC enabled FM as a new task.
    Edited by: Mithun Kamath on Aug 10, 2011 4:19 PM

  • How do i call the method in a class using servlet

    i am doing a project which need to use servlet to call a few methods in a class and display those method on the broswer. i tried to write the servlet myself but there are still some errors .. can anyone help:
    The servlet i wrote :
    package qm.minipas;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class test extends HttpServlet {
    Database database;
    /** Initializes the servlet.
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    database = FlatfileDatabase.getInstance();
    /** Destroys the servlet.
    public void destroy() {
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("this is my class wossname"+FlatfileDatabase.getInstance()); // this is calling the toString() method in the instance of myJavaClass
    out.println("this is my method"+FlatfileDatabase.getAll());
    out.println("</body>");
    out.println("</html>");
    out.close();
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    my methods which i need to call are shown below:
    public Collection getAll() {
    return Collections.unmodifiableCollection(patientRecords);
    public Collection getInpatients() {
    Collection selection=new ArrayList();
    synchronized(patientRecords) {
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(next.isInpatient())
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByAdmissionDate(Date dateOfAdmission) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(dateOfAdmission.equals(next.getDateOfAdmission()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByAdmissionDates(Date from,Date to)
    throws IllegalArgumentException {
    if(to.before(from))
    throw new IllegalArgumentException("End date must not be before start date");
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    Date nextAD=next.getDateOfAdmission();
    if((nextAD.after(from)||nextAD.equals(from))
    &&(nextAD.before(to)||nextAD.equals(to)))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByDischargeDates(Date from,Date to)
    throws IllegalArgumentException {
    if(to.before(from))
    throw new IllegalArgumentException("End date must not be before start date");
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    Date nextAD=next.getDateOfDischarge();
    if(nextAD==null)
    continue;
    if((nextAD.after(from)||nextAD.equals(from))
    &&(nextAD.before(to)||nextAD.equals(to)))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByConsultant(String consultant) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(consultant.equalsIgnoreCase(next.getConsultant()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByDischargeDate(Date dateOfDischarge) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(dateOfDischarge.equals(next.getDateOfDischarge()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getBySurname(String surname) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(surname.equalsIgnoreCase(next.getSurname()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByWard(String ward) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(ward.equalsIgnoreCase(next.getWard()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);

    please provide a detail description of your errors.

  • "Open method of Workbooks class failed" when opening Excel file via Internet Explorer

    (apologies, I posted this first to the general Office 2010 forum, but then realized this was probably a better spot to post)
    We have an Excel COM add-in installed on users' PCs.  This add-in responds to workbook open events by opening a particular XLA file (also deployed to the PC) to make certain features available.  This process works flawlessly when Excel files are
    opened locally - but when a user attempts to open an Excel file from an IE link, we get the following error: "Open method of Workbooks class failed".  This is happening on the line that is trying to open the XLA file.  This only happens
    when launching an Excel link from IE - works fine in Chrome or Firefox.
    I have found several posts on this topic, but no solutions:
    1. This post (https://social.msdn.microsoft.com/forums/office/en-US/73c96005-84af-4648-b103-32b677205be3/open-method-of-workbooks-class-failed)
    is the closest to our problem.  In this case, the "answer" was that the user may not have access to the 2nd workbook being opened.  But in our case, we're opening an XLA that is on the local machine, and I've confirmed that it is not
    corrupt and accessible (read & write, just in case!) to Everyone.
    2. This (very old) post (http://www.pcreview.co.uk/forums/open-method-workbooks-fails-excel-hosted-ie-t965608.html)
    seems similar, but is talking about opening Excel inside of IE.  This is not what we're doing - the link is supposed to (and does) open Excel outside of IE.  Interestingly, Excel.exe is being launched with the "-embedded" flag, even
    though it isn't running in the IE window.  When launching Excel by opening the file locally, Excel.exe is run with the "/dde" flag instead.  Clearly the "-embedded" mode is what is causing the problem.  I could change the
    links on the web page to use some JavaScript to open Excel differently... unfortunately, the links are actually generated by SharePoint (the Excel files are in a SP repository), so this is not really an option.
    3. This Microsoft KB article (http://support.microsoft.com/kb/268016) talks about problems opening an XLA directly from IE... but this is the case of a link pointing
    directly to an XLA file, not opening a regular workbook that in turn opens an XLA, as is my case.  In fact, this article specifically points out in the "More Information" section that "End users do not normally open XLAs; instead they open
    an XLS that (if needed) loads one or more XLAs during startup." ==> precisely what I'm trying to do that is giving me the error!
    I've replicated the situation with a very simple COM add-in (created in VS2010 using VB.Net) and a very simple XLA file (does nothing, just pops up a message in auto_open).  For anyone wanting to try it out, here is the exact test case:
    1. In Excel, create a simple XLA file containing only the following code, and save it in C:\TEMP\dummy.xla:
    Sub Auto_Open()
    MsgBox "Auto Open fired"
    End Sub
    2. In Visual Studio, create a new Excel 2010 Add-In.  I created mine via Visual Basic, but I doubt the choice of language matters.  Place the following code in ThisAddin.vb:
    Public Class ThisAddIn
    Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
    AddHandler Me.Application.WorkbookOpen, AddressOf Application_WorkbookOpen
    End Sub
    Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
    End Sub
    Sub Application_WorkbookOpen(ByVal workbook As Excel.Workbook)
    On Error GoTo ErrHandler
    If (Not workbook.Name.Contains("dummy.xla")) Then
    MsgBox("Workbook open")
    Application.Workbooks.Open("C:\temp\dummy.xla")
    Application.Workbooks("dummy.xla").RunAutoMacros(Excel.XlRunAutoMacro.xlAutoOpen)
    End If
    Exit Sub
    ErrHandler:
    MsgBox(Err.Description)
    End Sub
    End Class
    3. Build & publish this add-in and install it on the same machine as the XLA created in step 1.
    4. Create and save an empty Excel workbook (I called mine WayneTest1.xlsx) - save it locally (on your desktop), and put a copy somewhere on your web server (I put mine directly in c:\inetpub).
    5. Create an HTML file with a link to that workbook, saving it to the same web server location - here is mine:
    <html>
    <body>
    <a href="WayneTest1.xlsx">Link to Excel file</a>
    </body>
    </html>
    6. Double click the workbook on your desktop (from step 4) - opens fine, I get the "workbook open" message, following by the "Auto Open fired" message.
    7. In Internet Explorer, navigate to the HTML file specified in step 5 and click on the link - when prompted, select "Open" - I get the "workbook open" message, following by the error message "Open method of Workbooks class failed".
    Here are a few things I've ruled out / tried so far:
    - Unchecked all the "Protected View" settings in Excel, made no difference
    - Unchecked all the "File block settings" in Excel, made no difference
    - Made sure dummy.xla was open for read & write to Everyone
    - Made sure the web page was in Trusted sites and set the security level to Low for those sites in IE
    - Tried making the local desktop file (step 6) readonly, made no difference (i.e. launching it locally still worked fine)
    - Tried using Excel 2013 - made no difference
    Any ideas / suggestions?

    Hello Wayne,
    Apologies for the delay.
    I went through your post and tried to reproduce the issue. I was able to reproduce it. Based
    on its complexity and as it requires more in-depth analysis, your question falls into the paid support category which requires a more in-depth level of support.
    Please visit the below link to see the various paid support options that are
    available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
    Thanks,
    Anush

Maybe you are looking for