Cannot cast java.io.serialiazable to int Error

Dear Members,
I have procedure in AM which is as follows:
public int countRecs(String headerID)
int count=0;
count= integer value assigned from SQL Query*
return count;
I am calling this procedure from the CO of the page as follows:
String headerID="123"
int     count=0;
*Serialiazable para[]={headerID};*
count=(int)am.invokeMethod("countRecs",headerID);
When I am compiling my CO I am getting the below error:
Cannot cast java.io.serialiazable to int
Kindly please help me in resolving this error.
Many thanks in advance.
Best Regards,
Arun Reddy D.

the signature of the method you are invoking is
public Serializable invokeMethod(String methodName,
Serializable[] methodParams)
so the return type is also serializable. so you should change your method signature accordingly
public int countRecs(String headerID)
int count=0;
count= integer value assigned from SQL Query*
return count;
public String countRecs(String headerID)
//just change last statement
return ""+count;}
your CO call should be
count=(int)am.invokeMethod("countRecs",headerID);count = Integer.parseInt(am.invokeMethod("countRecs",para));
so finally your count variable will hold an integer
you may need to keep the above statement in try catch block
Regards
Ravi

Similar Messages

  • How do I cast a String to an int ?  HELP !

    Dear Java People,
    If I have a program that outputs a String of the time ie
    09:25
    How do I code in Java to check this String to see if it is greater than 12 o'clock and if so tack on a String of "PM'.....
    I tried
    if ((int) hours.getDisplayValue()> 12 )
    to attempt to add "PM" at the end of the String
    The error message says:
    "ClockDisplay.java": Error cannot cast java.lang.String to int at line 88, column 12
    below is the program
    Thank you in advance
    Stan
    * The ClockDisplay class implements a digital clock display for a
    * European-style 24 hour clock. The clock shows hours and minutes. The
    * range of the clock is 00:00 (midnight) to 23:59 (one minute before
    * midnight).
    * The clock display receives "ticks" (via the timeTick method) every minute
    * and reacts by incrementing the display. This is done in the usual clock
    * fashion: the hour increments when the minutes roll over to zero.
    * @author Michael Kolling and David J. Barnes
    * @version 2001.05.26
    public class ClockDisplay
    private NumberDisplay hours;
    private NumberDisplay minutes;
    private String displayString; // simulates the actual display
    * Constructor for ClockDisplay objects. This constructor
    * creates a new clock set at 00:00.
    public ClockDisplay()
    hours = new NumberDisplay(24);
    minutes = new NumberDisplay(60);
    updateDisplay();
    * Constructor for ClockDisplay objects. This constructor
    * creates a new clock set at the time specified by the
    * parameters.
    public ClockDisplay(int hour, int minute)
    hours = new NumberDisplay(24);
    minutes = new NumberDisplay(60);
    setTime(hour, minute);
    * This method should get called once every minute - it makes
    * the clock display go one minute forward.
    public void timeTick()
    minutes.increment();
    if(minutes.getValue() == 0) { // it just rolled over!
    hours.increment();
    updateDisplay();
    * Set the time of the display to the specified hour and
    * minute.
    public void setTime(int hour, int minute)
    //Exercise 3.19 This condition will insure that it will be a 12 hour clock
    if(hour > 12)
    hour = hour - 12;
    hours.setValue(hour);
    minutes.setValue(minute);
    updateDisplay();
    * Return the current time of this display in the format HH:MM.
    public String getTime()
    return displayString;
    * Update the internal string that represents the display.
    private void updateDisplay()
    if ((int) hours.getDisplayValue() > 12 )
    displayString = hours.getDisplayValue() + ":" +
    minutes.getDisplayValue() ;
    * The NumberDisplay class represents a digital number display that can hold
    * values from zero to a given limit. The limit can be specified when creating
    * the display. The values range from zero (inclusive) to limit-1. If used,
    * for example, for the seconds on a digital clock, the limit would be 60,
    * resulting in display values from 0 to 59. When incremented, the display
    * automatically rolls over to zero when reaching the limit.
    * @author Michael Kolling and David J. Barnes
    * @version 2001.05.26
    public class NumberDisplay
    private int limit;
    private int value;
    * Constructor for objects of class Display
    public NumberDisplay(int rollOverLimit)
    limit = rollOverLimit;
    value = 0;
    * Return the current value.
    public int getValue()
    return value;
    * Return the display value (that is, the current value as a two-digit
    * String. If the value is less than ten, it will be padded with a leading
    * zero).
    public String getDisplayValue()
    if(value < 10)
    return "0" + value;
    else
    return "" + value;
    * Set the value of the display to the new specified value. If the new
    * value is less than zero or over the limit, do nothing.
    public void setValue(int replacementValue)
    if((replacementValue >= 0) && (replacementValue < limit))
    value = replacementValue;
    * Increment the display value by one, rolling over to zero if the
    * limit is reached.
    public void increment()
    value = (value + 1) % limit;
    public class TryClockDisplay
    public static void main(String[] args)
    ClockDisplay clockDisplay_1 = new ClockDisplay();
    clockDisplay_1.setTime(17,40);
    System.out.println("\nThe time now is " + clockDisplay_1.getTime());
    clockDisplay_1.timeTick();
    clockDisplay_1.timeTick();
    clockDisplay_1.timeTick();
    clockDisplay_1.timeTick();
    clockDisplay_1.timeTick();
    clockDisplay_1.timeTick();
    clockDisplay_1.timeTick();
    System.out.println("\nThe time now is " + clockDisplay_1.getTime());

    String time = "09:25";
    String hrs = time.substring(0,2);
    int hrsInt = Integer.parseInt(hrs);
    if(hrsInt>12){
        time += "PM";
    System.out.println(time);                                                                                                                                                                                                                                                                                                                                       

  • Using BC4J, Cannot Cast an Oracle Number to a java int

    Hi,
    I am using bc4j in jdev 9i, version 9.0.2.822. I have a type Row, to get the data from oracle, bc4j, and all work fine, except that I cannot
    cast or convert the number returned to an int where I can use it for other java functions.
    Is there any way to convert the number, using a wrapper or a function to do so?
    Any help is greatly appreciated.

    Use Number.intValue() method.

  • Cannot cast from SOMETHING to SOMETHING (Error in 1.4) (Works in 1.6)

    Our company have developed an accounting program, and it is already near completion.
    We developed it with JavaBean and Eclipse in Windows Environment with JRE 1.6.0_05
    When we tried to compile and run the program in our linux environment (Server) that runs on 1.4 , the casting error occured..
    we have written a program to generate all casting errors that occurred in our project.
    import java.math.*;
    import java.util.*;
    public class testnow {
         public static void main(String[] args){
              //Declare ALL Primitive!
              int TestINT = 150;
              Boolean TestBOOL = true;
              String TestSTR = "Streng" + "th";
              BigDecimal TestDCM = BigDecimal.valueOf(20);
              Date TestDATE = new Date();
              //Declare ALL Object
              Object TestINTObj = 150;
              Object TestSTRObj = "Strength";
              Object TestDCMObj = BigDecimal.valueOf(20);
              Object TestBOOLObj = true;
              Object TestDATEObj = new Date();
              if(TestINT == (Integer)TestINTObj){
                   System.out.println("TEST Integer PASSED");
              if(TestSTR.equals((String)TestSTRObj)){
                   System.out.println("TEST String PASSED");
              if(TestDCM.equals(TestDCMObj)){
                   System.out.println("TEST Decimal PASSED");
              if(TestBOOL == (Boolean)TestBOOLObj){
                   System.out.println("TEST Boolean PASSED");
              if(TestDATE.equals((Date)TestDATEObj)){
                   System.out.println("TEST Date PASSED");
    }the following is what happened when i run javac testnow.java
    1. ERROR in testnow.java
    (at line 6)
    Integer TestINT = 150;
    ^^^^^^^
    Type mismatch: cannot convert from int to Integer
    2. ERROR in testnow.java
    (at line 7)
    Boolean TestBOOL = (Boolean)true;
    ^^^^^^^^^^^^^
    Cannot cast from boolean to Boolean
    3. ERROR in testnow.java
    (at line 11)
    Object TestINTObj = (Object)150;
    ^^^^^^^^^^^
    Cannot cast from int to Object
    4. ERROR in testnow.java
    (at line 14)
    Object TestBOOLObj = true;
    ^^^^^^^^^^^
    Type mismatch: cannot convert from boolean to Object
    4 problems (4 errors)
    in our windows development JRE 1.6 , it run well and gives the following output :
    TEST Integer PASSED
    TEST String PASSED
    TEST Decimal PASSED
    TEST Boolean PASSED
    TEST Date PASSED
    how do we solve this? i mean we have been using this "convenience" casting all over our code . :(
    please help
    thanks a lot.
    Cheers and God Bless,
    Chowi

    You've got a lot of problems there, and not all of them are due to Java version incompatibilites. I'll take them in the order I see them. public static Object FindDataInTable(ArrayList TargetTable, String TypeColumn,
             String TargetColumn, Object TargetData, String ReturnedColumn)&#x7B; The convention is to give methods and variables names that start with lowercase letters. That makes your code easier to read, which makes it easier for us to help you. Later on, I see you also use a mix of underscores and camelcase. Underscores should be used only in constant names; class, method and variable names should use only camelcase.
    Also, if you don't have a good reason to make that first argument an ArrayList, you should declare it as a List instead. That leaves the calling code the option of using a different List implementation should they need to.
    Next, you assign a primitive value to an Object reference: Object ReturnedObject = 0; That requires autoboxing, as others have pointed out, which didn't exist in JDK 1.4. Even if you could use autoboxing though, that assignment would be a bad idea; a variable of type Object should be assigned a default value of {color:000080}null{color}, not a number. However, you may not need to declare that variable at all, as I explain later.
    Next you use a "foreach" loop, another feature that was added in JDK 1.5; you'll have to switch to the old-style loop if you want this code to work under JDK 1.4. While you're at it, you should declare your "SingleRow" variable inside the loop, since it's not used anywhere else: for (Iterator it = TargetTable.iterator(); it.hasNext(); ) {
        Model_DatabaseQuery SingleRow = (Model_DatabaseQuery)it.next(); Next I see you using matches() to compare String values: if(TypeColumn.matches("String")){
        if(((String)TargetData).matches((String)CheckData))&#x7B; You get away with that because the strings contain only letters, but you need to look up the docs for matches() so you'll understand why you shoudn't be using it here. But this is nothing compared to the next issue: if((Integer)TargetData == (Integer)CheckData)&#x7B; // WRONG WRONG WRONG That can't possibly have worked right, no matter what version of Java you ran it under. You NEVER use == to compare the values objects! You should have been using equals() for all those comparisions, not matches(), and definitely not ==.
    But I don't see why you're doing all those checks on the column type anyway. All you ever do after that is compare the same two values, so just do it: for (Iterator it = targetTable.iterator(); it.hasNext(); ) {
        Model_DatabaseQuery SingleRow = (Model_DatabaseQuery)it.next();
        Object CheckData = SingleRow.Get_object(TargetColumn);
        if (CheckData != null && CheckData.equals(TargetData)) {
            return SingleRow.Get_object(ReturnedColumn);
    } If there are other columns that you're supposed to ignore, you may still need to check the column type, but you could do that in one {color:000080}if{color} statement; you don't have to check them all separately.

  • Exception:[java.lang.IllegalArgumentException: Cannot cast 02 to boolean]

    Hi Friends,
    I am facing a issue in mapping. My scenario is IDOC to JDBC.
    I have done mapping in the give below way.
    If segment1 and segment2 both exists and attyp(field of segment1) is equal to '00' or '01' then segment1 replicate into table.
    I am facing a error while testing the mapping is:
    RuntimeException in Message-Mapping transformation: Exception:[java.lang.IllegalArgumentException: Cannot cast 02 to boolean] in class com.sap.aii.mappingtool.flib3.Bool method or[02, 01, com.sap.aii.mappingtool.tf3.rt.Context@459926e5]
    Kindly suggest me on this.
    Regards,
    Narendra Goyal

    My Mapping in such a way:
                              01      attyp
                                \          \               segment1
                                or   -  equals           \
                                 /          \                then
                               02         and   -    if              ->       Table
    segment1 - exists   \      /                 else
                                  and                      /
    segmen2 - exists   /             some more condition

  • Mapping Error: Cannot cast to float

    Hello Everyone,
    Has anyone seen this error in Message Mapping in XI?  What did you do to resolve it?
    13:59:10 Start of test
    Compilation of JobPositionPublication2PositionOpening_M successful Runtime exception during processing target field mapping /ns1:PositionOpening/ns1:PositionProfile/ns1:PositionDetail. The message is: Exception:[java.lang.IllegalArgumentException: Cannot cast to float. ] in class com.sap.aii.mappingtool.flib3.Arithm method greater[, 0, com.sap.aii.mappingtool.tf3.rt.Context@8e6076] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns1:PositionOpening/ns1:PositionProfile/ns1:PositionDetail. The message is: Exception:[java.lang.IllegalArgumentException: Cannot cast to float. ] in class com.sap.aii.mappingtool.flib3.Arithm method greater[, 0, com.sap.aii.mappingtool.tf3.rt.Context@8e6076] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:284) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:352) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:60) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:105) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:309) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:194) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.IllegalArgumentException: Cannot cast to float. ] in class com.sap.aii.mappingtool.flib3.Arithm method greater[, 0, com.sap.aii.mappingtool.tf3.rt.Context@8e6076] at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:41) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:41) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:41) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:220) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:352) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:60) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:105) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:309) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:194) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:41) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:41) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:41) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:220) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:352) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:60) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:105) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:309) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:194) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: java.lang.IllegalArgumentException: Cannot cast to float. at com.sap.aii.mappingtool.flib3.Arithm.toFloat(Arithm.java:19) at com.sap.aii.mappingtool.flib3.Arithm.greater(Arithm.java:72) ... 27 more RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns1:PositionOpening/ns1:PositionProfile/ns1:PositionDetail. The message is: Exception:[java.lang.IllegalArgumentException: Cannot cast to float. ] in class com.sap.aii.mappingtool.flib3.Arithm method greater[, 0, com.sap.aii.mappingtool.tf3.rt.Context@8e6076]
    13:59:12 End of test

    If you are using a UDF, then the input and the output from the UDF is in the form of a string.If a float value is passed to the UDF,and if there are some arithmetic operations done on that float value then you need to convert the string to float - something like the below.
    String s = "100.00";
          try {
             float f = Float.valueOf(s.trim()).floatValue();
             System.out.println("float f = " + f);
          } catch (NumberFormatException nfe) {
             System.out.println("NumberFormatException: " + nfe.getMessage());
    Then before returning the value to the target field,convert the value back to string  like this -
    Float.toString(float f)
    In case you are using some other standard functions,do let us know of that as well so that we can suggest resolutions to this error.
    thanks\
    Priyanka

  • Cannot find symbl method update Date(int,java.util.Date)

    I get following error
    cannot find symbl method update Date(int,java.util.Date) on compling class called GuestDataBean at line ( rowSet.updateDate( 4, guest.getDate() ); ).
    GustBean.java. I need help on why I get it.
    // JavaBean to store data for a guest in the guest book.
    package com.deitel.jhtp6.jsp.beans;
    import java.util.*;
    public class GuestBean
       private String firstName;
       private String lastName;
       private String email;
       private Date date;
       private String message;
       //Constructors
       public GuestBean(){
            public GuestBean(String firstname, String lastname, String email,Date date,String message){
                 this.firstName=firstname;
                 this.lastName=lastName;
                 this.email=email;
                 this.date=date;
                 this.message=message;
       // set the guest's first name
       public void setFirstName( String name )
          firstName = name; 
       } // end method setFirstName
       // get the guest's first name
       public String getFirstName()
          return firstName; 
       } // end method getFirstName
       // set the guest's last name
       public void setLastName( String name )
          lastName = name; 
       } // end method setLastName
       // get the guest's last name
       public String getLastName()
          return lastName; 
       } // end method getLastName
       // set the guest's email address
       public void setEmail( String address )
          email = address;
       } // end method setEmail
       // get the guest's email address
       public String getEmail()
          return email; 
       } // end method getEmail
       public void setMessage( String mess)
          message = mess;
       } // end method setEmail
       // get the guest's email address
       public String getMessage()
          return message; 
       } // end method getEmail
       public void setDate( Date dat )
          date = dat;
       } // end method setEmail
       // get the guest's email address
       public Date getDate()
          return date; 
       } // end method getEmail
    } // end class GuestBean
    GuestDataBean.java/**
    * @(#)GuestDataBean.java
    * @author
    * @version 1.00 2008/7/18
    // Class GuestDataBean makes a database connection and supports
    // inserting and retrieving data from the database.
    package com.deitel.jhtp6.jsp.beans;
    import java.sql.SQLException;
    import javax.sql.rowset.CachedRowSet;
    import java.util.ArrayList;
    import com.sun.rowset.CachedRowSetImpl; // CachedRowSet implementation
    import java.sql.*;
    public class GuestDataBean
       private CachedRowSet rowSet;
       // construct TitlesBean object
       public GuestDataBean() throws Exception
          // load the MySQL driver
          Class.forName( "org.gjt.mm.mysql.Driver" );
          // specify properties of CachedRowSet
          rowSet = new CachedRowSetImpl(); 
          rowSet.setUrl( "jdbc:mysql://localhost:3306/virsarmedia" );
          rowSet.setUsername( "root" );
          rowSet.setPassword( "" );
           // obtain list of titles
          rowSet.setCommand(
             "SELECT firstName, lastName, email,date,message FROM guest" );
          rowSet.execute();
       } // end GuestDataBean constructor
       // return an ArrayList of GuestBeans
       public ArrayList< GuestBean > getGuestList() throws SQLException
          ArrayList< GuestBean > guestList = new ArrayList< GuestBean >();
          rowSet.beforeFirst(); // move cursor before the first row
          // get row data
          while ( rowSet.next() )
             GuestBean guest = new GuestBean();
             guest.setFirstName( rowSet.getString( 1 ) );
             guest.setLastName( rowSet.getString( 2 ) );
             guest.setEmail( rowSet.getString( 3 ) );
             guest.setDate( rowSet.getDate( 4 ) );
             guest.setMessage( rowSet.getString( 5 ) );
             guestList.add( guest );
          } // end while
          return guestList;
       } // end method getGuestList
       // insert a guest in guestbook database
       public void addGuest( GuestBean guest ) throws SQLException
          rowSet.moveToInsertRow(); // move cursor to the insert row
          // update the three columns of the insert row
          rowSet.updateString( 1, guest.getFirstName() );
          rowSet.updateString( 2, guest.getLastName() );
          rowSet.updateString( 3, guest.getEmail() );
          rowSet.updateDate( 4, guest.getDate() );
          rowSet.updateString( 5, guest.getMessage() );
          rowSet.insertRow(); // insert row to rowSet
          rowSet.moveToCurrentRow(); // move cursor to the current row
          rowSet.commit(); // propagate changes to database
       } // end method addGuest
    } // end class GuestDataBean

    This isn't a JSP question, it better belongs in the JavaProgramming, or JDBC forums.
    But the problem is because the updateDate method uses a java.sql.Date object and you are giving it a java.util.Date object. You have to convert from java.util.Date to java.sql.Date. See: [the api for java.sql.Date|http://java.sun.com/javase/6/docs/api/java/sql/Date.html] .
    Edited by: stevejluke on Jul 21, 2008 5:43 PM

  • JSPM ERROR- cannot add JAVA patches to deploy queue via JSPM

    Hi Experts! Last two days I have deployed java patches(SP13 to SP18).......almost finished......i have to deploy 2 more components only but suddenly i got error.now i cannot add java patches to JSPM deployment queue. am getting error '/usr/sap/BWP/DVEBMGS10/j2ee/JSPM/log/log_2009_07_22_23_41_20/JSPM_MAIN_1_01.LOG.' I have checked trouble ticket log and i have followed Snote-1329945 and changed instace.properties files  as instance.runmode=normal and just restarted java via SMICM only (server reboot is not possible in my environment)
    Trouble Ticket Report----
    Java Support Package Manager for SAP NetWeaver'04s
    SID................: BWP
    Hostname...........: abcbwp02
    Install directory..: /usr/sap/BWP
    Database...........: DB2/AIX64
    Operating System...: $(/J2EE/StandardSystem/CentralInstance/J2EEEngineInstanceHost/OpSysType)
    JDK version........: 1.4.2 IBM Corporation
    JSPM version.......: 7.00.18.1.01
    System release.....: 700
    ABAP stack present.: true
    The execution ended in error.
    Cannot initialize application data.
    Error while detecting start profile for instance with ID _s.
    More information can be found in the log file /usr/sap/BWP/DVEBMGS10/j2ee/JSPM/log/log_2009_07_22_23_41_20/JSPM_MAIN_1_01.LOG.
    Use the information provided to trouble-shoot the problem. There might be an OSS note providing a solution to this problem. Search for OSS notes with the following search terms:
    com.sap.sdt.jspm.phases.PhaseTypeJSPM/com.sap.sdt.jspm.gui.JspmUiException/Cannot initialize application data/JSPM_MAIN
    JSPMPhases/Java Support Package Manager
    log_2009_07_22_23_41_20 exception:
    #1.5 #C000C0A8D28F0000000000366BD46BD400046F4D35AF2008#1248277310677#/System/Server/Upgrade/Phases/JSPM/JSPMPhases/JSPM_MAIN##com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:795)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:795)#Java###Duration: .#1#0:00:10.915#
    #1.5 #C000C0A8D28F0000000000376BD46BD400046F4D35AF2008#1248277310677#/System/Server/Upgrade/Phases/JSPM/JSPMPhases/JSPM_MAIN##com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:796)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:796)#Java###Phase status is .#1#error#
    Thanks.

    Hi,
    ABAP stack present.: true
    The execution ended in error.
    Cannot initialize application data.
    Error while detecting start profile for instance with ID _s.
    Looks like the problem is above 1
    Do the following. This should resolve the issues.
    1. If your dialog instance are also having the Java stack then do one thing move your profile folder to some other name and create a new profile folder with the name "profile".
    Copy only the central instance profiles Default, Instance and start profile.
    Then give a try.
    2. If you do not have the java instance in Dialog instance still do the same thing what I have described. move the current profile folder and create the new folder with the name "profile" and copy the profiles Default, Instance and start profile.
    Chances are the JSPM is reading some other profile while starting the JSPM.
    Regards,
    Ravi

  • ERROR:  - Cannot export - JAVA is not the current PSE provider!

    Hello Colleagues,
    in our SAP PI 7.31 Dual-Stack system we facing following error "ERROR:  -> Cannot export - JAVA is not the current PSE provider!" under Netweaver Administrator (NWA) -- > Certificates and Keys: Key Storage, if we executing button "Export View to PSE" for view "ICM_SSL_*".
    As by default for ABAP and Dual-Stack systems, profile parameter "ssl/pse_provider" is set to ABAP.
    How we are able to solve that issue?
    Many thanks in advance!
    Regards,
    Jochen

    Hello Mr. Schertel,
    I'm facing the same error in our system.
    Did you already solve the problem?
    Best Regards,
    Alexander Beck

  • Cannot cast boolean to BigDicemal??

    i am new in reporting
    i am using iReport 3.0...
    i want to show my line in report if a field value is greater than 5000
    my field type is BigDecimal
    i wrote formula as
    (($F{AvgAmount}.intValue() >= 5000 )? true : false )
    when i check expression result is Expression successfully validated.
    when i Run report error accour
    Errors compiling .\BranchWiseAverage.jasper.
    net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from boolean to BigDecimal                 value = (java.math.BigDecimal)(((((java.math.BigDecimal)field_AvgAmount.getValue()).intValue() >= 5000 )? true : false ));//$JR_EXPR_ID=14$                         <---------------------------------------------------------------------------------------------------------------> 2. Cannot cast from boolean to BigDecimal                 value = (java.math.BigDecimal)(((((java.math.BigDecimal)field_AvgAmount.getOldValue()).intValue() >= 5000 )? true : false ));//$JR_EXPR_ID=14$                         <------------------------------------------------------------------------------------------------------------------> 3. Cannot cast from boolean to BigDecimal                 value = (java.math.BigDecimal)(((((java.math.BigDecimal)field_AvgAmount.getValue()).intValue() >= 5000 )? true : false ));//$JR_EXPR_ID=14$                         <---------------------------------------------------------------------------------------------------------------> 3 errors      at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)     at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:591)     at java.lang.Thread.run(Unknown Source)
    Compilation running time: 328
    how can i remove this error.
    thanks

    Hi Les,
    where there is a will, there is a script:
    Get-ADUser -Filter * -SearchBase "OU=Departments,dc=contoso,dc=com" -Properties * | select Name, @{ n = "Enabled"; e = { [int]$_.Enabled } }, Canon* | export-csv departments.csv
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • The report terminated with error:  REP-110: File test2. cannot be opened. REP-1070: An error occurred while opening or saving a document.

    Hi,
    I'm getting the below error for reports.
    The report terminated with error:
    REP-110: File test2. cannot be opened. REP-1070: An error occurred while opening or saving a document. REP-0110: File test2. cannot be opened. .
    When checked Environment using url 'http://host:port/reports/rwservlet/showenv?server=your_repserver_name"
    found below
    ==================================================
    Reports Servlet Environment Variables 11.1.1.4.0
    Security Mode Non-secure
    HTTP Environment Variables 11.1.1.4.0
    SERVER_NAME   09.14.4.41
    SERVER_PORT   8888
    SCRIPT_NAME   /rwservlet
    SERVER_PROTOCOL   HTTP/1.1
    SERVER_SOFTWARE   undefined
    GATEWAY_INTERFACE   undefined
    SERVER_PORT_SECURE   undefined
    ACCEPT   image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    REQUEST_METHOD   GET
    REMOTE_HOST   test-wam-app
    REMOTE_ADDR   09.14.4.41
    REMOTE_USER   undefined
    AUTH_TYPE   undefined
    PATH_INFO   showenv
    QUERY_STRING   server=RptSvr_test-wam-app_wamtest
    PATH_TRANSLATED   undefined
    CONTENT_LENGTH   undefined
    CONTENT_TYPE   undefined
    AUTHORIZATION   undefined
    USER-AGENT   Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; MS-RTC LM 8)
    REMOTE_IDENT   undefined
    REFERER   undefined
    Oracle Reports Services - Servlet Environment Variables  Select to jump to the top of the page  Return to Top
    KeyMapFile   /u03/apptest/FMW_11.1.1/user_projects/domains/WamTest/config/fmwconfig/servers/WLS_REPORTS/applications/reports_11.1.1.2.0/configuration/cgicmd.dat
    DBAUTH   /u03/apptest/FMW_11.1.1/apphome/reports/templates/rwdbauth.htm
    SYSAUTH   /u03/apptest/FMW_11.1.1/apphome/reports/templates/rwsysauth.htm
    server   rep_wls_reports_test-wam-app_wamtest1
    DIAGNOSTIC   yes
    ERRORTEMPLATE   /u03/apptest/FMW_11.1.1/apphome/reports/templates/rwerror.htm
    SERVER_IN_PROCESS   yes
    COOKIEEXPIRE   30
    ENCRYPTIONKEY   reports9i
    DIAGHEADTAGS   undefined
    DIAGBODYTAGS   undefined
    HELPURL   undefined
    RELOAD_KEYMAP   undefined
    IMAGEURL   http://09.14.4.41:8888/reports/rwservlet 
    SINGLESIGNON   no
    Oracle Reports Services - Server and Engine Environment Variables  Select to jump to the top of the page  Return to Top
    PATH   /u01/wamtest/FMW_11.1.1/apphome/jdk/bin:/u01/wamtest/FMW_11.1.1/apphome/bin:/u01/wamtest/FMW_11.1.1/apphome/jdk/bin:/u01/wamtest/FMW_11.1.1/apphome/bin:/u01/wamtest/FMW_11.1.1/apphome/bin:/u01/wamtest/FMW_11.1.1/apphome/bin:/u01/java/jdk1.6.0_23/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
    DISPLAY  
    LD_LIBRARY_PATH   /u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64/server:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/../lib/amd64:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64/native_threads:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64:/u01/wamtest/FMW_11.1.1/apphome/lib:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64/server:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64/native_threads:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64:/u01/wamtest/FMW_11.1.1/apphome/lib:/u01/wamtest/FMW_11.1.1/apphome/jdk/jre/lib/amd64/server:/u01/wamtest/FMW_11.1.1/apphome/opmn/lib:/u01/wamtest/FMW_11.1.1/apphome/lib
    ORACLE_HOME   /u01/wamtest/FMW_11.1.1/apphome
    TNS_ADMIN   /u01/wamtest/FMW_11.1.1/instance1/config
    NLS_LANG   AMERICAN_AMERICA.WE8ISO8859P1
    USER_NLS_LANG  
    RW   /u01/wamtest/FMW_11.1.1/apphome/reports
    REPORTS_PATH   /u01/wamtest/FMW_11.1.1/apphome/reports/templates:/u01/wamtest/FMW_11.1.1/apphome/reports/samples/demo:/u01/wamtest/FMW_11.1.1/apphome/reports/integ:/u01/wamtest/FMW_11.1.1/apphome/reports/printers:/u01/wamtest/FMW_11.1.1/instance1/reports/fonts:/u01/wamtest/FMW_11.1.1/apphome/reports/templates:/u01/wamtest/FMW_11.1.1/apphome/reports/samples/demo:/u01/wamtest/FMW_11.1.1/apphome/reports/integ:/u01/wamtest/FMW_11.1.1/apphome/reports/printers:/u01/wamtest/FMW_11.1.1/instance1/reports/fonts:
    REPORTS_TMP   /tmp
    REPORTS_TAGLIB_URI   /WEB-INF/lib/reports_tld.jar
    java.class.path   /u01/wamtest/FMW_11.1.1/apphome/reports/jlib/rwrun.jar
    sourceDir  
    tempDir  
    useDataCache  
    ignoreDataParameter
    =========================================================================
    ORACLE_HOME is on mount point u03, checked config.properties but no mention of mount point /u01.
    Dont know from where /u01 came. Could you please help me re configuring the env pointing to /u03.
    Reports server is up though without any issues.
    Regards,
    Djay

    Ensure that the report name is correct. Also ensure that the report exist in REPORTS_PATH environment variable. Otherwise run the report including the reports path.
    E.g.
    report=<reports directory>/test2.rdf

  • Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec

    I have created a BPEL process in which i have used DB Adapter when i try to deploy the soa suite coposite i am getting the following error.
    [09:36:10 PM] Error deploying archive sca_TicketBooking_rev1.0.jar to partition "default" on server soa_server1 [http://utl-7c8735e613f:8001]
    [09:36:10 PM] HTTP error code returned [500]
    [09:36:10 PM] Error message from server:
    There was an error deploying the composite on soa_server1: [JCABinding] [TicketBooking.TicketBooking/1.0]Unable to complete unload due to: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec.
    [09:36:10 PM] Check server log for more details.
    [09:36:10 PM] Error deploying archive sca_TicketBooking_rev1.0.jar to partition "default" on server soa_server1 [http://utl-7c8735e613f:8001]
    [09:36:10 PM] #### Deployment incomplete. ####
    [09:36:10 PM] Error deploying archive file:/D:/Personal/OracleWork/RnDProjects/TicketBooking/TicketBooking/deploy/sca_TicketBooking_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)
    I already created the data source and JNDI Name in the DBAdapter but still getting the error while deploying the application.
    One mistake that i think i have made after creating the data source now the DBAdapter.rar file taking the path as follows.
    Source Path:     C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ was\ DbAdapter. rar
    Deployment Plan: C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ was\ Plan. xml
    initially the path was as follows:
    Source Path:     C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ DbAdapter. rar
    Deployment Plan: C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ Plan. xml
    Please help me i have googled a lot but can't find the answer anywhere.
    Thanks in advance

    Mate ,
    Just check the health status and state of DB Adapter in the deployments of WLAdminConsole.
    If its inactive , redeploy and update it ,also make sure its targeted to the right server.

  • Java.rmi.ServerException: Internal Server Error (serialization error....)

    Hi to all.
    I have two classes.
    The first is:
    public class FatherBean implements Serializable {
    public String name;
    public int id;
    /** Creates a new instance of ChildBean */
    public FatherBean() {
    this.name= null;
    this.id = 0;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public int getId() {
    return id;
    public void setId(int id) {
    this.id = id;
    The second is :
    public class ChildBean extends FatherBean implements Serializable {
    public double number;
    /** Creates a new instance of ChildBean */
    public ChildBean() {
    super();
    this.number = 0.0;
    public double getNumber() {
    return number;
    public void setNumber(double number) {
    this.number = number;
    A test client class implements the following method that is exposed as web service:
    public java.util.Collection getBeans() {
    java.util.Collection beans = new ArrayList();
    ChildBean childBean1 = new ChildBean();
    ChildBean childBean2 = new ChildBean();
    childBean1.setId(100);
    childBean1.setName("pippo");
    childBean1.setNumber(3.9);
    childBean2.setId(100000);
    childBean2.setName("pluto");
    childBean2.setNumber(4.7);
    beans.add(childBean1);
    beans.add(childBean2);
    return beans;
    When I invoke the web service to url:
    http://localhost:8080/Prova
    and invoke the correspondent method on jsp client, throws exception:
    java.rmi.ServerException: Internal Server Error (serialization error: no serializer is registered for (class test.ChildBean, null))
         at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
         at ws.ProvaClientGenClient.ProvaRPC_Stub.getBeans(ProvaRPC_Stub.java:59)
         at ws.ProvaClientGenClient.getBeans_handler.doAfterBody(getBeans_handler.java:64)
         at jasper.getBeans_TAGLIB_jsp._jspService(_getBeans_TAGLIB_jsp.java:121)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
         at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
         at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    Where is the problem? Will be ChildBean that extends FatherBean? Wich settings on Sun Java Studio Enterprise 6 2004Q1?
    Thank you.

    Hi,
    This forum is for Sun Java Studio Creator related questions. Could you pls post your message in the appropriate forum.
    Thank you
    Cheers :-)

  • Cannot launch Java Report Panel

    I would like to use the 'Advanced' Web Intelligence editor.
    Unfortunately, when I attempt to edit a WI report, I get a message that reads 'This software has already been installed on your computer.  Would you like to reinstall it?'
    If I allow the installation, Java 6, Update 3 is downloaded and installed.  I restart the browser.  Attempting to edit the WI report generates the installation message.
    If I don't allow the installation, I get an error that reads 'Cannot launch Java Report Panel, please make sure you have installed a Java virtual machine.'.
    It never gets out of this installation loop.
    At one point, the Advance editor worked, then something changed.
    The Java Control Panel indicates that I have JRE versions 1.6.0_03 and 1.6.0._20 installed (in the Java Applet Runtime Settings).  In addition, versions 1.4.2_04, 1.4.2_07, 1.4.2_12, and 1.6.0_03 are listed in the JNLP Runtime settings.
    Any assistance is greatly appreciated.
    Craig Buchanan

    I am having the same problem and I don't see an answer here.  I have uninstalled every instance of java and restarted my computer, then installed the one suggested here:  Cannot launch Java Report Panel, please make sure you have installed a Java virtual machine. (the Java Virtual Machine was a link).  Restarted again, tried again, same error. On the sun page, I tested my java installation and it works fine.  I have checked that java is enabled in both IE and Firefox and I still get this error in either browser.  I am using Windows XP.
    Upon comparing my computer with my coworker's java configurations, we found that she has a certificate called "Business Objects America" and I don't have that.  Could that be the problem, and if so, where can I get that certificate?  There was no active X question as I would have expected to see asking to run active X or not.  I can't find any certificate downloads on your site at all.
    Please advise ASAP because I need to use this Web Intelligence Reporting and I cannot get in.
    Thank you.

  • Java.lag out of memory error

    my x2 cannot work with the pdf reader i downloaded from nokia store as there is java.lag out of memory error what should i do

    it is common in most s40 phones.....even my C3 does thesame

Maybe you are looking for