Extract DDL - types null pointer

version 1.1.2.25.79 - tried to extract DDL types - just generated an empty file
upgraded to 1.2.0.2998 - SqlDeveloper in loop (showing error message box) - forced to kill it. Also, am able click on each object type and will show the create statement. Really need to do all (to many to do one by one). Is this a known issue with the current release?

OK, thanks for the detail. I am unable to replicate your error. (My types export OK)
As you say, you can see the DDL, using the Code tab for the individual type selected in the Connection Navigator, so an alternative, is to select all types in the Types node and right -click for the context menu and select Export DDL.( you can export to file or the worksheet)
Your Export DDL dialog issue is something else. Can you post more detail about your exception here and let's look into it.
Sue

Similar Messages

  • Null Pointer when fetching VARRAY / OBJECT TYPE

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody there who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody there who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

  • Null Pointer when fetching VARRAY / OBJEC TYPE

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody ther who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

    Sven,
    Here is my simplified example. I hope it helps you.
    I am using JDK 1.5.0_06, Oracle 9.2.0.1 database and latest Oracle JDBC driver ("ojdbc14.jar").
    create or replace type OBJ as object (
      QUANTITY  number
    ,PRICE     number
    create or replace type VA_OBJ as varray(100) of OBJ
    create table TBL (
      CLMN  VA_OBJ
    insert into TBL (CLMN)
    values (VA_OBJ(OBJ(0,1),OBJ(10,100),OBJ(100,1000)))
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Arrays;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.STRUCT;
    public class ArStruct {
      public static void main(String[] args) {
        Connection c = null;
        OracleDataSource ods = null;
        ResultSet rs = null;
        Statement s = null;
        try {
          ods = new OracleDataSource();
          ods.setURL("jdbc:oracle:thin:scott/tiger@//host:1521/orcl");
          c = ods.getConnection();
          s = c.createStatement();
          rs = s.executeQuery("select CLMN from TBL");
          if (rs.next()) {
            ARRAY ar = (ARRAY) rs.getObject(1);
            Object[] obj = (Object[]) ar.getArray(1L, 1);
            if (obj != null) {
              STRUCT struct = (STRUCT) obj[0];
              obj = struct.getAttributes();
              System.out.println(Arrays.asList(obj));
        catch (Exception x) {
          x.printStackTrace();
        finally {
          if (c != null) {
            try {
              c.close();
            catch (SQLException xSql) {
              System.err.println("Failed to close database connection.");
              xSql.printStackTrace();
          if (ods != null) {
            try {
              ods.close();
            catch (SQLException xSql) {
              System.err.println("Failed to close datasource.");
              xSql.printStackTrace();
    }When I run the above class, this is the output:
    [0, 1]Good Luck,
    Avi.

  • How to get the Benefits Rate multiplier value in HCM extract ? used Extract rule type Fastfomula, but returns null.

    how to get the Benefits Rate multiplier value in HCM extract ? used Extract rule type Fastfomula, but returns null.
    Formula:
    DEFAULT FOR BEN_ABR_NAME IS 'NA'
    DEFAULT FOR l_rate_multiplier IS 'X'
    L_BG_ID = GET_CONTEXT(BUSINESS_GROUP_ID, 1)
    L_EFF_DATE = GET_CONTEXT(EFFECTIVE_DATE, to_date('1951/01/01 00:00:00'))
    L_ABRT_ID = GET_CONTEXT(ACTY_BASE_RT_ID, 9999)
    CHANGE_CONTEXTS(EFFECTIVE_DATE = L_EFF_DATE, BUSINESS_GROUP_ID = L_BG_ID, ACTY_BASE_RT_ID = L_ABRT_ID )
    l_rate_multiplier = BEN_ABR_NAME
    RETURN l_rate_multiplier

    I used DBI - BEN_ABR_NAME.
    What is back end query ? can we use query to extract the value in Extracts ?

  • Null pointer error if not started with 1st in string

    hi, this little pratice is about building a simple shopping cart. the TOAD.JSP will display the item list and quantity, user could check item and input the quantity that they want. if the user input larger quantity than database, servlet will sent the back to TOAD.jsp and show message. now it works if selected from 1 item, but if selected 2nd or 3rd, it will have null pointer error over here:
    for(int i=0; i<ItemList.size(); i++)
    newit = (ItemBean)ItemList.get(i);
    if (item != null && item.equals(newit.getItem()) )
    %>
    <tr>
    <td ><input type="checkbox" name = "item" value="<%= newit.getItem() %>"><b><%= newit.getItem() %> </b><br></td>
    <td><input type=text name="<%= newit.getItem() %>Qty" value="<%= orderQty%>"></td>
    </tr>
    <tr><td colspan = 2>
    <font size="3" color="red">
    The item <%= newit.getItem() %> is NOT available in stock</font>
    </td>
    </tr>
    <%
    } else {
    %>
    <tr>
    <td ><input type="checkbox" name = "item" value="<%= newit.getItem() %>"><b><%= newit.getItem() %> </b><br></td>
    <td><b><input type=text name="<%= newit.getItem() %>Qty" value="<%= newit.getQty()%>"></b> </td>
    </tr>
    <%
    %>
    thanks for your time!

    You have prvided unsufficent information and poorly formatted code and as such no meaningful answer can given you at present.
    But here is the best that one can guess at.
    You have a null somewhere.
    Is it coming from this code? I am going to say no.
    Where does it come from? I don't know.
    Where should you look? In the code that does processing to see what happens when yuo have more than one item.
    What should you do next? Start putting in some debugging and tracing statements to see where you are heading off into the null abyss.

  • Adding a new UDF throws a null pointer exception and modifying user.xml

    Hello,
    I have a two part question.
    i. I am trying to add a UDF (using Advanced>User Configuration..Attributes) to a fully configured OIM i.e. oim with reconciliation and provisioning from and to resources but it throws a null pointer exception. Look at the log, I see
    ===============Excerpt form the log file==========
    [2012-01-26T11:28:14.447-05:00] [oim_server1] [NOTIFICATION] [] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [[
    ---Stack Trace Begins[[This is not an exception. For debugging purposes]]---
    oracle.iam.platform.authz.impl.OESAuthzServiceImpl.doCheckAccess(OESAuthzServiceImpl.java:210)
    oracle.iam.platform.authz.impl.OESAuthzServiceImpl.hasAccess(OESAuthzServiceImpl.java:188)
    oracle.iam.platform.authz.impl.OESAuthzServiceImpl.hasAccess(OESAuthzServiceImpl.java:180)
    oracle.iam.platform.authz.impl.AuthorizationServiceImpl.hasAccess(AuthorizationServiceImpl.java:173)
    oracle.iam.configservice.impl.ConfigManagerImpl.checkAuthorization(ConfigManagerImpl.java:1899)
    oracle.iam.configservice.impl.ConfigManagerImpl.addAttribute(ConfigManagerImpl.java:177)
    oracle.iam.configservice.api.ConfigManagerEJB.addAttributex(Unknown Source)
    ... 21 lines skipped..
    oracle.iam.configservice.api.ConfigManager_5u0nrx_ConfigManagerRemoteImpl.addAttributex(ConfigManager_5u0nrx_ConfigManagerRemoteImpl.java:864)
    ... 13 lines skipped..
    oracle.iam.configservice.api.ConfigManagerDelegate.addAttribute(Unknown Source)
    oracle.iam.configservice.agentry.config.CreateAttributeActor.perform(CreateAttributeActor.java:266)
    oracle.iam.consoles.faces.mvc.canonic.Model.perform(Model.java:547)
    oracle.iam.consoles.faces.mvc.admin.Model.perform(Model.java:324)
    oracle.iam.consoles.faces.mvc.canonic.Controller.doPerform(Controller.java:255)
    oracle.iam.consoles.faces.mvc.canonic.Controller.doSelectAction(Controller.java:178)
    oracle.iam.consoles.faces.event.NavigationListener.processAction(NavigationListener.java:97)
    ... 24 lines skipped..
    oracle.iam.platform.auth.web.PwdMgmtNavigationFilter.doFilter(PwdMgmtNavigationFilter.java:115)
    ... weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    oracle.iam.platform.auth.web.OIMAuthContextFilter.doFilter(OIMAuthContextFilter.java:100)
    ... 15 lines skipped..
    weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ---Stack Tracefor this call Ends---
    [2012-01-26T11:28:14.447-05:00] [oim_server1] [NOTIFICATION] [IAM-1010010] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [arg: 1] [arg: null] [arg: USER_MANAGEMENT_CONFIG] [arg: CREATE_ATTRIBUTE] ********** Entering the Authorization Segment with parameters:: LoggedInUserId = 1, target resourceID = null, Feature = USER_MANAGEMENT_CONFIG, Action = CREATE_ATTRIBUTE **********
    [2012-01-26T11:28:14.448-05:00] [oim_server1] [NOTIFICATION] [IAM-1010021] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [arg: [InternalObligation: name: noop, values: [true], convertToObligation: false, InternalObligation: name: noop, values: [true], convertToObligation: false]] Validating the Internal Obligations: [InternalObligation: name: noop, values: [true], convertToObligation: false, InternalObligation: name: noop, values: [true], convertToObligation: false]
    [2012-01-26T11:28:14.448-05:00] [oim_server1] [NOTIFICATION] [IAM-1010022] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] ---------- The list of Internal Obligation is satisfied, returning TRUE ----------
    [2012-01-26T11:28:14.448-05:00] [oim_server1] [NOTIFICATION] [IAM-1010026] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [arg: Decision :PERMIT\nObligations from policy: ] ********** Exiting the Authorization Segment with result Decision :PERMIT[[
    =============Excerpt ends==============
    Is there a reason why this is and how do I get by it.
    ii. Can I just add the field directly within the MDS>file/user.xml? Would there be an issue with changing an existing attribute metadata using the user.xml?

    Pradeep thank you for your response. it was helpful. However, I also found the responses to both my questions.
    i. The null pointer exception was due to using a complex query I was using in the LOV query. I tried a simple query and that worked fine.
    ii. For modifying the user defined attributes one can consult the following forum post:
    OIM 11g - Change UDF Field Type form String to LOV
    Thanks

  • Why am I receiving Null pointer Exception Error.

    why am I receiving Null pointer Exception Error.
    Hi I am developing a code for login screen. There is no syntex error as such ut I am receving the aove mentioned error. Can some one please help me ??
    ------------ Main.java------------------
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Main implements ActionListener
    Frame mainf;
    MenuBar mb;
    MenuItem List,admitform,inquiry,exit,helpn;
    Menu newm,update,help;
    Inquiry iq;
    Admit ad;
    // HosHelp hp;
    Howuse hu;
    Register reg;
    Main()
    mainf=new Frame(" Engg College V/S Mumbai University ");
         mb=new MenuBar();
         newm=new Menu(" New ");
         update=new Menu(" Update ");
         help=new Menu(" Help ");
         List=new MenuItem("List");
         admitform=new MenuItem("Admit");
         inquiry=new MenuItem("Inquiry");
         exit=new MenuItem("Exit");
         helpn=new MenuItem("How to Use?");
    newm.add(List);
                   newm.add(admitform);
    newm.add(inquiry);
                   newm.add(exit);
         help.add(helpn);
              mb.add(newm);
              mb.add(update);
              mb.add(help);
    mainf.setMenuBar(mb);
                   exit.addActionListener(this);
                   List.addActionListener(this);
         inquiry.addActionListener(this);
         admitform.addActionListener(this);
    helpn.addActionListener(this);
         mainf.setSize(400,300);
         mainf.setVisible(true);
    public void actionPerformed(ActionEvent ae)
    if (ae.getSource()==List)
              reg=new Register();
         if(ae.getSource()==inquiry)
         iq=new Inquiry();
    if(ae.getSource()==admitform)
         ad=new Admit();
              if(ae.getSource()==helpn)
              hu=new Howuse();
              if(ae.getSource()==exit)
         mainf.setVisible(false);
    public static void main(String args[])
              new Main();
    -------------Register.java---------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Register implements ActionListener//,ItemListener
    Label id,name,login,pass,repass;
    Button ok,newu,cancel,check;
    Button vok,iok,lok,mok,sok; //buttons for dialog boxes
    TextField idf,namef,loginf,passf,repassf;
    Dialog valid,invlog,less,mismat,acucreat;
    Frame regis;
    Checkbox admin,limit;
    CheckboxGroup type;
    DBconnect db;
    Register()
         db=new DBconnect();
    regis=new Frame("Registeration Form");
              type=new CheckboxGroup();
              admin=new Checkbox("Administrator",type,true);
              limit=new Checkbox("Limited",type,false);
              id=new Label("ID :");
    name=new Label("Name :");
         login=new Label("Login :");
         pass=new Label("Password :");
         repass=new Label("Retype :");
    idf =new TextField(20); idf.setEnabled(false);
         namef=new TextField(30); namef.setEnabled(false);
    loginf=new TextField(30); loginf.setEnabled(false);
         passf=new TextField(30); passf.setEnabled(false);
         repassf=new TextField(30); repassf.setEnabled(false);
    ok=new Button("OK"); ok.setEnabled(false);
         newu=new Button("NEW");
    cancel=new Button("Cancel");
         check=new Button("Check Login"); check.setEnabled(false);
    vok=new Button("OK");
         iok=new Button("OK");
              lok=new Button("OK");
              mok=new Button("OK");
              sok=new Button("OK");
    valid=new Dialog(regis,"Login name is valid !");
         invlog=new Dialog(regis,"Login name already exist!");
         less=new Dialog(regis,"Password is less than six characters !");
    mismat=new Dialog(regis,"password & retyped are not matching !");
    acucreat=new Dialog(regis,"You have registered successfully !");
         regis.setLayout(null);
    //     regis.setBackground(Color.orange);
    valid.setLayout(new FlowLayout());
         invlog.setLayout(new FlowLayout());
         less.setLayout(new FlowLayout());
         mismat.setLayout(new FlowLayout());
    acucreat.setLayout(new FlowLayout());
    id.setBounds(35,50,80,25); //(left,top,width,hight)
    idf.setBounds(125,50,40,25);
    name.setBounds(35,85,70,25);
    namef.setBounds(125,85,150,25);
    login.setBounds(35,120,80,25);
    loginf.setBounds(125,120,80,25);
    check.setBounds(215,120,85,25);
         pass.setBounds(35,155,80,25);
    passf.setBounds(125,155,80,25);
    repass.setBounds(35,190,80,25);
    repassf.setBounds(125,190,80,25);
    admin.setBounds(35,225,100,25);
    limit.setBounds(145,225,100,25);
              ok.setBounds(45,265,70,25);
         newu.setBounds(135,265,70,25);
    cancel.setBounds(225,265,70,25);
         passf.setEchoChar('*');
    repassf.setEchoChar('*');
         regis.add(id);
         regis.add(idf);
    regis.add(name);
         regis.add(namef);
         regis.add(login);
         regis.add(loginf);
         regis.add(check);
    regis.add(pass);
         regis.add(passf);
    regis.add(repass);
         regis.add(repassf);
         regis.add(ok);
         regis.add(newu);
         regis.add(cancel);
    regis.add(admin);
         regis.add(limit);
    valid.add(vok);
         invlog.add(iok);     
         less.add(lok);
         mismat.add(mok);
    acucreat.add(sok);
    ok.addActionListener(this);
         newu.addActionListener(this);
    check.addActionListener(this);
    cancel.addActionListener(this);
         // limit.addItemListener(this);
         //admin.addItemListener(this);
              vok.addActionListener(this);
              iok.addActionListener(this);
         lok.addActionListener(this);
         mok.addActionListener(this);
         sok.addActionListener(this);
    regis.setLocation(250,150);
    regis.setSize(310,300);
    regis.setVisible(true);
         public void actionPerformed(ActionEvent ae)
         if(ae.getSource()==check)
              try{
                   String s2=loginf.getText();
    ResultSet rs=db.s.executeQuery("select* from List");
                        while(rs.next())
                   if(s2.equals(rs.getString(2).trim()))
    //                    invlog.setBackground(Color.orange);
                             invlog.setLocation(250,150);
                             invlog.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                        invlog.setVisible(true);
                             break;
                        else
                        //     valid.setBackground(Color.orange);
                             valid.setLocation(250,150);
                             valid.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                   valid.setVisible(true);
                        }catch(Exception e)
                   e.printStackTrace();
    if(ae.getSource()==newu)
         try{
              ResultSet rs=db.s.executeQuery("select max(ID) from List");
         while(rs.next())
    String s1=rs.getString(1).trim();
                   int i=Integer.parseInt(s1);
    i++;
                   String s2=""+i;
    idf.setText(s2);
                   newu.setEnabled(false);
                   namef.setText(""); namef.setEnabled(true);
              loginf.setText(""); loginf.setEnabled(true);
              passf.setText(""); passf.setEnabled(true);
              repassf.setText(""); repassf.setEnabled(true);
              ok.setEnabled(true);
                   check.setEnabled(true);
                   }catch(Exception e)
              e.printStackTrace();
         if(ae.getSource()==ok)
              try
              String s1=idf.getText();
              String s2=loginf.getText();
              String s3=passf.getText();
         String s4=repassf.getText();
         int x=Integer.parseInt(s1);
         int t;
         if(type.getSelectedCheckbox()==admin)
              t=1;
              else
              t=0;
    ResultSet rs=db.s1.executeQuery("select* from List");
                   while(rs.next())
                   if(s2.equals(rs.getString(2).trim()))
                        invlog.setBackground(Color.orange);
                        invlog.setLocation(250,150);
                        invlog.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                        invlog.setVisible(true);
                        break;
                   else
                        if (s3.length()<6)
                        less.setBackground(Color.orange);
                             less.setLocation(250,150);
                             less.setSize(300,100);
                   ok.setEnabled(false);
                        cancel.setEnabled(false);
                        check.setEnabled(false);
                        less.setVisible(true);
    else if(!(s3.equals(s4)))
                        mismat.setBackground(Color.orange);
                        mismat.setLocation(250,150);
                        mismat.setSize(300,100);
                        ok.setEnabled(false);
                        cancel.setEnabled(false);
                        check.setEnabled(false);
                        mismat.setVisible(true);
                        else
    db.s1.execute("insert into User values("+x+",'"+s2+"','"+s3+"',"+t+")");
                        acucreat.setBackground(Color.orange);
                        acucreat.setLocation(250,150);
                        acucreat.setSize(300,100);
                        regis.setVisible(false);
                        acucreat.setVisible(true);
                   }//else
              }//while
                   } //try
              catch(Exception e1)
              // e1.printStackTrace();
              if (ae.getSource()==cancel)
              regis.setVisible(false);
              if (ae.getSource()==vok)
              ok.setEnabled(true);
                   cancel.setEnabled(true);
    check.setEnabled(true);
                   valid.setVisible(false);
              if (ae.getSource()==iok)
              ok.setEnabled(true);
                   cancel.setEnabled(true);
    check.setEnabled(true);
                   invlog.setVisible(false);
              if (ae.getSource()==lok)
              less.setVisible(false);
                   cancel.setEnabled(true);
    ok.setEnabled(true);
    check.setEnabled(true);
              if (ae.getSource()==mok)
              mismat.setVisible(false);
                   cancel.setEnabled(true);
    ok.setEnabled(true);
    check.setEnabled(true);
    if (ae.getSource()==sok)
              acucreat.setVisible(false);
              ok.setEnabled(false);
                   newu.setEnabled(true);
                   regis.setVisible(true);
         public static void main(String args[])
         new Register();
    -----------DBConnect.java------------------------------------
    import java.sql.*;
    public class DBconnect
    Statement s,s1;
    Connection c;
    public DBconnect()
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              c=DriverManager.getConnection("jdbc:odbc:Sonal");
              s=c.createStatement();
    s1=c.createStatement();
         catch(Exception e)
         e.printStackTrace();
    ----------Login.java----------------
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Login implements ActionListener
    Frame log;
    Label login,pass;
    TextField loginf,passf;
    Button ok,cancel;
    Dialog invalid;
    Button iok;
    Register reg;
    DBconnect db;
    Main m;
    Login()
    db=new DBconnect();
         log=new Frame();
         log.setLocation(250,210);
         login=new Label("Login :");
    pass=new Label("Password :");
         loginf=new TextField(20);
         passf=new TextField(20);
         passf.setEchoChar('*');
         ok=new Button("OK");
         // newu=new Button("New User");
         cancel=new Button("CANCEL");
         iok=new Button(" OK ");
    invalid=new Dialog(log,"Invalid User!");
    //log.setBackground(Color.cyan);
    //log.setForeground(Color.black);
         log.setLayout(null);
         // iok.setBackground(Color.gray);
         invalid.setLayout(new FlowLayout());
         login.setBounds(35,50,70,25); //(left,top,width,hight)
         loginf.setBounds(105,50,100,25);
         pass.setBounds(35,85,70,25);
         passf.setBounds(105,85,70,25);
         ok.setBounds(55,130,70,25);
    // newu.setBounds(85,120,80,25);
    cancel.setBounds(145,130,70,25);
    log.add(login);
    log.add(loginf);
    log.add(pass);
    log.add(passf);
    log.add(ok);
    // log.add(newu);
    log.add(cancel);
         invalid.add(iok);//,BorderLayout.CENTER);
    ok.addActionListener(this);
    // newu.addActionListener(this);
    cancel.addActionListener(this);
         iok.addActionListener(this);
    log.setSize(300,170);
    log.setVisible(true);
    public void actionPerformed(ActionEvent a)
    if(a.getSource()==ok)
         try{
              String l=loginf.getText();
              String p=passf.getText();
              ResultSet rs=db.s.executeQuery("select * from List");
              while(rs.next())
              if(l.equals(rs.getString(2).trim())&& p.equals(rs.getString(3).trim()))
                        String tp=rs.getString(4).trim();
                             int tp1=Integer.parseInt(tp);
    log.setVisible(false);
    if(tp1==1)
                             m=new Main();
                        // m.List.setEnabled(true);
                             else
                             m=new Main();
                             m.List.setEnabled(false);
                        break;
    else
                   invalid.setBackground(Color.orange);
                   invalid.setSize(300,100);
                   invalid.setLocation(250,210);
                   cancel.setEnabled(false);
              ok.setEnabled(false);
                   invalid.setVisible(true);
                   }catch(Exception e1)
                   e1.printStackTrace();
         if (a.getSource()==cancel)
         log.setVisible(false);
         if (a.getSource()==iok)
         invalid.setVisible(false);
         loginf.setText("");
         passf.setText("");
         cancel.setEnabled(true);
    ok.setEnabled(true);
         public static void main(String[] args)
         new Login();
    -------------inquiry.java---------------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.Date;
    import java.text.*;
    import java.sql.*;
    public class Inquiry implements ActionListener
    Frame inqry;
    Label name,addr;
    TextField namef,addrf;
    Button ok,cancel,dok;
    Dialog invalid;
    Frame result; //Result of the inquiry....
    Label lrname,lraddr,lward,lrdate,lcdate;
    TextField rname,raddr,ward,rdate,cdate;
    Date d;
    DateFormat df;
    Button rok,rcancel;
    Dialog success;
    Button rdok;
    DBconnect db;
    Inquiry()
              db=new DBconnect();
              inqry=new Frame("Inquiry Form");
              inqry.setLayout(null);
    inqry.setBackground(Color.cyan);
              name=new Label(" NAME ");
              addr=new Label("ADDRESS");
              namef=new TextField(20);
              addrf=new TextField(20);
              ok=new Button("OK");
              cancel=new Button("CANCEL");
              dok=new Button("OK");
              invalid=new Dialog(inqry,"Invalid Name or Address !");
              invalid.setSize(300,100);
         invalid.setLocation(300,180);
              invalid.setBackground(Color.orange);
              invalid.setLayout(new FlowLayout());
    result=new Frame(" INQUIRY RESULT "); //Result Window......
    result.setLayout(null);
    result.setBackground(Color.cyan);
    lcdate=new Label(" DATE ");
         lrname=new Label(" NAME ");
    lraddr=new Label(" ADDRESS ");
         lward=new Label(" WARD ");
         lrdate=new Label(" ADMIT-DATE ");
    cdate=new TextField(10);
         rname=new TextField(20);
    rname.setEnabled(false);
         raddr=new TextField(20);
         raddr.setEnabled(false);
         ward=new TextField(20);
         ward.setEnabled(false);
         rdate=new TextField(10);
         rdate.setEnabled(false);
         cdate=new TextField(20);
         d=new Date();
         df=DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.KOREA);
         cdate.setText(df.format(d));
         cdate.setEnabled(false);
    rok=new Button(" OK ");
         rcancel=new Button("CANCEL");
              name.setBounds(40,50,50,25);
    namef.setBounds(120,50,130,25);
    addr.setBounds(40,100,60,25);
    addrf.setBounds(120,100,80,25);
    ok.setBounds(60,145,70,25);
              cancel.setBounds(140,145,70,25);
              lcdate.setBounds(200,50,60,25); //Result Window......
    cdate.setBounds(270,50,80,25);      
    lrname.setBounds(35,85,70,25);
    rname.setBounds(140,85,180,25);
    lraddr.setBounds(35,120,80,25);
         raddr.setBounds(140,120,100,25);
    lward.setBounds(35,155,80,25);
    ward.setBounds(140,155,100,25);
    lrdate.setBounds(30,190,80,25);
    rdate.setBounds(140,190,80,25);
    rok.setBounds(70,240,70,25);
    rcancel.setBounds(170,240,70,25);
              inqry.add(name);
              inqry.add(namef);
              inqry.add(addr);
              inqry.add(addrf);
              inqry.add(ok);
              inqry.add(cancel);
    invalid.add(dok);
         result.add(lcdate); //Result Window......
         result.add(cdate);
              result.add(lrname);
              result.add(rname);
              result.add(lraddr);
              result.add(raddr);
              result.add(lward);
              result.add(ward);
              result.add(lrdate);
              result.add(rdate);
              result.add(rok);
              result.add(rcancel);
         ok.addActionListener(this);
         cancel.addActionListener(this);
         dok.addActionListener(this);
    rok.addActionListener(this); //Result Window......
         rcancel.addActionListener(this);
         inqry.setSize(280,180);
         inqry.setLocation(300,180);
         inqry.setVisible(true);
              result.setSize(400,280); //Result Window......
         result.setLocation(200,150);
         result.setVisible(false);
              public void actionPerformed(ActionEvent ae)
                   if(ae.getSource()==ok)
                   try
                             String nm=namef.getText();
                             String ad=addrf.getText();
                             inqry.setVisible(false);
                             ResultSet rs=db.s.executeQuery("select * from Billinformation");
                             while(rs.next())
                                  String nm1=rs.getString(2).trim();
                                  String ad1=rs.getString(3).trim();
                                  int k=0;
                                  if((nm1.equals(nm))&&(ad1.equals(ad)))
                             String adm=rs.getString(5).trim();
                             String wr=rs.getString(6).trim();
                             String bd=rs.getString(8).trim();
                                  String wrb=wr+"-"+bd;
    result.setVisible(true);
                                  rname.setText(nm1);
                             raddr.setText(ad1);
                             ward.setText(wrb);
                             rdate.setText(adm);
    k=1;
                                  break;
                                  }//if
                             else if(k==1)
                             invalid.setVisible(true);
                             }//while
    }//try
                             catch(Exception e)
                             e.printStackTrace();
                        } //getsource ==ok
                   if(ae.getSource()==cancel)
    inqry.setVisible(false);
                        if(ae.getSource()==rok) //Result Window......
                        namef.setText("");
                             addrf.setText("");
                             result.setVisible(false);
                        inqry.setVisible(true);
    if(ae.getSource()==rcancel)
    result.setVisible(false);
                        if(ae.getSource()==dok)
                        namef.setText("");
                             addrf.setText("");
                             invalid.setVisible(false);
                             inqry.setVisible(true);
         public static void main(String args[])
              new Inquiry();
    PLease Help me !!
    I need this urgently.

    can you explain what your program tries to do... and
    at where it went wrong..Sir,
    We are trying to make an project where we can make a person register in our data base & after which he/she can search for other user.
    The logged in user can modify his/her own data but can view other ppl's data.
    We are in a phase of registering the user & that's where we are stuck. The problem is that after the login screen when we hit register (OK- button) the data are not getting entered in the data base.
    Can u please help me??
    I am using "jdk1.3' - studnet's edition.
    I am waiting for your reply.
    Thanks in advance & yr interest.

  • EvaluatingTteststand 4.2.1: Null pointer access violation (error 17502) when attempting to use a mixed-mode std::map / boost shared_ptr class contained in a DLL through an interface from a different DLL

    Hi there.
    I have been working on a test system which will potentially have TestStand at its core, and downloaded/installed the 4.2.1 evaluation. Current details from the information dialog are:
    TestStand Engine version 4.2.1 (4.2.1.83)
    Sequence Editor Verison 4.2.1.83
    The system will drive mobile radio devices using RS232 serial interfaces, usnig a variety of serial protocols (Hayes, and a couple of proprietary binary protocols for other work).
    We already have in existence a soak tester, written in VS2005 with MFC unmanaged DLLs and also managed DLLs, which are mixed up together to provide different aspects of the functionality required for the binary protocols.
    I have created:
    1. a "master wrapper" DLL for the constellation of other DLLs - this offers up a simple C-API interface which I hope TestStand will use. It's called "SerialSessionMgr.dll""
    2. a mixed managed / unmanaged "IJW" (it just works) DLL which wraps up the binary logging protocol control interfaces, which are entirely in managed C++/CLI: the "master wrapper" DLL calls into this through an unmanaged interface to create instances of the CLI-compiled class which interfaces to the underlying managed DLLs imlpementing the logging protocol. This is called "WinTseInterface.dll".
    Before I started evaluating TestStand, I knocked up a test harness using CPPUnit / MFC, with which I was able to test SerialSessionMgr.dll and its' use of WinTseInterface.dll and verify they worked. The harness loads the DLL dynamically at run-time using AfxLoadLibrary() to try to emulate the way TestStand uses it.
    When we open a
    TSE session:
    The SerialSessionManager makes a call to the
    WinTseInterface.dll to "create" a logging instance. The instance is
    created in a std::map which is held by the CWinApp derived class, this map
    contains boost::shared_ptr of the class which works with a managed class. So we
    have a call trace: Client
    app->SerialSessionManager{TseStartSession()}->WinTseInterface{WINTSE_GetWinTseBridge()} - WINTSE_GetWinTseBridge()
    just creates a new instance of the unmanaged class which interfaces through to
    the managed CLI/C++ class beneath, and returns the address to the
    SerialSessionManager, which stores it.
    The SerialSessioManager actually initialises the WinTseBridge using a method of a C++ pure virtual interface class to the class in the std::map in the WinTseInterface DLL
    implements. The initialise call passes miscellaneous details and actually calls
    "gcnew" to create the managed class which interfaces to the
    underlying managed DLLs which implement the logging protocol.
    My logs of the DLL loading as seen in VS2005 debug output are attached this message as PDFs
    While trying to fix this, I have tried:
    Enhancing the WinTseInterface DLL so it manually loads all the other assemblies in the logging system, including the managed portion of WinTseInterface itself (no effect)
    All the different options for the way the C DLL adapter loads and unloads the DLL in the DLL adapter steptype in TestStand
    I've even tried calling directly into the WinTseInterface DLL before trying any SerialSessionManager DLL calls to try to load the WinTseInterface DLL completely beforehand
    and I cannot stop this exception.
    It seems like the object is created in the WinTseInterface DLL OK (I have debugged the creation step which runs for WINTSE_GetWinTseBridge() and the object is created OK) when the SerialSessionManager makes the call, but when it calls the first managed function, which creates the managed object, the DLL is reloaded as managed - I suspect this causes the object to be destroyed or overwritten, and thus the call to initialise bombs with null pointer violation.
    Have I done something obviously wrong, and what other approaches can I take? 
    Does TestStand 4.2.1 have issues with driving DLLs which use managed/unmanaged DLLs beneath them?
    My nuclear option is to throw the WinTseInterface DLL out completely and wrap up the managed C++ CLI code in a new interface, entirely managed, and use the TestStand ".Net" adaptor to drive that, creating my step library to run to that directly. This isn't ideal as I have some co-ordination of the protocols which is implemented in the SerialSessionMgr DLL.
    I hope someone can help. This one's low level, dirty and a stumper to me.
    Many thanks to the NI community. This is my first posting!
    Solved!
    Go to Solution.
    Attachments:
    CPPUnit Test Harness DLL load debug output.pdf ‏18 KB
    TestStand DLL load & crash debug output.pdf ‏43 KB

    Hi there Ray.
    First - many thanks for engaging with this thorny problem. Love the avatar BTW.
    I've been using the C/C++ DLL adapter: the original premise of the Serial Session Manager DLL was to provide a simple C type functional interface, using simple data types, so that TestStand would be able to drive the underlying functionality easily through a single DLL.
    Seeing as you've been kind enough to respond, I should explain the makeup of the DLLs a little more, I think.
    The SerialSessionManager (SSMgr) DLL uses C++ and MFC internally. This is the DLL which TestStand calls into directly through the C/C++ adapter. This DLL does have one odd feature though - because the it uses the Windows Multimedia Timer (implemented in WinMM.dll) I had to artificially create a scenario where it would load the .Net mscoree DLL _before_ it loads WinMM.dll - (http://connect.microsoft.com/VisualStudio/feedback/details/329819/freelibrary-in-the-winmm-dlls-modu...), basically WinMM.dll's init code gets rather upset when .Net DLLs load, which causes the entire executable to be unloaded with subsequent crashes.
    To work around this crash, the SSMgr has a single, completely empty, file which is compiled for CLR, effectively forcing a dependency into the DLL on the .Net subsystems and turning the DLL into a "IJW" binary. The resulting DLL doesn't actually have any executable managed .Net assemblies, but I'm guessing that it does contain enough .Net related stubs and information that when the DLL is loaded, mscoree.dll loads before WinMM.dll - and this means the system doesn't crash.
    Now, on to the WinTseInterface DLL. My initial description of this little software system was done in something of a hurry.
    This DLL is the C++/CLI "IJW" DLL which actually contains managed and unmanaged code. Underneath the WinTseInterface DLL is another system of (this time exclusively C++/CLI) DLL assemblies which implement the TSE protocol interpretation system.
    When the SSMgr DLL needs to start a TSE protocol session, it calls a C-API function in the WinTseInterface which creates a new CWinTseBridge class. Here's the steps in a little more detail:
    SSMgr DLL calls WINTSE_GetWinTseBridge(), passing in the name of the device which needs it (this is used to put the new WinTseBridge into a std::map in the WinTseInterface DLL) - this call runs just fine, and returns the address of the CWinTseBridge C++ object. This is stored in the SSMgr, because the CWinTseBridge class implements a pure virtual interface which is used by the SSMgr as a way of accessing the CWinTseBridge methods. 
    We now use the address from (1) to make a call to CWinTseBridge::Initialise(), passing some basic configuration details.
    I've run VS2005 debug on the Sequence Editor when running the test, and done F11 step-throughs of the code loading each parameter in the Initialise() call onto the stack, and what appears to happen is that when the call is made, the whole lot steps off into oblivion (a reference to 0x00000000 is made, I think).
    Do you think it's worth trying to get this approach to work? It would be useful to retain the control surface in the top of the SSMgr as there is co-ordination of the protocols within the logic of that component. If I move the Wintse control out into a separate managed DLL I may not have that co-ordination (this might be overcome with some design, as I've confirmed that it is possible to "reach into" the WinTseInterface DLL with TestStand and create and use managed objects from assemblies contained within).
    Are there any known issues with this version of TestStand using C/C++ CLI IJW DLLs? I haven't found much out there on the web.
    Attachments:
    Tse_Test.seq ‏7 KB

  • Crystal report (crystalReportsViewer) crash with null pointer exception

    Hi,
    My application are simple : m_crystalReportsViewer.ViewerCore.ReportSource = report; but in throw exception null pointer when I call showDialog.
    I see in code, we have method ShowTabHeader.
    private void ShowTabHeader(bool isShow)
        Grid child = VisualTreeHelper.GetChild(this.tabViews, 0) as Grid;
        TabPanel panel = child.FindName("HeaderPanel") as TabPanel;
        if (!isShow)
            panel.Visibility = Visibility.Collapsed;
        else
            panel.Visibility = Visibility.Visible;
    My problem :  child.FindName("HeaderPanel") as TabPanel return null
    =>  if (!isShow)
            panel.Visibility = Visibility.Collapsed;
        else
            panel.Visibility = Visibility.Visible;
    throws null pointer exception.
    Do you have any idea about this?
    Thanks.
    Here is stack trace :
    Unerwarteter Fehler im System ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at SAPBusinessObjects.WPF.Viewer.ReportAlbum.ShowTabHeader(Boolean isShow)
       at SAPBusinessObjects.WPF.Viewer.ReportAlbum.ItemsChangedEventHandler(Object sender, ItemsChangedEventArgs e)
       at System.Windows.Controls.Primitives.ItemsChangedEventHandler.Invoke(Object sender, ItemsChangedEventArgs e)
       at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
       at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
       at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
       at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
       at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.CollectionView.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
       at System.Collections.ObjectModel.Collection`1.Add(T item)
       at SAPBusinessObjects.WPF.Viewer.ReportAlbum.OnCreateNewDocumentViewComplete(CreateNewDocumentArgs args)
       at SAPBusinessObjects.WPF.Viewer.DelegateMarshaler.<>c__DisplayClass6`1.<Invoke>b__4(Object )
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       --- End of inner exception stack trace ---
    Edited by: duyhai707 on Jul 13, 2011 7:42 PM
    Edited by: duyhai707 on Jul 13, 2011 8:09 PM

    A lot I don't understand in here... actually, I don't understand anything in your post:
    When you call ShowDialog, what exactly are you trying to show?  The code is the decompiled showtabheader method of the viewer. So, are you trying to override the viewer control and reportalbum?  My guess is that the null reference is for the reportalbum's child object which is not the reportalbum object of the viewer.  I don't understand why the code since its all handled internally to the viewer anyhow.
    Perhaps searching the forum for code sample will help?
    Also, see the [WPF Demo|http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/a09f7025-0629-2d10-d7ae-df006a51d1a8]
    Other good WPF resources to consult:
    http://www.redmondpie.com/incorporate-crystal-reports-in-a-c-wpf-application/
    http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/a09f7025-0629-2d10-d7ae-df006a51d1a8
    http://www.codeproject.com/Tips/74499/Crystal-Report-in-WPF.aspx
    Re: Crystal Reports for Visual Studio 2010 - WPF Viewer for .Net 4.0
    http://codegain.com/articles/crystalreports/howto/incorporate-crystal-reports-in-wpf-using-c-sharp.aspx
    CRVS2010 Beta - WPF Viewer, how to hide the GroupTree control?
    Re: CRVS2010 Beta - WPF Viewer, how to hide the GroupTree control?
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Can't Find Null Pointer Exception

    Hey, guys! I've spent a couple of hours trying to figure this out, and I've been unable. When I run my program, I get a long list of errors that basically says I have a NullPointerException at Line 160 in LevelRenderer. I can't figure out what is null after tons of analyzing and experimenting, so I was wondering if one of you could assist me with this.
    First, here is the runtime error code:
    Game Update Error: java.lang.NullPointerException
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at LevelRenderer.paint(LevelRenderer.java:160)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
            at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:6
    93)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
    EventQueueUtilities.java:125)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
    ntrolContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Here's the code for the classes that are relevant to the issue. The runtime code is pointing me to the paint method's call of myLevel.drawLevel(gr, 0, 0):
    Here's the class that is giving me the error:
    /* This class's job is to render a level object.
    * The class will keep track of the top left coordinate of the space in which the player is moving
    * and how far the right side of the screen is. It will then draw the player always in the center
    * of the screen and allow the player to move the character. The character will animate with calls
    * to the Player class and also detect collision against the character. If there are collisions, then the
    * player will either fall or be unable to move. It will keep the screen image a little bit rendered
    * beyond the screen so that when the player moves, it will be able to still be visible until the next tile
    * is reached. It will update the screen every time the player moves and reference the level's collision
    * map for all of the collisions.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.JFrame;
    import javax.swing.*;
    import java.util.Random;
    import java.awt.Color;
    public class LevelRenderer extends JFrame
        // CONSTANTS
        private final int TILE_SIZE = 14;
        private final int SCREEN_WIDTH = 1280;
        private final int SCREEN_HEIGHT = 768;
        // END OF CONSTANTS
        // will be used as a buffer before everything is drawn to the screen
        private BufferedImage buffer;
        // character object
        private Player myPlayer;
        // level object
        private Level myLevel;
        // screen object
        private Screen s;
        // graphics object of the buffer
        private Graphics gr;
        // boolean to determine when to end the game
        private boolean endGame;
        // CONSTRUCTOR
        public LevelRenderer()
            setPreferredSize(new Dimension(1280, 768));
            setFocusable(true);
            requestFocus();
            setResizable(false);
            addKeyListener( new KeyAdapter()
                public void keyPressed(KeyEvent e)
                    processKey(e); 
                public void keyReleased(KeyEvent e)
                    processRelease(e);
            buffer = new BufferedImage(1280, 768, BufferedImage.TYPE_INT_ARGB);
            buffer.createGraphics();
            gr = buffer.getGraphics();
            myPlayer = new Player();
            Level myLevel = new Level("obstaclemap");
            endGame = false;
        // method to simply load an image from a path
        public static BufferedImage loadImage(String ref)
            BufferedImage bimg = null;
            try
               bimg = ImageIO.read(new File(ref));
            catch (Exception e)
                e.printStackTrace();
            return bimg;
        // Run method for class
        public void run(DisplayMode dm)
            setBackground(Color.WHITE);
              s = new Screen();
            try
                s.setFullScreen(dm, this);
            catch (Exception ex)
                System.out.println("Error creating rendered tiles!");
              while (!endGame)
                try
                    Thread.sleep(2);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
                try
                    myPlayer.animatePlayer();
                    myLevel.renderLevel();
                catch (NullPointerException ex)
                    System.err.println("Game Update Error: " + ex);
                try
                    repaint();
                catch (Exception ex)
                    System.err.println("Repaint Error: " + ex);
              s.restoreScreen();
        // method to draw the tiles on the screen
        public void paint(Graphics g)
            // draw the level and then the player
            myLevel.drawLevel(gr, 0, 0); 
            myPlayer.drawPlayer(gr, (SCREEN_WIDTH / 2) - TILE_SIZE / 2, (SCREEN_HEIGHT / 2) - TILE_SIZE);
            g.drawImage(buffer, 0, 0, null);
        // method to handle inputs and adjust the player accordingly
        public void processKey(KeyEvent e)
            int keyCode = e.getKeyCode();
            boolean moved = false;
            int xDisplace, yDisplace;
            // termination key
            if (keyCode == KeyEvent.VK_ESCAPE)
                endGame = true;
            // 1 - up
            // 2 - left
            // 3 - right
            // 4 - down
            // 5 - jump
            if (keyCode == KeyEvent.VK_UP)
                try
                    myPlayer.updatePlayer(0);
                    myLevel.updateLevel(0);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_LEFT)
                try
                    myPlayer.updatePlayer(1);
                    myLevel.updateLevel(1);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_RIGHT)
                try
                    myPlayer.updatePlayer(2);
                    myLevel.updateLevel(2);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_DOWN)
                try
                    myPlayer.updatePlayer(3);
                    myLevel.updateLevel(3);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_SPACE)
                try
                    myPlayer.updatePlayer(4);
                    myLevel.updateLevel(4);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
        // method to handle inputs and adjust the player accordingly
        public void processRelease(KeyEvent e)
            int keyCode = e.getKeyCode();
            boolean moved = false;
            int xDisplace, yDisplace;
            // 1 - up
            // 2 - left
            // 3 - right
            // 4 - down
            // 5 - jump
            if (keyCode == KeyEvent.VK_UP)
                try
                    myPlayer.updatePlayer(0);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_LEFT)
                try
                    myPlayer.updatePlayer(5);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_RIGHT)
                try
                    myPlayer.updatePlayer(6);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_DOWN)
                try
                    myPlayer.updatePlayer(3);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_SPACE)
                try
                    myPlayer.updatePlayer(4);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
    }And then here's the other class that is calling the drawLevel method that the compiler is pointing me in the direction of (where it's saying the NullPointerException is stemming from):
    /* The purpose of this class will be to load and manage a level, including its camera. */
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import java.awt.*;
    public class Level
        // CONSTANTS
        private final int TILE_SIZE = 14;
        private final int SCREEN_WIDTH = 1280;
        private final int SCREEN_HEIGHT = 768;
        // END OF CONSTANTS
        // stores the pixel image of the current level
        private BufferedImage levelImage;
        // stores the width and height of the level
        private int width, height;
        // stores the name of the level
        private String levelName;
        // stores collision map for level
        private LevelCollisions myCollisions;
        // stores the tile types in an array as assigned by colors
        private int levelTiles[][];
        // image used as the sheet for the level's tiles
        private BufferedImage tileSheet;
        // image array used to store the different tiles
        private BufferedImage[] tiles;
        // the image which represents the current view of the level
        private BufferedImage cameraImage;
        // Graphics context of the camera image
        private Graphics cameraG;
        // variables to represent the level's offset from the top left corner while moving
        private int offsetX, offsetY;
        // variables to represent the level's pixel map coordinate
        private int coordX, coordY;
        // STATIC COLOR VARIABLES
        private static final int SPACE_COLOR = 0xFF000000;
        private static final int WALL_COLOR = 0xFFFFFFFF;
        // END OF STATIC COLOR VARIABLES
        // CONSTRUCTOR
        public Level(String level)
            // load level image and collision map
            levelName = level;
            levelImage = loadImage(level + ".png");
            myCollisions = new LevelCollisions(level + "Collision");
            levelTiles = loadLevel();  
            // create blank camera canvas
            cameraImage = new BufferedImage(1280, 768, BufferedImage.TYPE_INT_ARGB);
            cameraImage.createGraphics();
            cameraG = cameraImage.getGraphics();
            // offsets start at 0
            offsetX = offsetY = 0;
            // coordinate starts at bottom right
            coordX = 700;
            coordY = 400;
            // fill tile images
            tileSheet = loadImage("obstacletiles.png");
            tiles = splitImage(tileSheet, 1, 2);
            this.renderLevel();
        // method to load the color values into an array
        public int[][] loadLevel()
            height = levelImage.getHeight();
            width = levelImage.getWidth();
            int levelValues[][] = new int[width][height];
            // fill array with color values layer by layer
            for (int y = 0; y < height; y++)
                for (int x = 0; x < width; x++)
                    levelValues[x][y] = levelImage.getRGB(x, y);
            return levelValues;
        // method to get the tile color from a given tile
        public int getTile(int x, int y)
            return levelTiles[x][y];
        // method to draw the current camera view of the level on the screen
        public void drawLevel(Graphics gr, int x, int y)
            gr.drawImage(cameraImage, x, y, null);
        // method to render the actual image before drawing it
        public void renderLevel()
            // keeps track of graphics coordinate
            int x, y;
            // keeps track of tile to draw
            int tileX, tileY;
            tileY = coordY;
            // draw all the tiles based on offsets, layer by layer
            for (y = offsetY; y < SCREEN_HEIGHT + offsetY; y += TILE_SIZE)
                tileX = coordX;
                for (x = offsetX; x < SCREEN_WIDTH + offsetX; x += TILE_SIZE)
                    // determine which tile to draw based on tile color in array
                    switch (this.getTile(tileX, tileY))
                        case SPACE_COLOR:
                            cameraG.drawImage(tiles[0], x, y, null);
                            break;
                        case WALL_COLOR:
                            cameraG.drawImage(tiles[1], x, y, null);
                            break;
                    tileX++;
            // steps to take in case of an offset
            if (offsetX > 0)
            if (offsetX < 0)
            if (offsetY < 0)
            if (offsetY > 0)
        // method to update the level's current position for the camera
        public void updateLevel(int input)
            switch (input)
                // up
                case 0:
                    break;
                // left
                case 1:
                    // update offset to the left if not too far left
                    if (coordX > 30)
                        offsetX--;
                    // if a tile has been moved, then offset becomes 0 and coordX is decreased
                    if (offsetX <= -TILE_SIZE)
                        offsetX = 0;
                        coordX--;
                    break;
                // right
                case 2:
                    // update offset to the right if not too far right
                    if (coordX < width - 30)
                        offsetX++;
                    // if a tile has been moved, then offset becomes 0 and coordX is increased
                    if (offsetX >= TILE_SIZE)
                        offsetX = 0;
                        coordX++;
                    break;
                // down
                case 3:
                    break;
                // jump
                case 4:
                    break;
        // method to simply load an image from a path
        public static BufferedImage loadImage(String ref)
            BufferedImage bimg = null;
            try
               bimg = ImageIO.read(new File(ref));
            catch (Exception e)
                e.printStackTrace();
            return bimg;
        // method to create a tile array for tile sets
        public static BufferedImage[] splitImage(BufferedImage img, int cols, int rows)
            int w = img.getWidth() / cols;
            int h = img.getHeight() / rows;
            int num = 0;
            BufferedImage imgs[] = new BufferedImage[w * h];
            for (int y = 0; y < rows; y++)
                for (int x = 0; x < cols; x++)
                    imgs[num] = new BufferedImage(w, h, img.getType());
                    Graphics2D g = imgs[num].createGraphics();
                    g.drawImage(img, 0, 0, w, h, w * x, h * y, w * x + w, h * y + h, null);
                    g.dispose();
                    num++;
            return imgs;
        // image-loading method that will also alpha the color key for each tile
        public static BufferedImage makeColorTransparent(String ref, int color)
            BufferedImage image = loadImage(ref);
            BufferedImage dimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = dimg.createGraphics();
            g.setComposite(AlphaComposite.Src);
            g.drawImage(image, null, 0, 0);
            g.dispose();
            for (int i = 0; i < dimg.getHeight(); i++)
                for (int j = 0; j < dimg.getWidth(); j++)
                    if (dimg.getRGB(j, i) == color)
                        dimg.setRGB(j, i, 0x8F1C1C);
            return dimg;
    }Sorry for the long post, but since there are several objects involved in what could be the error, I didn't want to leave anything out of this one. Help is greatly appreciated! Thank you guys very much.
    Colton
    Edited by: coltonoscopy on Oct 2, 2011 11:57 PM

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at LevelRenderer.paint(LevelRenderer.java:160)
    // method to draw the tiles on the screen
    public void paint(Graphics g)
    // draw the level and then the player
    myLevel.drawLevel(gr, 0, 0); 
    myPlayer.drawPlayer(gr, (SCREEN_WIDTH / 2) - TILE_SIZE / 2, (SCREEN_HEIGHT / 2) - TILE_SIZE);
    g.drawImage(buffer, 0, 0, null);
    }So one of those three lines is line 160, and whichever line it is, is dereferencing a null pointer. So one of 'myLevel', 'myPlayer', or 'g' is null. Probably not 'g' as you received it as a parameter from Swing. Pretty much cuts it down.
    There's nothing here you couldn't have worked out for yourself. The line number was all you needed.

  • I can't figure out why I'm getting a Null Pointer Exception

    I'm writing a program that calls Bingo numbers. I got that part of the program to work but when I started adding Swing I kept getting a Null Pointer Exception and I don't know how to fix it. The Exception happens on line 15 of class Panel (g = image.getGraphics();). Here is the code for my classes. I'm still not finished with the program and I can't finish it until I know that this issue is resolved.
    package Graphics;
    import java.awt.Graphics;
    import javax.swing.JFrame;
    public class DrawFrame extends JFrame{
         public Panel panel;
         public DrawFrame(int x, int y, String s) {
              super(s);
              this.setBounds(0, 0, x, y);
              this.setResizable(false);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setPreferredSize(getSize());
              panel = this.getPanel();
              this.getContentPane().add(panel);
              panel.init();
              this.setVisible(true);
         public Graphics getGraphicsEnvironment(){
              return panel.getGraphicsEnvironment();
         Panel getPanel(){
              return new Panel();
    package Graphics;
    import javax.swing.JPanel;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Image;
    public class Panel extends JPanel{
         Graphics g;
         Image image;
         public void init() {
              image = this.createImage(this.getWidth(), this.getHeight());
              g = image.getGraphics();
              g.setColor(Color.white);
              g.fillRect(0, 0, this.getWidth(), this.getHeight());
         Graphics getGraphicsEnvironment() {
              return g;
         public void paint(Graphics graph) {
              if (graph == null)
                   return;
              if (image == null) {
                   return;
              graph.drawImage(image, 0, 0, this);
    package Graphics;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    public class Keys extends KeyAdapter{
    public int keyPressed; //creates a variable keyPressed that stores an integer
    public void keyPressed(KeyEvent e) { //creates a KeyEvent from a KeyListner
              keyPressed = e.getKeyCode(); //gets the key from the keyboard
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.event.KeyEvent;
    import Graphics.*;
    public class Bingo {
         static Ball balls[][] = new Ball[5][15]; //creates a 2D 5 by 15 array
         public static void main(String[] args) {
              DrawFrame frame = new DrawFrame(1500, 500, "Welcome to the automated Bingo Caller."); //creates instance of DrawFrame that is 1000 pixels wide and 500 pixels high
              Graphics g = frame.getGraphicsEnvironment(); //calls the getGraphicsEnvironment method in the DrawFrame class
              Keys key = new Keys(); //creates instance of the Key class
              frame.addKeyListener(key); //adds a KeyListener called Key
              for (int x = 0; x < 5; x++) { //fills rows
                   for (int y = 0; y < 15; y++) { //fills columns
                        balls[x][y] = new Ball(x, y+1); //fills array
              frame.pack(); //adjusts the size of the frame so everything fits
              g.setColor(Color.black); //sets the font color to black
              g.setFont(new Font("MonoSpace", Font.PLAIN, 20)); //creates new font
              for(int y=0;y<balls.length;y++){ //draws all possible balls
                   g.drawString(balls[y][0].s, 0, y*100); //draws numbers
                   for(int x=0;x<balls[y].length;x++){ //draws all possible balls
                        g.drawString(balls[y][x].toString(), (x+1)*100, y*100); //draws letters
              do {
                   frame.repaint(); //repaints the balls when one is called
                   int x, y; //sets variables x and y as integers
                   boolean exit; //sets a boolean to the exit variable
                   do {
                        exit = false; //exit is set to false
                        x = (int)(Math.random() * 5); //picks a random number between 0 and 4 and stores it as x
                        y = (int)(Math.random() * 15); //picks a random number between 0 and 14 stores it as y
                        if (!balls[x][y].called) { //checks to see if a value is called
                             exit = true; //changes exit to true if it wasn't called
                             balls[x][y].called = true; //sets called in the Ball class to true if it wasn't called
                             System.out.println(balls[x][y]); //prints value
                   } while (!exit); //if exit is false, returns to top of loop
                   int count = 0; //sets a count for the number of balls called
                   for(int z=0;z<balls.length;z++){ //looks at balls
                        g.setColor(Color.black); //displays in black
                        g.drawString(balls[z][0].s, 0, z*100); //draws balls as a string
                        for(int a=0;a<balls[z].length;a++){ //looks at all balls
                             if (balls[z][a].called){ //if a ball is called
                                  g.setColor(Color.red); //change color to red
                                  count++; //increments count
                             } else {
                                  g.setColor(Color.black); //if it isn't called stay black
                             g.drawString(balls[z][a].toString(), (a+1)*100, y*100); //draws balls as string
                   do {
                        if (key.keyPressed == KeyEvent.VK_R||count==5*15) { //if R is pressed or count = 5*15
                             count=5*15; //changes count to 5*15
                             for(int z=0;z<balls.length;z++){ //recreates rows
                                  g.setColor(Color.black); //sets color to black
                                  g.drawString(balls[z][0].s, 0, z*100); //redraws rows
                                  for(int a=0;a<balls[z].length;a++){ //recreates columns
                                       balls[z][a] = new Ball(z, a+1); //fills array
                                       g.drawString(balls[z][a].toString(), (a+1)*100, z*100); //redraws columns
                   } while (key.keyPressed!=KeyEvent.VK_ENTER || count == 5 * 15); //determines if the key was pressed or counter is 5*15s
              } while (key.keyPressed == KeyEvent.VK_ENTER);
    public class Ball {
         String s; //initiates s that can store data type String
         int i; //initiates i that can store data as type integer
         boolean called = false; //initiates called as a boolean value and sets it to false
         public Ball(int x, int y) {
              i = (x * 15) + y; //stores number as i to be passed to be printed
              switch (x) { //based on x value chooses letter
              case 0:
                   s = "B";
                   break;
              case 1:
                   s = "I";
                   break;
              case 2:
                   s = "N";
                   break;
              case 3:
                   s = "G";
                   break;
              case 4:
                   s = "O";
         public String toString() { //overrides toString method, converts answer to String
              return s + " " + i; //returns to class bingo s and i
    }

    The javadoc of createImage() states that "The return value may be null if the component is not displayable."
    Not sure, but it may be that you need to call init() after this.setVisible(true).

  • Null pointer exception  in ISimpleTypeModifiable

    Hi
    I am trying to add values to dropdownbykey dynamically using this code:
    IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("PROCESS");
    ISimpleTypeModifiable processType = attributeInfo.getModifiableSimpleType();
    processType.setFieldLabel("PROCESS");
    IModifiableSimpleValueSet valueSet = processType.getSVServices().getModifiableSimpleValueSet();
    Code is giving null pointer exception in the following line:
    ISimpleTypeModifiable processType = attributeInfo.getModifiableSimpleType();
    How to Solve it.Its urgent.
    Points will be awarded.

    Actually the process is the attribute of  node within context.
    so i changed the code to:
      IWDAttributeInfo attributeInfo = wdContext.nodeAuditNode().getNodeInfo().getAttribute("PROCESS") ;
    ISimpleTypeModifiable processType = attributeInfo.getModifiableSimpleType();
    processType.setFieldLabel("PROCESS");
    IModifiableSimpleValueSet valueSet = processType.getSVServices().getModifiableSimpleValueSet();
    The second point is: we can't modify the data type of mapped attribute in view controller.
    So for that, we have to write that code in component controller.

  • Null Pointer Exception in Bursting Engine

    Hi, I am trying the example given in XDO 5.6.2. but i am getting null pointer exception. Any help appreciated.
    1. burstCtrl.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <DATA>
    <DEPTS>
    <DEPT>
    <DEPTNO>20</DEPTNO>
    <NAME>Accounting</NAME>
    <MANAGER_EMAIL>[email protected]</MANAGER_EMAIL>
    <EMPLOYEES>
    <EMPLOYEE>
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7902</MGR>
    <HIREDATE>1980-12-17T00:00:00.000-08:00</HIREDATE>
    <SAL>800</SAL>
    <DEPTNO>20</DEPTNO>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPNO>7566</EMPNO>
    <ENAME>JONES</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>1981-04-02T00:00:00.000-08:00</HIREDATE>
    <SAL>2975</SAL>
    <DEPTNO>20</DEPTNO>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    </EMPLOYEES>
    </DEPT>
    <DEPT>
    <DEPTNO>30</DEPTNO>
    <NAME>Sales</NAME>
    <MANAGER_EMAIL>[email protected]</MANAGER_EMAIL>
    <EMPLOYEES>
    <EMPLOYEE>
    <EMPNO>7788</EMPNO>
    <ENAME>SCOTT</ENAME>
    <JOB>ANALYST</JOB>
    <MGR>7566</MGR>
    <HIREDATE>1982-12-09T00:00:00.000-08:00</HIREDATE>
    <SAL>3000</SAL>
    <DEPTNO>20</DEPTNO>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPNO>7876</EMPNO>
    <ENAME>ADAMS</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7788</MGR>
    <HIREDATE>1983-01-12T00:00:00.000-08:00</HIREDATE>
    <SAL>1100</SAL>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    </EMPLOYEES>
    </DEPT>
    </DEPTS>
    </DATA>
    2. empData.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    <xapi:request
    select="/DATA/DEPTS/DEPT/EMPLOYEES/EMPLOYEE">
    <! - Burst on Customer element - >
    <xapi:delivery>
    <xapi:email server="xxx.server.com" port="25" from="[email protected]" reply-to=
    "">
    <xapi:message id="123" to="${EMAIL}"
    cc="[email protected]" attachment="true"
    subject="CustomerDetails">Please find the customer invoice as a attachment
    (Through Application).
    <! - Set the id for the delivery method - >
    <! - Use the Customer EMAIL element to email the document to the Customer - >
    </xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output-type="pdf" delivery="123">
    <!Specify the delivery method id to be used - >
    <xapi:template type="rtf"
    location="/home/lkkumar/Dept.rtf" />
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    3. BurstingTest.java
    import oracle.apps.xdo.batch.DocumentProcessor;
    import oracle.apps.xdo.batch.*;
    import oracle.apps.xdo.batch.object.*;
    import oracle.apps.xdo.delivery.*;
    import oracle.apps.xdo.delivery.smtp.*;
    import oracle.apps.xdo.*;
    import oracle.apps.xdo.oa.util.*;
    import java.util.*;
    import java.io.*;
    import java.io.InputStream;
    import oracle.apps.fnd.cp.request.*;
    public class BurstingTest
    public BurstingTest()
    try {
    DocumentProcessor dp = new DocumentProcessor
    ("/home/lkkumar/burstCtrl.xml","/home/lkkumar/empData.xml","/home/lkkumar");
    dp.process();
    } catch (Exception ex) {
              System.out.println(ex);
    ex.printStackTrace();
    } finally {
    public static void main(String[] args)
    BurstingTest burst1 = new BurstingTest();
    The program compiles fine. but when i execute it gives null pointer exception.
    (lkkumar) lkkumar- java BurstingTest
    java.lang.NullPointerException
    java.lang.NullPointerException
    at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:1313)
    at oracle.apps.xdo.batch.DocumentProcessor.process(DocumentProcessor.java:213)
    at BurstingTest.<init>(BurstingTest.java:19)
    at BurstingTest.main(BurstingTest.java:30)
    Message was edited by:
    user609950

    Any idea , why it failed ?
    were you able to resolve ??
    where did you deploy this java file ?
    how did you run this file ?

  • Null Pointer exception in Webshop

    Hi,
    We are facing a problem of null pointer exception in the webshop when opening the product details (only in case of handful of products and not for other products) from the hyperlink of the product in the basket.
    The product itself appears with short description as soon as we type the product ID in the basket along with price. Still, only for certain products, we always get the null pointer exception when opening the hyperlink of the product details.
    The logs of initial replication as well as delta replications later on do not indicate any errors during replication.
    These few products are no different from the rest that are OK in the webshop. The details in the product master is also no different.  I have tried delta replication multiple times and all of them have been successful. The trace at Unix level also did not help much.
    Can somebody help?
    Rgds
    Shankar

    Shankar
        Check the follwoing SAP Note : 970044
         Also try RESTARTing the Webshop application using Visual Admin.
    Thanks
    Jack
    <b>Allot points if my post helps !</b>

  • Null pointer exception in toString!

    Hi all,
    i am getting null pointer exception in toString method.Might be due to threads.Can i synchronize toString?
    The code snippent is as follows :
    @Override
    public String toString ()
    if (mSourceInfo != null)
    return "Source [Name=" + mSourceInfo.name + ", Description=" + mSourceInfo.description + ", Type=" + mSourceInfo.type + ", Path="
                        + ", Online=" + mSourceInfo.online + ", Acknowledged=" + mSourceInfo.acknowledged + ", Tags=" + mSourceInfo.tags
                        + ", Dimension:width=" + mSourceInfo.width + ", height=" + mSourceInfo.height + "SourceId=" + mSourceInfo.sourceId;
    else
    return "Source [Id=" + mObjectId + "]";
    }

    Sourav-Sipani wrote:
    Make the following change:No! Don't! Sorry to say that, but this suggestion is bullshit.
    1. there is no String constructor that takes any object.
    2. sourceInfo definitely is not a String!
    3. there is almost never a reason to use the String constructor that takes only a String (if you where trying to do that).
    The correct solution would look something like this:
    public String toString ()
         // Get a local copy of this object so that the
         // entire method is isolated from any changes
         // in the global object
         TypeOfSourceInfo tempSource = mSourceInfo;
         if (tempSource != null)
              return "Source [Name=" + tempSource.name + ", Description=" + tempSource.description + ", Type=" + tempSource.type + ", Path="
              + ", Online=" + tempSource.online + ", Acknowledged=" + tempSource.acknowledged + ", Tags=" + tempSource.tags
              + ", Dimension:width=" + tempSource.width + ", height=" + tempSource.height + "SourceId=" + tempSource.sourceId;
         else
              return "Source [Id=" + mObjectId + "]";
    }Btw, it seems that the type of mSourceInfo should have a toString, which you could simply call here. Your code seems to do stuff that that Class should be doing instead.

Maybe you are looking for