Problems in GETDETAIL

Hi, i have a problem with GETDETAIL...
I create a new method:
     public void showSelectedSyncBoDetalles(String syncKey, String syncBoName, HttpServletRequest request) {
          // + WELCOME_OVERVIEW_SYNCBONAMES;
          //          Fill Header Bean
          tableViewBean.setString(WELCOME_DETAIL_SYNCBOINSTANCE_START + syncKey);
          tcp = TableContentProvider.instance(syncBoName);
          Vector headerTableData =
               tcp.getTableWithSyncBoInstanceHeader(syncBoName, syncKey);
          tableViewBean.setTableContentAsLocalCopy(headerTableData);
          tableViewBean.setTableRows(headerTableData.size());
          tableViewBean.setTableColumns(tcp.getColumns());
          // Fill itemsBean with all item Tables
          String[] itemNames = tcp.getItemNamesInSyncBo(syncBoName);
          int itemCount = itemNames.length;
          int itemColumnCount;
          for (int itemNo = 0; itemNo < itemCount; itemNo++) {
               TableViewBean itemTableBean = new TableViewBean();
               String itemName = itemNames[itemNo];
               itemTableBean.setString(TABLE_HEADER_ITEM + itemName);
               Vector itemTableData =
                    tcp.getTableWithSyncBoInstanceItems(
                         syncBoName,
                         syncKey,
                         itemName);
               itemTableBean.setTableContentAsLocalCopy(itemTableData);
               itemTableBean.setTableRows(itemTableData.size());
               itemTableBean.setTableColumns(tcp.getColumns());
               syncBoItemsBean.addElement(itemTableBean);
          int itemTypeCount = syncBoItemsBean.size();
          for(int itemTypeNo=0; itemTypeNo < itemTypeCount; itemTypeNo++) {
            FV.bean.TableViewBean itemBean = (FV.bean.TableViewBean) syncBoItemsBean.elementAt(itemTypeNo);
            int itemColCount = itemBean.getTableColumns();
            int itemRowCount = itemBean.getTableRows();
            for(int row=1; row < itemRowCount; row++) {
                 tableViewBean.Cliente = itemBean.getTableContent(row, 1);
                 tableViewBean.Nombre = itemBean.getTableContent(row, 7);     
                 break;       
          String det1;
          det1 = "[";
          for(int row=1; row < itemRowCount; row++) {
               *String s = itemBean.getTableContent(row, 2);*
                    if (!(s.equals("SP")))
                         continue;
          det1 = det1 + "[";
          String value = itemBean.getTableContent(row, 11);
          det1 = det1 + "\'" + value.replace('\'',' ') + "\'" + ",";               
          value = itemBean.getTableContent(row, 9);
          det1 = det1 + "\'" + value.replace('\'',' ') + "\'" + ",";
          value = itemBean.getTableContent(row, 8);
          det1 = det1 + "\'" + value.replace('\'',' ') + "\'" + ",";
          value = itemBean.getTableContent(row, 21);
          det1 = det1 + "\'" + value.replace('\'',' ') + "\'" + ",";
          value = itemBean.getTableContent(row, 12);
          det1 = det1 + "\'" + value.replace('\'',' ') + "\'" + ",";
          value = itemBean.getTableContent(row, 13);
          det1 = det1 + "\'" + value.replace('\'',' ') + "\'";
            det1 = det1 + "],";
            det1 = det1 + "]";
          tableViewBean.det1 = det1;           
Appear the first row repeted "itemRowCount", why repeted the first row? Is wrong the code?
Thanks,
Edited by: Victor Capi on Mar 18, 2008 11:57 AM

Hi Victor,
   Did you make changes to the standard code in the method  tcp.getTableWithSyncBoInstanceItems.
Check this [Thread|items not appearing..;.It may Help you
Thanks & Regards
Veerabhadram

Similar Messages

  • Problem in creating a SyncBo for Purchase Order BAPIs

    Hello Everybody,
    I am trying to create a smart sync application for Purchase Orders.
    I have used standard bapis like BAPI_PO_GETDETAIL AND BAPI_PO_CREATE1.
    I have developed my own wrapper functions using these std bapis. For the PO creation i only plan to insert the necessary and mandatory data. The problem i face is that some of the tables in the create bapi which are mandatory for a PO creation are freezed in the SyncBo.
    Tables like POITEMX, POADDRDELIVERY, POSCHEDULE and structure POHEADERX are all required for the creation of a PO. Without this minimum data a PO cannot be created.
    After i have created the syncBo, on the mapping screen i can only see these tables under the create BAPI. But i am not able to perform the mapping of their fields. These are non-editable or i must say that they are freezed.
    And if i cannot map them then i cannot pass data for them from the client. Although i can do the mapping for the table PO_ITEM and the structure PO_HEADER.
    I hope i am able to expplain my problem. Kindly get back to me if i am not clear. Any sort of help is welcome.
    Thanking in advance,
    Saurabh.

    Hi Saurabh,
    Hope you are aware of the prerequisites for creating the BAPI Wrappers.
    If you want to insert some data into the Business Object, then you have to include
    GETLIST, GETDETAIL and CREATE Bapi Wrappers.
    I think in your case,
    You might not have mapped those fields in your GETLIST Bapi Wrapper.Just check whether you have mapped those fields that are necessary for PO creation in your GETLIST and GETDETAIL BApi wrapper mapping screen.
    Those fields you have mapped in the GETLIST and GETDETAIL BAPI wrappers will be visible (for selection - checkboxes will be editable) in the mapping screen for CREATE BAPI Wrapper.
    So first of all, you have to map fields there in the mapping screens for GETLIST and GETDETAIL Bapi Wrappers...
    check this thing...
    refer these links..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/introduction.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/bapi_wrapper_types.html
    In the second link, you can see one figure, which is explaining the things that are to be satisfied by the BAPI Wrappers for SyncBO creation...
    Let me know If you have doubts in the prerequisite section itself...
    Regards,
    Kishor Gopinathan

  • Problem displaying data in Crystal Viewer

    Hi,
    First time posting on here, so apologies if I've got the wrong thread....
    Currently developing an application that uses ASP, via a COM+ object to connect to SQL Server 2005 Db.  My problem is that since the users default printer might not be visible on the application server anymore, we have had to use a Crystal viewer on the front end to print.  To do this we have moved some code from the COM+ and placed it in an asp page. 
    This page then creates a connection and runs a stored procedure, putting the results of the query into a recordset.  This is then used to populate CrystalRuntime Application, Report and PageEngine objects.  This page #Includes the SmartViewerActiveX.asp file which then in turn calls rptserver.asp.
    The viewer is displayed on the screen, but with the fields displaying only the field types, no data from the Db is displayed.  I have no idea why and am at my wits end!!!   Can anyone give any advice or hints that I could investigate.  I've never used Crystal Viewer before and could do with any helpfull advice.   The SmartViewerActiveX.asp and rptserver.asp files have not been ameneded.  Do I need to do anything with the ttx files????
    Thanks in advance....
    Code of the originating asp page :-
    <object runat=server progid = Print.print id=objPrint></object>
    <object runat=server progid = com.session id=objSession></object>
    <object runat=server progid = com.login id=objLogin></object>
    <object runat=server progid = com.request id=objRequest></object>
    <!#INCLUDE FILE="gen_funcs.asp">
    <!#INCLUDE FILE="adovbs.inc">
    <%
         Dim rsSession
         Dim strUserID
         Dim iUserType
         Dim strSalutation1
         Dim strNewRequestASP
         Dim rsDetails     
         Dim varRetValue
         Dim Comm
         Dim Conn
         Dim ADORs
         Dim adoRS1
         Dim adoRS2
         Dim adoRS3
         Dim oApp
         Dim oRpt
         Dim oPageEngine
         strUserID = getWindowsLogIn
         'Retrieve Session Data from session object
         Set rsSession = objSession.GetDetails(strUserID)
         strSalutation = rsSession.Fields("login_data")
         iUserType = rsSession.Fields("user_type")
         Set rsSession = Nothing
         varRetValue = "true"
    If IsObject(session("oRpt")) then
         Set session("oRpt") = nothing
    End if 
    set Comm = Server.CreateObject("ADODB.Command")
    set Conn = Server.CreateObject("ADODB.Connection")
    set session("AdoRS") = Server.CreateObject("ADODB.Recordset")
    Comm.CommandTimeout=60
    mStr = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=DEV;Data Source=GBNBS1501;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=GBNBS0500;Use Encryption for Data=False;Tag with column collation when possible=False"
    mstr=replace(mstr, "Integrated Security=SSPI;","")
    Conn.Open Mstr & ";Trusted_Connection=no", "crystaluser", "crystalpassword"
    set Comm.ActiveConnection = Conn
    Comm.CommandText = "usp_get_customer_letter"
    Comm.CommandType = adCmdStoredProc
    Comm.Parameters.Append Comm.CreateParameter("@requestID", adBigInt, adParamInput, 8, Request.QueryString("RequestID"))
    set session("AdoRS") = Comm.Execute
    If Not IsObject (session("oApp")) Then                             
         set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
    End If
    If IsObject(session("oRpt")) then
         Set session("oRpt") = nothing
    End if
    'This "While/Wend" loop is used to determine the physical path (eg: C:\) to the
    'Crystal Report file by translating the URL virtual path (eg: http://Domain/Dir) 
    dim path
    Path = Request.ServerVariables("PATH_TRANSLATED")                    
    While (Right(Path, 1) <> "\" And Len(Path) <> 0)                     
    iLen = Len(Path) - 1                                                 
    Path = Left(Path, iLen)                                              
    Wend                                                                               
    path=path + "Reports\"
    set session("oRpt") = session("oApp").OpenReport(path & "Letter.rpt", 1) 
    session("oRpt").MorePrintEngineErrorMessages = False
    session("oRpt").EnableParameterPrompting = False
    session("oRpt").DiscardSavedData
    Set crDatabase = session("oRpt").Database
    Set crTables = crDatabase.Tables
    Set crTable = crTables.Item(1)
    crTable.SetPrivateData 3, session("AdoRS")
    on error resume next
         adoRS1 = objPrint.GetSubReportSuccessful(Request.QueryString("RequestID"))
         adoRS2 = objPrint.GetSubReportUnsuccessful(Request.QueryString("RequestID"))
            'This section adds subreport data for successful traces to the letter
         If adoRS1.EOF = False Then
                 Set crSections = session("oRpt").Sections
                  For x = 1 To crSections.Count
                      Set crSection = crSections(x)
                      Set crReportObjs = crSection.ReportObjects
                          For y = 1 To crReportObjs.Count
                              If crReportObjs.Item(y).Kind = crSubreportObject Then
                                  Set crSubreportObj = crReportObjs.Item(y)
                                  If crSubreportObj.Name = "Schemes" Or crSubreportObj.Name = "WelshSchemes" Then
                                      Set crSubreport = session("oRpt").OpenSubreport(crReportObjs(y).Name)
                                      crSubreport.DiscardSavedData
                                      Set crDatabase = crSubreport.Database
                                      Set crTables = crDatabase.Tables
                                      Set crTable = crTables.Item(1)
                                      crTable.SetPrivateData 3, adoRS1
                                  End If
                              End If
                          Next
                  Next
              End If
            'This section adds subreport data for unsuccessful traces to the letter
               If adoRS2.EOF = False Then
                 Set crSections = session("oRpt").Sections
                  For x = 1 To crSections.Count
                      Set crSection = crSections(x)
                      Set crReportObjs = crSection.ReportObjects
                          For y = 1 To crReportObjs.Count
                             If crReportObjs.Item(y).Kind = crSubreportObject Then
                                  Set crSubreportObj = crReportObjs.Item(y)
                                  If crSubreportObj.Name = "Unsuccessful_traces" Then
                                      Set crSubreport = oRpt.OpenSubreport(crReportObjs(y).Name)
                                      crSubreport.DiscardSavedData
                                      Set crDatabase = crSubreport.Database
                                      Set crTables = crDatabase.Tables
                                      Set crTable = crTables.Item(1)
                                      crTable.SetPrivateData 3, adoRS2
                                  End If
                              End If
                          Next
                  Next
              End If
    session("oRpt").ReadRecords
    If IsObject(session("oPageEngine")) Then                             
         set session("oPageEngine") = nothing
    End If
    set session("oPageEngine") = session("oRpt").PageEngine
    set Conn = nothing
    set Comm = nothing
    %>
    <!-- #include file="SmartViewerActiveX.asp" -->
    <%

    Here's the code...
    <object runat=server progid = Print.print id=objPrint></object>
    <object runat=server progid = com.session id=objSession></object>
    <object runat=server progid = com.login id=objLogin></object>
    <object runat=server progid = com.request id=objRequest></object>
    <!#INCLUDE FILE="gen_funcs.asp">
    <!#INCLUDE FILE="adovbs.inc">
    <%
         Dim rsSession
         Dim strUserID
         Dim iUserType
         Dim strSalutation1
         Dim strNewRequestASP
         Dim rsDetails     
         Dim varRetValue
         Dim Comm
         Dim Conn
         Dim ADORs
         Dim adoRS1
         Dim adoRS2
         Dim adoRS3
         Dim oApp
         Dim oRpt
         Dim oPageEngine
         strUserID = getWindowsLogIn
         'Retrieve Session Data from session object
         Set rsSession = objSession.GetDetails(strUserID)
         strSalutation = rsSession.Fields("login_data")
         iUserType = rsSession.Fields("user_type")
         Set rsSession = Nothing
         varRetValue = "true"
    If IsObject(session("oRpt")) then
         Set session("oRpt") = nothing
    End if 
    set Comm = Server.CreateObject("ADODB.Command")
    set Conn = Server.CreateObject("ADODB.Connection")
    set session("AdoRS") = Server.CreateObject("ADODB.Recordset")
    Comm.CommandTimeout=60
    mStr = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=DEV;Data Source=GBNBS1501;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=GBNBS0500;Use Encryption for Data=False;Tag with column collation when possible=False"
    mstr=replace(mstr, "Integrated Security=SSPI;","")
    Conn.Open Mstr & ";Trusted_Connection=no", "crystaluser", "crystalpassword"
    set Comm.ActiveConnection = Conn
    Comm.CommandText = "usp_get_customer_letter"
    Comm.CommandType = adCmdStoredProc
    Comm.Parameters.Append Comm.CreateParameter("@requestID", adBigInt, adParamInput, 8, Request.QueryString("RequestID"))
    set session("AdoRS") = Comm.Execute
    If Not IsObject (session("oApp")) Then                             
         set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
    End If
    If IsObject(session("oRpt")) then
         Set session("oRpt") = nothing
    End if
    'This "While/Wend" loop is used to determine the physical path (eg: C:\) to the
    'Crystal Report file by translating the URL virtual path (eg: http://Domain/Dir) 
    dim path
    Path = Request.ServerVariables("PATH_TRANSLATED")                    
    While (Right(Path, 1) <> "\" And Len(Path) <> 0)                     
    iLen = Len(Path) - 1                                                 
    Path = Left(Path, iLen)                                              
    Wend                                                                               
    path=path + "Reports\"
    set session("oRpt") = session("oApp").OpenReport(path & "Letter.rpt", 1) 
    session("oRpt").MorePrintEngineErrorMessages = False
    session("oRpt").EnableParameterPrompting = False
    session("oRpt").DiscardSavedData
    Set crDatabase = session("oRpt").Database
    Set crTables = crDatabase.Tables
    Set crTable = crTables.Item(1)
    crTable.SetPrivateData 3, session("AdoRS")
    on error resume next
         adoRS1 = objPrint.GetSubReportSuccessful(Request.QueryString("RequestID"))
         adoRS2 = objPrint.GetSubReportUnsuccessful(Request.QueryString("RequestID"))
            'This section adds subreport data for successful traces to the letter
            If adoRS1.EOF = False Then
                 Set crSections = session("oRpt").Sections
                  For x = 1 To crSections.Count
                      Set crSection = crSections(x)
                      Set crReportObjs = crSection.ReportObjects
                          For y = 1 To crReportObjs.Count
                              If crReportObjs.Item(y).Kind = crSubreportObject Then
                                  Set crSubreportObj = crReportObjs.Item(y)
                                  If crSubreportObj.Name = "Schemes" Or crSubreportObj.Name = "WelshSchemes" Then
                                      Set crSubreport = session("oRpt").OpenSubreport(crReportObjs(y).Name)
                                      crSubreport.DiscardSavedData
                                      Set crDatabase = crSubreport.Database
                                      Set crTables = crDatabase.Tables
                                      Set crTable = crTables.Item(1)
                                      crTable.SetPrivateData 3, adoRS1
                                  End If
                              End If
                          Next
                  Next
              End If
            'This section adds subreport data for unsuccessful traces to the letter
               If adoRS2.EOF = False Then
                 Set crSections = session("oRpt").Sections
                  For x = 1 To crSections.Count
                      Set crSection = crSections(x)
                      Set crReportObjs = crSection.ReportObjects
                          For y = 1 To crReportObjs.Count
                             If crReportObjs.Item(y).Kind = crSubreportObject Then
                                  Set crSubreportObj = crReportObjs.Item(y)
                                  If crSubreportObj.Name = "Unsuccessful_traces" Then
                                      Set crSubreport = oRpt.OpenSubreport(crReportObjs(y).Name)
                                      crSubreport.DiscardSavedData
                                      Set crDatabase = crSubreport.Database
                                      Set crTables = crDatabase.Tables
                                      Set crTable = crTables.Item(1)
                                      crTable.SetPrivateData 3, adoRS2
                                  End If
                              End If
                          Next
                  Next
              End If
    session("oRpt").ReadRecords
    If IsObject(session("oPageEngine")) Then                             
         set session("oPageEngine") = nothing
    End If
    set session("oPageEngine") = session("oRpt").PageEngine
    set Conn = nothing
    set Comm = nothing
    %>
    <!-- #include file="SmartViewerActiveX.asp" -->
    <%

  • Trouble Calling InspectionLot.GetDetail from Visual Basic 6.0

    I am having difficulty trying to retrieve data from the InspectionLot object in SAP using VB and the SAP ActiveX Control.  We are on SAP ECC6.  I've successfully called the InspectionLot.GetList BAPI, but am struggeling with the GetDetail.
    Here is my code after I have successfully logged into SAP.  My problem seems to revolve around the Dimas method.
    Dim oBAPICtrl As Object
    Dim objInspLotDetail As Object
    Dim objUsageDecisionData As Object
    Dim objSystemStatus As Object
    Set oBAPICtrl = CreateObject("SAP.BAPI.1")
    Set objInspLotDetail = oBAPICtrl.GetSAPObject("InspectionLot", "090000093993")
    After calling this DimAs function objUsageDecisionData is equal to Error 0
    Set objUsageDecisionData = oBAPICtrl.DimAs(objInspLotDetail, "GetDetail", "UsageDecisionData")
    After calling this DimAs function objSystemStatus is equal to a data structure as expected
    Set objSystemStatus = oBAPICtrl.DimAs(objInspLotDetail, "GetDetail", "SystemStatus")
    The next call returns 4 rows into the objSystemStatus data structure, but obviously nothing into objUsageDecisionData
    objInspLotDetail.GetDetail UsageDecisionData:=objUsageDecisionData, _
                               SystemStatus:=objSystemStatus
    'Note: I can see in the BAPI Explorer that the UsageDecisionData is not marked as a table, but it returns fields in a table like structure.  How do I get these values?
    Thank you for any assistance you can provide.
    Regards,
    Paul
    p.s. Is this the correct forum to post this question?
    Edited by: Paul Murray on Oct 15, 2009 10:13 PM
    Edited by: Paul Murray on Oct 16, 2009 7:20 PM

    My mistake, it was returning a structure, just a different type that I couldn't read with the VB IDE Variable Watch utility.

  • Stuck with problems and no help

    hi,
    We are stuck with the following set of problems. Repeated entries to this forum have not fetced any response. If anybody can help us on any of these issues, please reply -
    1. We are not able to define any custom validator. We made our own validator that extends CompareValidor, but when we try to apply this rule to an attribute in the validation tab, we get the error - "no properties defined". Do i need to do something else besides creating a new class that extends CompareValidator and then writing my own code in the vlaidate method.
    2. While deploying our jspApplication on java web server, we are getting the message "error - null". The details are as mentioned in the Topic 'can anyone help!!!' that has been posted by Prabhdeep ().
    3. I have two tables, Customer and address. There is no FK between them (there cannot be because address is shared between many entities). In the address, i have 2 fields, BpType and BpId. BpType will contain 'C' to identity that this address is for a customer and id will have the customer id. In jdev 3.1, i have created entity and view objects for the 2 tables. also, i have made a view link. i need to put the condition Address.bpid = customer.customeid and address.bptype = 'c'. but it is not letting me put the second part of the condition. the chk on id works fine. as soon as i add a chk on type and test the application module, then while insertion of address i get the following error - "set method for BpType cannot be resolved".
    4. I have made a jsp appl based on bc4j. now, i need to put a check on any entity in such a manner that if the check fails, my jsp should ask the user that an exception is occuring and does he want to save even with the exceptional data. if he says yes, i want that the same entity should now save the data without giving an exception. How do i achieve this interaction between my entity and my jsp.
    Thanks a lot for any help,
    Aparna.

    I will answer Question #3:
    I'm not sure if I understand exactly what is
    happening. At first I thought you meant that you couldn't even add the second part of the association clause. But, later it sounds like you were able to add the second part of the clause (namely "address.bptype =
    'c'") and that you are experiencing some runtime error.
    Assuming the latter (that it is a RT problem), I take it this
    "...cannot be resolved" error is the error with code 27020.
    Under normal error conditions, you shouldn't get this error. Something "unusual" (or unforeseen by us) is happening if you are getting this error. Anyway, if you wrote your own client code, you should wrap a try/catch block around it, pick out the detail exception, and see what's going
    on. See the example code below:
    try
    ... make call that causes the exception ...
    catch(oracle.jbo.AttrSetValException ex)
    // Print stack trace for the outer ex
    ex.printStackTrace();
    // Get the inner exception
    Object[] details = ex.getDetails();
    if (details.length > 0)
    Exception innerEx = (Exception) details[0];
    // Now, print the inner exception's
    // stack.
    innerEx.printStackTrace();
    This will help shed some light on the exception and the cause of it.
    John - JDeveloper Team

  • Problem in connecting to Access Database.

    Hi,
         I am new to this Java/JSP Concepts. I am using IBM Websphere Studio(Application Developer 5.1.2). I am facing a problem to connect to the Access database. I have written a java file to connect to the Access Database. When i compile my java code and run it. It was working fine and i am able to insert into the Access database.The java file is working fine without errors. But when i create an object in the jsp and called the methods through that object i am getting "java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver", "java.sql.SQLException: No suitable driver", "java.lang.NullPointerExceptionexceptions" exceptions.
    Please help me in solving the problem.
         My Java code is :
    package myPack;
    import javax.sql.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class DB_Connect {
         private Connection con;
         private Driver driver;
         //private String connectStr ="jdbc:odbc:MS Access Database;DBQ=C:\\Movie_Club.mdb";
         public void initialiseDrivers(){
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   System.out.println("driver found");
              catch (ClassNotFoundException e){
                   e.printStackTrace();
                   System.out.println("driver not found");
              try{
                   con = DriverManager.getConnection("jdbc:odbc:MS Access Database;DBQ=C:\\Movie_Club.mdb","","");
                   System.out.println("database found");
    //"jdbc:odbc:MS Access Database;DBQ=C:\\156761\\Movie_Club.mdb");
    //"jdbc:odbc:MC","",""); I have tried with both of them they are working.
              catch (SQLException ce){
                   ce.printStackTrace();
                   System.out.println("database not found");
         public int insertDB(String empno, String empname, String action, String adventure, String animation, String comedy, String horror, String romantic, String thriller, String sci_fic) throws SQLException {
              int i=0;
              Statement stmt = null;
              try {
                   if(!con.equals(null))
              stmt = con.createStatement();
              i = stmt.executeUpdate("insert into Movie_Flavour values("+empno+","+empname+","+action+","+adventure+","+animation+","+comedy+","+horror+","+romantic+","+thriller+","+sci_fic+")");
              stmt.close();
              con.close();
                   else
                   System.out.println("con not made");
              catch (java.sql.SQLException exception) {
              exception.printStackTrace();
              return i;
         public ResultSet getDetails(){
              Statement stmt = null;
              ResultSet rs = null;
              try{
                   stmt = con.createStatement();
                   rs = stmt.executeQuery("select * from Movie_Flavour where empno = 1");
              catch(Exception e){
                   e.printStackTrace();
              return rs;
         public static void main(String[] args) {
              int i=0;
              DB_Connect db = new DB_Connect();
              try{
                   db.initialiseDrivers();
                   i = db.insertDB("1","2","3","4","5","6","7","8","9","10");
                   System.out.println(i);
              catch(Exception e){
                   e.printStackTrace();
    and my JSP code is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <%@ page import="myPack.DB_Connect" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="javax.sql.*" %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <TITLE>User_Input</TITLE>
    </HEAD>
    <BODY>
    <%
         DB_Connect db = new DB_Connect();
         try
              db.initialiseDrivers();
              db.insertDB("1","1","1","1","1","1","1","1","1","1");
         catch(Exception e)
              e.printStackTrace();
    %>
    </BODY>
    </HTML>
    Websphere shows the following messages in the console.
    [3/1/06 16:35:27:986 IST] 57687dab WebGroup I SRVE0180I: [RTSC_MCWeb] [RTSC_MCWeb] [Servlet.LOG]: /User_Input.jsp: init
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:390)
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:300)
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at java.lang.Class.forName1(Native Method)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at java.lang.Class.forName(Class.java(Compiled Code))
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at myPack.DB_Connect.initialiseDrivers(DB_Connect.java:28)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at org.apache.jsp._User_5F_Input._jspService(_User_5F_Input.java:126)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)[3/1/06 16:35:28:111 IST] 57687dab SystemOut O driver not found
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R java.sql.SQLException: No suitable driver
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at java.sql.DriverManager.getConnection(DriverManager.java:558)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at java.sql.DriverManager.getConnection(DriverManager.java:188)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at myPack.DB_Connect.initialiseDrivers(DB_Connect.java:38)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at org.apache.jsp._User_5F_Input._jspService(_User_5F_Input.java:126)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    [3/1/06 16:35:28:127 IST] 57687dab SystemOut O database not found
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R java.lang.NullPointerException
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at myPack.DB_Connect.insertDB(DB_Connect.java:54)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at org.apache.jsp._User_5F_Input._jspService(_User_5F_Input.java:127)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)

    Check if the OdbcDriver is in the classpath

  • Problems with JBO errors displaying when using custom insert VO methods

    Hi!
    I have a problem I hope I can explain :).
    I have a VO that has custom execute and insert methods implemented in application module.
      public void executeWithParamsMyViewG(String asID)
        // find the view
        MyViewImpl loMyViewImpl =
          getMyViewG();
        loMyViewImpl.setNamedWhereClauseParam("IDParm", asID);
        // execute the querry
        loMyViewImpl.executeQuery();
      public void insertRow(String asID)
        MyViewImpl loMyViewImpl =
          getMyViewG();
        // create new row
        Row loRow = loMyViewImpl.createRow();
        // set fields in new row
        loRow.setAttribute("ID", asID);
        loRow.setAttribute("MyAttribute", "A");
        loRow.setAttribute("MyAttribute2",
                           afContext.getProcessScope().get("MyParm"));
        // insert new row
        loMyViewImpl.insertRow(loRow);
      }I have custom error handler with
        public void reportException(DCBindingContainer bc, Exception ex) {
           //Force JboException's reported to the binding layer to avoid
           //printing out the JBO-XXXXX product prefix and code.
          disableAppendCodes(ex);
          super.reportException(bc, ex);
        private void disableAppendCodes(Exception ex) {
          if (ex instanceof JboException) {
            JboException jboEx = (JboException) ex;
           jboEx.setAppendCodes(false);
            Object[] detailExceptions = jboEx.getDetails();
            if ((detailExceptions != null) && (detailExceptions.length > 0)) {
              for (int z = 0, numEx = detailExceptions.length; z < numEx; z++) {
                disableAppendCodes((Exception) detailExceptions[z]);
        }I also have custom phase listener and page lifecycle but without any 'important' methods overridden.
    Than I have a jspx with af:processChoiceBar for navigation, Create button binded to insertRow method, commit and rollback buttons and form with input fields. One of them is required, but with validation on server side, not on client side (showRequired instead of required).
    My problem is this:
    If I add an empty row, leave all the fields blank and try to commit I get required field message, which is OK. But if I use af:processChoiceBar (previous page, next page, select any of the pages), the message is not displayed. The message is displayed after when I try to return to this page. If I debug the exception in reportException method has the code 27024 for DeferredRowValidationException, not the required attribute error which is displayed.
    Can anyone help me with this please, I've wasted a lot of time on this now.
    Regards!
    BB

    Hi,
    Does anyone know why this would not be working. It's really irritating!

  • Problem with applying filter?

    Hello All,
      I am facing problem with filter.
      I am developing a smart sunc application using
      following BAPIs.
           GetList          MEREP_CONTACT_GETLIST        
           GetDetail        MEREP_CONTACT_GETDETAIL      
           Create           MEREP_CONTACT_CREATE         
           Modify           MEREP_CONTACT_MODIFY         
           Delete           MEREP_CONTACT_DELETE         
      I am using person number as filtering criteria.
      When i use emulator then it works properly.
      But at the MI client it does not seem to be working
      as all records are getting downloaded.
      Can anyone help me in this?
      Thanks in advacne.

    Hello Kishor,
    I am now getting following exceptions.
    [20060713 09:38:45:281] E [MI/Smartsync             ] Error while Smart Sync inbound processing: java.lang.IllegalStateException: No field available :ReusableFieldDescriptorIt [rowDescriptor=cZCONTACTSB_010, index=3]
    java.lang.IllegalStateException: No field available :ReusableFieldDescriptorIt [rowDescriptor=cZCONTACTSB_010, index=3]
         at com.sap.ip.me.smartsync.syncIn.processors.InternalRowProcessor.setNextFieldWithWriter(InternalRowProcessor.java:138)
         at com.sap.ip.me.smartsync.syncIn.processors.RowProcessorManager$RowProcessorDispatcher.setNextField(RowProcessorManager.java:409)
         at com.sap.ip.me.smartsync.syncIn.SaxSyncInProcessor$4.characters(SaxSyncInProcessor.java:730)
         at com.sap.ip.me.xmlParser.MIXMLEventHandlerManager.characters(MIXMLEventHandlerManager.java:72)
         at com.sap.ip.me.xmlParser.MIXMLParser.sendCharacters(MIXMLParser.java:263)
         at com.sap.ip.me.xmlParser.MIXMLParser.parse(MIXMLParser.java:158)
         at com.sap.ip.me.smartsync.syncIn.SaxSyncInProcessor.processSyncInMessage(SaxSyncInProcessor.java:87)
         at com.sap.ip.me.smartsync.syncIn.SyncInRuntimeImpl.processSyncInMessage(SyncInRuntimeImpl.java:250)
         at com.sap.ip.me.smartsync.core.SmartSyncRuntimeImpl.process(SmartSyncRuntimeImpl.java:344)
         at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.process(SmartSyncRuntimeManager.java:214)
         at com.sap.ip.me.smartsync.core.SyncAdapter.process(SyncAdapter.java:56)
         at com.sap.ip.me.sync.SyncManagerImpl.processSingleContainer(SyncManagerImpl.java:160)
         at com.sap.ip.me.sync.SyncManagerMerger.processInboundContainers(SyncManagerMerger.java:166)
         at com.sap.ip.me.sync.SyncManagerImpl.processSyncCycle(SyncManagerImpl.java:709)
         at com.sap.ip.me.sync.SyncManagerImpl.syncForUser(SyncManagerImpl.java:1142)
         at com.sap.ip.me.sync.SyncManagerImpl.processSynchronization(SyncManagerImpl.java:774)
         at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:402)
         at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:285)
         at com.sap.ip.me.api.sync.SyncManager.synchronizeWithBackend(SyncManager.java:79)
         at com.sap.ip.me.apps.jsp.Home$SyncRunnable.run(Home.java:447)
         at java.lang.Thread.run(Thread.java:534)
    regards,
    Abhijit

  • Problems getting Operations on Device Mobile

    Hi!
    Can anyone help me with the following problem ???
    We do not get any operation on Orders and notifications on a Device Mobile.
    Thanks you
    ========================================
    Have you done the configuration for the operations in SPRO? In the moment the order gets to the device, the operation should come down as well - at least this is the case in my backend system here. Well, but there is a configuration necessary to send this data at all: Go to SPRO and digg down to MAM setup.
    Open the Point "Determine Order Processing". Select the Order Profile you use on the right side and then select on the left page:
    OrderTypeProfile -> OrderTypeDetail
    The screen opens and gives you some ticks. Check if the tick for "Add Op(eration)" is set. I guess this is not the case in your setup.
    Hope this helps! If not - well, then I need to check further from here. But this was all I did in that system to get operations down to the device - at least that was all I remember.
    Regards,
    Oliver
    ========================================
    Hi Oliver!
    We did follow your recommendation but we still can not see any information on the PDA.
    Best Regards,
    =====================================
    Hi Xiamora,
    well - this is strange!
    If you run  the getdetail hander for MAM001, what does it tell you?
    Regards,
    Oliver
    =======================================
    Hi! Oliver
    I did run SE37 --> MAM25_001_GETDETAIL.
    I did type  USER working on the PDA
    I did type  order on the PDA and I can see the all operations of this order witf the GETDETAIL fucntion.
    What should I check in addition ?
    Thank you very much
    Xiomara

    Hi Xiamora,
    well, the problem is the following: data is missing..... Well, you ask me now what this answer is for, cause you already know that you have no operations, but the problem is not the operation as such:
    Operation is send down in MAM001Item070 if I am correct. From there we have a link to MAM030, MAM031 and MAM010. So if your Operation does not show up, please check first if the related Notification is on the device. Furthermore please check if the Functional Location and Equipment is on the device as well. I expect that one or more of this is missing. For an initial test I would create an order with operations that do not link any deeper. If these coe down immediately we know that we are on the correct treack - if these will not come down - please check
    MEREP_RDB_S01_GET
    Scenario is the name of the Order SyncBO (001) and the Mobile ID is the one of your device. Check the dataset if it is complete.
    Hope this helps to get you any frther!
    Regards,
    Oliver

  • Touch ID - Biometric reader with problems and no solutions

    I have an Iphone 5s Model 1457, after upgraded to iOS version 7.1.2 the biometric reader stopped working. I upgraded to IOS 8.0.2 and continues in the same situation. Already reset all settings and not solved. What should I do? Does the apple can solve this problem for your client?

    I will answer Question #3:
    I'm not sure if I understand exactly what is
    happening. At first I thought you meant that you couldn't even add the second part of the association clause. But, later it sounds like you were able to add the second part of the clause (namely "address.bptype =
    'c'") and that you are experiencing some runtime error.
    Assuming the latter (that it is a RT problem), I take it this
    "...cannot be resolved" error is the error with code 27020.
    Under normal error conditions, you shouldn't get this error. Something "unusual" (or unforeseen by us) is happening if you are getting this error. Anyway, if you wrote your own client code, you should wrap a try/catch block around it, pick out the detail exception, and see what's going
    on. See the example code below:
    try
    ... make call that causes the exception ...
    catch(oracle.jbo.AttrSetValException ex)
    // Print stack trace for the outer ex
    ex.printStackTrace();
    // Get the inner exception
    Object[] details = ex.getDetails();
    if (details.length > 0)
    Exception innerEx = (Exception) details[0];
    // Now, print the inner exception's
    // stack.
    innerEx.printStackTrace();
    This will help shed some light on the exception and the cause of it.
    John - JDeveloper Team

  • Big Problem in Applet-Servlet Communication-(Help)

    I wrote an method to send serialized objects from Applet to Servlet,
    the method is as following:
    private ObjectInputStream postObjects (URL servlet, Serializable objs[], String sessionID) throws Exception {
    ObjectInputStream in = null;
    ObjectOutputStream out = null;
    try{
    URLConnection con = servlet.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type","application/x-java-serialized-object");
    con.setAllowUserInteraction(false);
    con.setRequestProperty("Cookie", sessionID);
    out = new ObjectOutputStream(con.getOutputStream());
    int numObjects = objs.length;
    for(int x = 0; x < numObjects; x++){
    out.writeObject(objs[x]);
    out.flush();
    out.close();
    in = new ObjectInputStream(con.getInputStream());
    }catch(Exception e){
    e.printStackTrace(System.err);
    throw e;
    }finally{
    return in;
    when I call this method, I got the following error message in Applet console,
    my platform is Salaris 5.8 + iPlanet 6.0.
    java.io.EOFException
         at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2150)
         at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2619)
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:726)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:251)
         at com.shinewave.lms.core.client.ServletProxy.postObjects(ServletProxy.java:255)
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:76)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    java.lang.NullPointerException
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:77)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    java.lang.NullPointerException
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:82)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    Please help me to solve this problem, thank you very much.

    Hi..
    Sorry abt this. But I was hoping if u could help out on this..
    I am trying to implement a applet to servlet communication...
    wherin the servlet would read data from the database... and send it back to the applet which gets displayed on the applet...
    But the problem is that the applet is not able to establish a connection with the servlet..
    I am also using another supportive class whose object is basically passed from the servlet to the applet..
    could u help me..
    below is the piece of code...
    APPLET:
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class TestApplet extends JApplet implements ActionListener
         JButton btnLoad;
         JTextField tfEmpno, tfFname, tfLname, tfSalary;
         URL url;
    private String webServerStr = null;
    private String hostName = "sandy";
    private int port = 8085;
    private String servletPath = "/jdbcTest.DBDetailsServlet";     
    public TestApplet()
         super();
    // suppress Warning Message
    getRootPane().putClientProperty"defeatSystemEventQueueCheck",Boolean.TRUE);
         public void actionPerformed(ActionEvent ae)
              if(btnLoad.getText().equals("Load"))
                   if(loadData())
                        btnLoad.setText("Save");
              else
                   btnLoad.setText("Load");
    //               saveData();
         public void init()
              setBackground(Color.pink);
              tfEmpno = new JTextField(10);
              tfFname = new JTextField(10);
              tfLname = new JTextField(10);
              tfSalary= new JTextField(10);
              JPanel panel = new JPanel();
              panel.setLayout(new FlowLayout());
              panel.add(tfEmpno);
              panel.add(tfFname);
              panel.add(tfLname);
              panel.add(tfSalary);
              getContentPane().add(panel, BorderLayout.CENTER);
              JPanel bottom = new JPanel(new FlowLayout());
              btnLoad = new JButton("Load");
              btnLoad.addActionListener(this);
              bottom.add(btnLoad);
              getContentPane().add(bottom, BorderLayout.SOUTH);
         public boolean loadData()
              try
         System.out.println("Web Server host name: " + hostName);
         webServerStr = "http://" + hostName + ":" + port + servletPath;
         System.out.println("Web String full = " + webServerStr);
                   String servletGET = webServerStr + "?"
         + URLEncoder.encode("UserOption") + "="
         + URLEncoder.encode("AppletDisplay");     
    //               url = new URL(getCodeBase(),"http://sandy:8080/servlet/jdbcTest.DBDetailsServlet");
                   System.out.println("Complete Servlet Url => " + servletGET);
                   url = new URL(servletGET);
                   URLConnection con = url.openConnection();
                   con.setUseCaches(false); // Turn off caching.
                   InputStream in = con.getInputStream();
                   System.out.println("\nsuccess ....... con.getInputStream() ");
                   ObjectInputStream ois = new ObjectInputStream(in);
                   System.out.println("\nsuccess ....... new ObjectInputStream(in) ");
                   Object object = ois.readObject();
                   System.out.println("\nGot the object from servlet...");
                   if(object != null)
                        System.out.println("\nObject NOT null ...");
                        ArrayList result = (ArrayList) object;
                        jdbcTest.EmployeeValue empval = (jdbcTest.EmployeeValue) result.get(0);
                        tfEmpno.setText(""+empval.getEmp_no());
                        tfFname.setText(empval.getFname());
                        tfLname.setText(empval.getLname());
                        tfSalary.setText(""+empval.getSalary());
                        System.out.println("\nObject processed " + result);
                        repaint();
                   return true;
              catch(Exception e)
                   e.printStackTrace();
                   System.out.println("\n\n loadData()=> E X C E P T I O N : " + e + "\n");
                   return false;               
         public void saveData()
              //yet to be implemented..
    SERVLEt:
    package jdbcTest;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DBDetailsServlet extends HttpServlet
         public void doGet(HttpServletRequest req,HttpServletResponse res )throws ServletException, IOException
              System.out.println("\nInside the doGet()\n");
              ArrayList results = getDetails();
              ObjectOutputStream oos = new ObjectOutputStream(res.getOutputStream());
              oos.writeObject(results);
         public void doPost(HttpServletRequest req,HttpServletResponse res )throws ServletException, IOException
              System.out.println("\nInside the doPost()\n");
              doGet(req,res);
         public ArrayList getDetails()
              try
                   System.out.println("\nServlet : inside GetDetails...");
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:odbc:SandyDSN","","");
                   java.sql.Statement stmt = con.createStatement();
                   System.out.println("\n Statement created..");
                   java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM EMP WHERE EMP_NO = 222");
                   System.out.println("\n Query Executed...");
                   ArrayList results = new ArrayList();
                   while(rs.next())
                        EmployeeValue empval = new EmployeeValue();
                        empval.setEmp_no(rs.getLong("EMP_NO"));
                        empval.setFname(rs.getString("FNAME"));
                        empval.setLname(rs.getString("LNAME"));
                        empval.setSalary(rs.getLong("SALARY"));
                        results.add(empval);
                   System.out.println("\n Resultset Obtained...");
                   stmt.close();
                   con.close();
                   return results;
              catch(Exception e)
                   System.out.println("Error while retreiving details....." + e);
                   return null;
         public boolean saveDetails(EmployeeValue empval)
              try
                   return true;
              catch(Exception e)
                   System.out.println("Error while updating details....." + e);
                   return false;
    The utility class EMployeeValue is as below:
    package jdbcTest;
    import java.io.*;
    class EmployeeValue implements Serializable
         private long emp_no;
         private String fname;
         private String lname;
         private long salary;
         public EmployeeValue()
              super();
         public EmployeeValue(long eno, String fn, String ln,long sal)
              super();
              setEmp_no(eno);
              setFname(fn);
              setLname(ln);
              setSalary(sal);
         public long getEmp_no()
              return emp_no;
         public java.lang.String getFname()
              return fname;
         public java.lang.String getLname()
              return lname;
         public long getSalary()
              return salary;
         public void setEmp_no(long newEmp_no)
              emp_no = newEmp_no;
         public void setFname(java.lang.String newFname)
              fname = newFname;
         public void setLname(java.lang.String newLname)
              lname = newLname;
         public void setSalary(long newSalary)
              salary = newSalary;

  • Problem in creating Jtree instance when X server is down

    I am facing this problem while trying to build JTree object when X Server is down
    I am using Redhat 8 and jdk1.3.1
    Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified
    Problem creating javax.swing.plaf.metal.MetalLookAndFeel with method getSystemTextFont and args { : java.lang.reflec
    java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Thread.java:993)
    at javax.swing.UIDefaults$ProxyLazyValue.createValue(UIDefaults.java:670)
    at javax.swing.UIDefaults.get(UIDefaults.java:145)
    at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:46)
    at javax.swing.UIDefaults.getFont(UIDefaults.java:223)
    at javax.swing.UIManager.getFont(UIManager.java:456)
    at javax.swing.plaf.basic.BasicTreeUI.installDefaults(BasicTreeUI.java:5Xlib: No protocol specified
    Problem creating javax.swing.plaf.metal.MetalLookAndFeel with method getSystemTextFont and args { : java.lang.reflec
    java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Thread.java:993)
    at javax.swing.UIDefaults$ProxyLazyValue.createValue(UIDefaults.java:670)
    at javax.swing.UIDefaults.get(UIDefaults.java:145)
    at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:46)
    at javax.swing.UIDefaults.getFont(UIDefaults.java:223)
    at javax.swing.UIManager.getFont(UIManager.java:456)
    at javax.swing.plaf.basic.BasicTreeUI.installDefaults(BasicTreeUI.java:591)
    at javax.swing.plaf.basic.BasicTreeUI.installUI(BasicTreeUI.java:525)
    at javax.swing.plaf.metal.MetalTreeUI.installUI(MetalTreeUI.java:83)
    at javax.swing.JComponent.setUI(JComponent.java:322)
    at javax.swing.JTree.setUI(JTree.java:537)
    at javax.swing.JTree.updateUI(JTree.java:553)
    at javax.swing.JTree.<init>(JTree.java:513)
    at javax.swing.JTree.<init>(JTree.java:489)
    at javax.swing.JTree.<init>(JTree.java:472)
    at com.cygnet.constel.cygSdk.cygJS.CygTree.<init>(CygTree.java:15)
    at com.cygnet.constel.cservs.cygManageIpInit.StringCreator.getDetails(StringCreator.java:54)
    SampleTree.java Source code .
    import javax.swing.tree.* ;
    import javax.swing.* ;
    public class SampleTree extends JTree
         public SampleTree() {
              super() ;
         public SampleTree( Object[] value ) {
              super( value ) ;
         public SampleTree( TreeModel newModel ) {
              super( newModel ) ;
    this is the line creating problem
    when my class is trying to call super( root )
         public SampleTree( TreeNode root ) {
              super( root ) ;
         public SampleTree( TreeNode root, boolean asksAllowsChildren ) {
              super( root , asksAllowsChildren ) ;
    NOTE : when i log in to X server JTree object gets constructed properly
    My requirment is it should also get constructed properly , even if X is down.
    i tried hard and i am frusted
    any help is appreciated
    thank in advance
    -- Nilesh

    thanks thomas for your reply
    but i think , we need to find out the point where it actually gets environment settings
    there must be 2 things done before creation is done.
    1]
    Actual Construction of the Tree
    2]
    then getting look and feel of the underlaying OS
    if we can find out step between 1 and 2 , we will get the problem ...
    what say ??
    dont think i am giving any suggestions to you . this is just what i think.
    Please let me know if any of ur friends are facing the same problem.
    -- Nilesh

  • Problem with viewLink accessor

    (ADF BC, JDeveloper 10.1.3 SU5)
    Hello,
    I have a master and a detail VO and a view link between them.
    Both VOs are entity based, master primary key is DBSequence.
    ViewLink cardinality is 1 to 0..1
    Let's say ViewLink accessor name is DetailLink.
    Master is inserted by ADF Faces table. Detail is inserted in code like below:
    Code in AppModuleImpl.java:
    ... get master row from master VO custom row set iterator ...
    detail = getDetail().createAndInitRow(master);
    ... init attributes ...
    getDetail().insertRow(detail)
    System.out.println("Master has detail: " + (getMaster().getDetailLink() != null));Even though the detail row has correctly set foreign key attribute, output of this code is not always "Master has detail: true". For example for newly started embedded OC4J it is "Master has detail: false".
    When I try to debug this code, getDetailLink() works correctly.
    What's wrong?
    Rado
    Message was edited by: RadoK
    (added omitted insertRow(detail))

    Strange is that getting detail entity from association accessor is successful.
    master.getMasterEntity().getDetailFromAssocAccessor() != null is true, but
    master.getDetailFromLinkAccessor() != null is false.
    The view link source and destination attributes are association from master detail association.
    Please help me find where the problem is.
    Rado

  • Problem in showing data on page using struts

    hi,iam new to struts framework,
    iam trying to display data fetched from database in a page contaning multiple textfields,when i try to call this page iam getting
    "javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in scope null"
    execption.can anybody tell me what can be the problem.
    action tag is
    <action path="/getdetails" type="com.dpsl.dxdam.participant.actions.ParticipantAction" name="ParticipantForm" scope="request" input="/jsp/participant/participantdetails.jsp">
    <forward name="success" path="/jsp/participant/participantdetails.jsp"/>
    </action>
    iam setting the values in textfield by
    <html:text property="participantpolicyID"/>
    iam calling the page by url
    http://localhost:8080/dxdams1.0/getdetails.do?action=getdetails
    what can be the problem ,please guide me

    Make sure all your text properties are correctly represented in your form bean.
    Clems

  • Problems with Overlay Layout - can anyone spot something wrong/missing?

    Hi folks, I'm developing a tool that allows you to draw rectangles around objects on an image. The rectangles are then saved, and you can move between images. For some reason, though my rectangles are not drawing on the panel. I am using the Overlay Layout. Can anyone spot what I'm doing wrong? (The TopPanel canvas appears to be there, as it's taking input from the mouse - the problem is simply that the red rectangles are not drawing on the panel). Please help!!
    So you know, there is a JFrame in another class which adds an instance of the ObjectMarker panel to it. It also provides buttons for using the next and previous Image methods.
    Any other general advice is appreciated too.
    * Object_Marker.java
    * Created on 07 April 2008, 15:38
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.event.MouseEvent;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import java.util.Arrays;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.List;
    import javax.imageio.ImageIO;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.OverlayLayout;
    import javax.swing.event.MouseInputAdapter;
    * @author Eric
    public class ObjectMarker extends javax.swing.JPanel {
         private static final long serialVersionUID = 6574271353772129556L;
         File directory;
         String directory_path;
         Font big = new Font("SansSerif", Font.BOLD, 18);
         List<File> file_list = Collections.synchronizedList(new LinkedList<File>());
         String[] filetypes = { "jpeg", "jpg", "gif", "bmp", "tif", "tiff", "png" };
         // This Hashmap contains List of Rectangles, allowing me to link images to collections of rectangles through the value 'index'.
         public static HashMap<Integer, List<Rectangle>> collection = new HashMap<Integer, List<Rectangle>>();
         BufferedImage currentImage;
         Thread thread;
         Integer index = 0;
         OverlayLayout overlay;
         private TopPanel top;
         private JPanel pictureFrame;
         String newline = System.getProperty("line.separator");
          * Creates new form Object_Marker
          * @throws IOException
         public ObjectMarker(File directory) {
              System.out.println("Got in...");
              this.directory = directory;
              File[] temp = directory.listFiles();
              directory_path = directory.getPath();
              // Add all the image files in the directory to the linked list for easy
              // iteration.
              for (File file : temp) {
                   if (isImage(file)) {
                        file_list.add(file);
              initComponents();
              try {
                   currentImage = ImageIO.read(file_list.get(index));
              } catch (IOException e) {
                   System.out.println("There was a problem loading the image.");
              // 55 pixels offsets the height of the JMenuBar and the title bar
              // which are included in the size of the JFrame.
              this.setSize(currentImage.getWidth(), currentImage.getHeight() + 55);
         public String getImageList() {
              // Allows me to build the string gradually.
              StringBuffer list = new StringBuffer();
              list.append("Image files found in directory: \n\n");
              for (int i = 0; i < file_list.size(); i++) {
                   list.append((((File) file_list.get(i))).getName() + "\n");
              return list.toString();
         private void initComponents() {
              top = new TopPanel();
              pictureFrame = new javax.swing.JPanel();
              OverlayLayout ol = new OverlayLayout(this);
              this.setLayout(ol);
              this.add(top);
              this.add(pictureFrame);
          * private void initComponents() {
          * javax.swing.GroupLayout pictureFrameLayout = new
          * javax.swing.GroupLayout(pictureFrame);
          * pictureFrame.setLayout(pictureFrameLayout);
          * pictureFrameLayout.setHorizontalGroup(
          * pictureFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          * .addGap(0, 497, Short.MAX_VALUE) ); pictureFrameLayout.setVerticalGroup(
          * pictureFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          * .addGap(0, 394, Short.MAX_VALUE) );
          * javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
          * this.setLayout(layout); layout.setHorizontalGroup(
          * layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          * .addComponent(pictureFrame, javax.swing.GroupLayout.DEFAULT_SIZE,
          * javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) );
          * layout.setVerticalGroup(
          * layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          * .addComponent(pictureFrame, javax.swing.GroupLayout.DEFAULT_SIZE,
          * javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); }
          * This function returns the extension of a given file, for example "jpg" or
          * "gif"
          * @param f
          *            The file to examine
          * @return String containing extension
         public static String getExtension(File f) {
              String ext = null;
              String s = f.getName();
              int i = s.lastIndexOf('.');
              if (i > 0 && i < s.length() - 1) {
                   ext = s.substring(i + 1).toLowerCase();
              } else {
                   ext = "";
              return ext;
         public String getDetails() {
              saveRectangles();
              StringBuffer sb = new StringBuffer();
              for (int i = 0; i < file_list.size(); i++) {
                   try{
                   int count = collection.get(i).size();
                   if (count > 0) {
                        sb.append(file_list.get(i).getPath() + " "); // Add the
                        // filename of
                        // the file
                        sb.append(count + " "); // Add the number of rectangles
                        for (int j = 0; j < collection.get(i).size(); j++) {
                             Rectangle current = collection.get(i).get(j);
                             String coordinates = (int) current.getMinX() + " "
                                       + (int) current.getMinY() + " ";
                             String size = ((int) current.getMaxX() - (int) current
                                       .getMinX())
                                       + " "
                                       + ((int) current.getMaxY() - (int) current
                                                 .getMinY()) + " ";
                             String result = coordinates + size;
                             sb.append(result);
                        sb.append(newline);
                   } catch (NullPointerException e){
                        // Do nothing.  "int count = collection.get(i).size();"
                        // will try to over count.
              return sb.toString();
         private boolean isImage(File f) {
              List<String> list = Arrays.asList(filetypes);
              String extension = getExtension(f);
              if (list.contains(extension)) {
                   return true;
              return false;
         /** Draw the image on the panel. * */
         public void paint(Graphics g) {
              if (currentImage == null) {
                   g.drawString("No image to display!", 300, 240);
              } else {
                   // Draw the image
                   g.drawImage(currentImage, 0, 0, this);
                   // Write the index
                   g.setFont(big);
                   g.drawString(index + 1 + "/" + file_list.size(), 10, 25);
         public void nextImage() throws IOException {
              if (index < file_list.size() - 1) {
                   printOutContents();
                   System.out.println("Index: " + index);
                   saveRectangles();
                   index++;
                   currentImage = ImageIO.read(file_list.get(index));
                   this
                             .setSize(currentImage.getWidth(),
                                       currentImage.getHeight() + 55);
                   top.setSize(this.getSize());
                   top.rectangle_list.clear();
                   if (collection.size() > index) {
                        loadRectangles();
                   repaint();
         private void saveRectangles() {
              // If the current image's rectangles have not been changed, don't do
              // anything.
              if (collection.containsKey(index)) {
                   System.out.println("Removing Index: " + index);
                   collection.remove(index);
              collection.put(index, top.getRectangleList());
              System.out.println("We just saved " + collection.get(index).size()
                        + " rectangles");
              System.out.println("They were saved in HashMap Location " + index);
              System.out.println("Proof: ");
              List<Rectangle> temp = collection.get(index);
              for (int i = 0; i < temp.size(); i++) {
                   System.out.println("Rectangle " + (i + 1) + ": " + temp.get(i));
              // If the rectangle list has changed, set the list the current index
              // as the new list.
         private void loadRectangles() {
              System.out.println("We just loaded index " + index
                        + " into temporary memory.");
              System.out.println("Proof: ");
              List<Rectangle> temp = collection.get(index);
              top.rectangle_list = collection.get(index);
              for (int i = 0; i < temp.size(); i++) {
                   System.out.println("Rectangle " + (i + 1) + ": " + temp.get(i));
         private void printOutContents() {
              System.out.println();
              System.out.println("Contents printout...");
              for (int i = 0; i < collection.size(); i++) {
                   for (Rectangle r : collection.get(i)) {
                        System.out.println("In collection index: " + i + " Rectangle "
                                  + r.toString());
              System.out.println();
         public void previousImage() throws IOException {
              if (index >= 1) {
                   printOutContents();
                   System.out.println("Index: " + index);
                   saveRectangles();
                   index--;
                   currentImage = ImageIO.read(file_list.get(index));
                   this
                             .setSize(currentImage.getWidth(),
                                       currentImage.getHeight() + 55);
                   top.setSize(this.getSize());
                   top.rectangle_list.clear();
                   if (index >= 0) {
                        loadRectangles();
                   repaint();
         public void removeLastRectangle() {
              // This method removes the most recent rectangle added.
              try {
                   int length = collection.get(index).size();
                   collection.get(index).remove(length - 1);
              } catch (NullPointerException e) {
                   try {
                        top.rectangle_list.remove(top.rectangle_list.size() - 1);
                   } catch (IndexOutOfBoundsException ioobe) {
                        JOptionPane.showMessageDialog(this, "Cannot undo any more!");
    * Class developed from SSCCE found on Java forum:
    * http://forum.java.sun.com/thread.jspa?threadID=647074&messageID=3817479
    * @author 74philip
    class TopPanel extends JPanel {
         List<Rectangle> rectangle_list;
         private static final long serialVersionUID = 6208367976334130998L;
         Point loc;
         int width, height, arcRadius;
         Rectangle temp; // for mouse ops in TopRanger
         public TopPanel() {
              setOpaque(false);
              rectangle_list = Collections
                        .synchronizedList(new LinkedList<Rectangle>());
              TopRanger ranger = new TopRanger(this);
              addMouseListener(ranger);
              addMouseMotionListener(ranger);
         public List<Rectangle> getRectangleList() {
              List<Rectangle> temporary = Collections
                        .synchronizedList(new LinkedList<Rectangle>());
              temporary.addAll(rectangle_list);
              return temporary;
         protected void paintComponent(Graphics g) {
              super.paintComponent(g);
              Graphics2D g2 = (Graphics2D) g;
              g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_ON);
              g2.setPaint(Color.red);
              // Draw all the rectangles in the rectangle list.
              for (int i = 0; i < rectangle_list.size(); i++) {
                   g2.drawRect(rectangle_list.get(i).x, rectangle_list.get(i).y,
                             rectangle_list.get(i).width, rectangle_list.get(i).height);
              if (temp != null) {
                   g2.draw(temp);
         public void loadRectangleList(List<Rectangle> list) {
              rectangle_list.addAll(list);
         public void addRectangle(Rectangle r) {
              rectangle_list.add(r);
    class TopRanger extends MouseInputAdapter {
         TopPanel top;
         Point offset;
         boolean dragging;
         public TopRanger(TopPanel top) {
              this.top = top;
              dragging = false;
         public void mousePressed(MouseEvent e) {
              Point p = e.getPoint();
              top.temp = new Rectangle(p, new Dimension(0, 0));
              offset = new Point();
              dragging = true;
              top.repaint();
         public void mouseReleased(MouseEvent e) {
              dragging = false;
              // update top.r
              System.out.println(top.getRectangleList().size() + ": Object added: "
                        + top.temp.toString());
              top.addRectangle(top.temp);
              top.repaint();
         public void mouseDragged(MouseEvent e) {
              if (dragging) {
                   top.temp.setBounds(top.temp.x, top.temp.y, e.getX() - top.temp.x, e
                             .getY()
                             - top.temp.y);
                   top.repaint();
    }Regards,
    Eric

    Alright so I fixed it! I created a new class called BottomPanel extends JPanel, which I then gave the responsibility of drawing the image. I gave it an update method which took the details of the currentImage and displayed it on the screen.
    If anybody's interested I also discovered/solved a problem with my mouseListener - I couldn't drag backwards. I fixed this by adding tests looking for negative widths and heights. I compensated accordingly by reseting the rectangle origin to e.getX(), e.getY() and by setting the to original_origin.x - e.getX() and original_origin.y - e.getY().
    No problem!

Maybe you are looking for

  • Mac App cannot be opened because of a problem?

    I just downloaded the free iProcrastinate app from the Mac App Store, but when I tried to open it, an error message popped up. It said: iProcrastinate cannot be opened because of a problem. Check with the developer to make sure Safari works with this

  • MOUNT USB STORAGE FOR VM BACKUP

    Hi, I just tried to mount USB Storage to my host with linux version. I detect it with fdisk -l and esxcli storage core device list | grep -i usb, after stopping usbarbitrator Result: /dev/disks #dmesg ScsiDevice: 3385: Successfully registered device

  • Ranking in crosstab but for one coloumn

    could you please help me on this? my month dimensions are on the top of my Crssstab chart, my product dimesions are on the left of my crosstab chart. there are sales revenue measures inside of the my crosstab chart. whenever I try to ascend my crosst

  • Add new text field in Address Book?

    I can export my address book using the Address Book Exporter Utility. However, instead of creating a label with First Last (e.g., Bob Dylan) as stored in Address Book, I would like to use a custom field, Mr. First Last & Family (Bob and Joan Dylan).

  • When I return my MBA 13-inch, should I buy the same or MB Pro?

    Pardon me, as I'm still very new to the Apple Community. I have tried to look for an answer to my problem, but now I write here. I bought the fully loaded MBA 13-inch hardly 2 weeks ago. Already in the first weekend I experienced really poor battery