Deserialize Object Invalid Class Exception

I receive the followign error when attempting to deserialize an Integer class:
java.lang.Integer; Local class not compatible: stream classdesc serialVersionUID=1360826667802527544 local class serialVersionUID=1360826667806852920
java.io.InvalidClassException: java.lang.Integer; Local class not compatible: stream classdesc serialVersionUID=1360826667802527544 local class serialVersionUID=1360826667806852920
     at java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:560)
     at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:604)
     at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:981)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:402)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:272)
     at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1231)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:272)
     at nyerges.matt.Serialization.DeserializeObjectFromString(Serialization.java:50)
     at nyerges.matt.TestSerialization.main(TestSerialization.java:35)
Here is my main class and method:
package nyerges.matt;
* @author n0139292
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class TestSerialization {
     public static void main(String[] args) {
          Integer i = new Integer(10);
          System.out.println(i);
          String res = Serialization.SerializeObjectToString(i);
          Integer q = (Integer) Serialization.DeserializeObjectFromString(res);
          System.out.println(q);
}Here is the code for the serialization class:
package nyerges.matt;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
* @author n0139292
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class Serialization {
     public static String SerializeObjectToString(Object o)
          try{
               ByteArrayOutputStream baos = new ByteArrayOutputStream();
               ObjectOutputStream oos = new ObjectOutputStream(baos);
               oos.writeObject(o);
               oos.flush();
               oos.close();
               String toSend = new String(baos.toByteArray());
               return toSend;
          }catch(Exception e){
               System.out.println(e.getMessage());
               e.printStackTrace();
          return null;
     public static Object DeserializeObjectFromString(String s)
          try
               byte[] bs = s.getBytes();
               ByteArrayInputStream bais = new ByteArrayInputStream(bs);
               ObjectInputStream ois = new ObjectInputStream(bais);
               Object toGet = (Object) ois.readObject();
               ois.close();
               return toGet;
          }catch(Exception e)
               System.out.println(e.getMessage());
               e.printStackTrace();
          return null;
}This does not deal with RMI or Marshalling problems, since I am doing it on the same computer within seconds of each other. This was developed and ran with WebSphere if that helps.
Thanks in advance,
Matt

Check this out for a discussion on this:
http://forum.java.sun.com/thread.jspa?threadID=479051&messageID=2228486
Oh, as an aside and you might also want to take a look here, for method names:
http://java.sun.com/docs/codeconv/

Similar Messages

  • Invalid Class Exception problem

    Hi whenever i try to run this method from a different class to the one it is declared in it throws invalid class exception, (in its error it says the class this method is written in is the problem) yet when i run it from its own class in a temporary main it works fine, perhaps someone can see the problem in the method code. All its doing is reading from a few different txt files, deserializing the objects and putting them into arraylists for future access.
    public void readCourseData()
              CourseArrayLengths cal;
              try
                   FileInputStream fis = new FileInputStream("arraylengths.txt");
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   cal = ((CourseArrayLengths) ois.readObject());     
                   ois.close();
                   FileInputStream fis1 = new FileInputStream("units.txt");
                   ObjectInputStream ois1 = new ObjectInputStream(fis1);
                   for(int i=0;i<cal.getUnitArrayLength();i++)
                        units.add((Unit) ois1.readObject());
                   ois1.close();
                   FileInputStream fis2 = new FileInputStream("sections.txt");
                   ObjectInputStream ois2 = new ObjectInputStream(fis2);
                   for(int i=0;i<cal.getSectionArrayLength();i++)
                        sections.add((Section) ois2.readObject());
                   ois2.close();
                   FileInputStream fis3 = new FileInputStream("files.txt");
                   ObjectInputStream ois3 = new ObjectInputStream(fis3);
                   for(int i=0;i<cal.getFileArrayLength();i++)
                        files.add((Filetype) ois3.readObject());
                   ois3.close();
              catch(FileNotFoundException exception)
              System.out.println("The File was not found");
              catch(IOException exception)
              System.out.println(exception);
              catch(ClassNotFoundException exception)
              System.out.println(exception);
         }

    import java.util.ArrayList;
    import java.io.*;
    import javax.swing.*;
    public class Unit implements Serializable
    ArrayList units = new ArrayList();
    ArrayList sections = new ArrayList();
    ArrayList files = new ArrayList();
    String unitName;
    int sStart=0,sEnd=0,sIndex=0,fIndex=0,subIndex=0;
         public Unit(String unitNamec,int sStartc,int sEndc)
              unitName = unitNamec;
              sStart = sStartc;
              sEnd = sEndc;
         public Unit()
         public String getUnitName()
              return unitName;
         public Unit getUnit(int i)
              return (Unit)units.get(i);
         public Section getSection(int i)
              return (Section)sections.get(i);
         public ArrayList getUnitArray()
              return units;
         public int getSectionStart()
              return sStart;
         public int getSectionEnd()
              return sEnd;
         public void setSectionStart(int i)
              sStart = i;
         public void setSectionEnd(int i)
              sEnd = i;
         public void addUnit(String uName)
              units.add(new Unit(uName,sections.size(),sIndex));
              sIndex++;
         public void addSection(String sName,Unit u)
              //problem lies with files.size()
              sections.add(new Section(sName,files.size(),files.size()));
              u.setSectionEnd(u.getSectionEnd()+1);
              //fIndex++;
         public void addFile(String fName,File fPath,Section s)
              files.add(new Filetype(fName,fPath));
              s.setFileEnd(s.getFileEnd()+1);
         public void display(Unit u)
              System.out.println(u.getUnitName());
              for(int i=u.getSectionStart();i<u.getSectionEnd();i++)
                   System.out.println(((Section)sections.get(i)).getSectName());
                   for(int j=((Section)(sections.get(i))).getFileStart();j<((Section)(sections.get(i))).getFileEnd();j++)
                        System.out.println(((Filetype)files.get(j)).getFileName());
         public void writeCourseData()
         //writes 3 arrays to 3 different files
    try
    FileOutputStream fos = new FileOutputStream("units.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         for(int i=0;i<units.size();i++)
         oos.writeObject((Unit)units.get(i));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    try
    FileOutputStream fos = new FileOutputStream("sections.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         for(int i=0;i<sections.size();i++)
         oos.writeObject((Section)sections.get(i));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    try
    FileOutputStream fos = new FileOutputStream("files.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         for(int i=0;i<files.size();i++)
         oos.writeObject((Filetype)files.get(i));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    try
    FileOutputStream fos = new FileOutputStream("arraylengths.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         oos.writeObject(new CourseArrayLengths(units.size(),sections.size(),files.size()));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
         public void readCourseData()
              CourseArrayLengths cal;
              try
                   FileInputStream fis = new FileInputStream("arraylengths.txt");
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   cal = ((CourseArrayLengths) ois.readObject());     
                   ois.close();
                   FileInputStream fis1 = new FileInputStream("units.txt");
                   ObjectInputStream ois1 = new ObjectInputStream(fis1);
                   for(int i=0;i<cal.getUnitArrayLength();i++)
                        units.add((Unit) ois1.readObject());
                   ois1.close();
                   FileInputStream fis2 = new FileInputStream("sections.txt");
                   ObjectInputStream ois2 = new ObjectInputStream(fis2);
                   for(int i=0;i<cal.getSectionArrayLength();i++)
                        sections.add((Section) ois2.readObject());
                   ois2.close();
                   FileInputStream fis3 = new FileInputStream("files.txt");
                   ObjectInputStream ois3 = new ObjectInputStream(fis3);
                   for(int i=0;i<cal.getFileArrayLength();i++)
                        files.add((Filetype) ois3.readObject());
                   ois3.close();
              catch(FileNotFoundException exception)
              System.out.println("The File was not found");
              catch(IOException exception)
              System.out.println(exception);
              catch(ClassNotFoundException exception)
              System.out.println(exception);
         /*public static void main(String args[])
              Unit u1 = new Unit();
              u1.addUnit("Cmps2a22");
              u1.addSection("Section1",u1.getUnit(0));
              //u1.addSubSection("Subsect1",u1.getSection(0));
              u1.addFile("File1",null,u1.getSection(0));
              u1.addFile("File2",null,u1.getSection(0));
              u1.addSection("Section2",u1.getUnit(0));
              u1.addFile("NF",null,u1.getSection(1));
              u1.addFile("NF2",null,u1.getSection(1));
              u1.addFile("NF3",null,u1.getSection(1));
              u1.addSection("Section3",u1.getUnit(0));
              u1.addFile("NF",null,u1.getSection(2));
              u1.addFile("NF2",null,u1.getSection(2));
              u1.addFile("NF4",null,u1.getSection(2));
              u1.display(u1.getUnit(0));
              u1.writeCourseData();
              u1.readCourseData();
              u1.display(u1.getUnit(0));
    import java.util.ArrayList;
    import java.io.*;
    public class Section implements Serializable
    private String sectName,subSectName;
    private int fpStart=0,fpEnd=0,subSectStart=0,subSectEnd=0;
    private Section s;
    private boolean sub;
         public Section(String sectNamec,int fpStartc,int fpEndc,int subSectStartc,int subSectEndc,Section sc,boolean subc)
              sectName = sectNamec;
              fpStart = fpStartc;
              fpEnd = fpEndc;
              subSectStart = subSectStartc;
              subSectEnd = subSectEndc;
              s = sc;
              sub = subc;
         public Section(String sectNamec,int fpStartc,int fpEndc)
              sectName = sectNamec;
              fpStart = fpStartc;
              fpEnd = fpEndc;
         public Section getParent()
              return s;
         public boolean isSub()
              return sub;
         public String getSubName()
              return subSectName;
         public int getSubStart()
              return subSectStart;
         public int getSubEnd()
              return subSectEnd;
         public void setSubStart(int i)
              subSectStart = i;
         public void setSubEnd(int i)
              subSectEnd = i;
         public int getFileStart()
              return fpStart;
         public int getFileEnd()
              return fpEnd;
         public String getSectName()
              return sectName;
         public void setFileStart(int i)
              fpStart = i;
         public void setFileEnd(int i)
              fpEnd = i;
         public void addSection(String sectName)
         /*public static void main(String args[])
    import java.io.*;
    public class Filetype implements Serializable
         private String name;
         private File filepath;
         public Filetype(String namec, File filepathc)
              name = namec;
              filepath = filepathc;
         public String getFileName()
              return name;
         public File getFilepath()
              return filepath;
    import java.io.*;
    public class CourseArrayLengths implements Serializable
    private int ul,sl,fl;
         public CourseArrayLengths(int ulc,int slc,int flc)
              ul = ulc;
              sl = slc;
              fl = flc;
         public int getUnitArrayLength()
              return ul;
         public int getSectionArrayLength()
              return sl;
         public int getFileArrayLength()
              return fl;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.ArrayList;
    import java.io.*;
    public class OrganiserGui implements ActionListener
    int width,height;
    JFrame frame;
         public OrganiserGui()
              width = 600;
              height = 500;
         public void runGui()
              //Frame sizes and location
              frame = new JFrame("StudentOrganiser V1.0");
    frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
              frame.setSize(width,height);
              frame.setLocation(60,60);
              JMenuBar menuBar = new JMenuBar();
              //File menu
              JMenu fileMenu = new JMenu("File");
              menuBar.add(fileMenu);
              fileMenu.addSeparator();
              JMenu addSubMenu = new JMenu("Add");
              fileMenu.add(addSubMenu);
              JMenuItem cwk = new JMenuItem("Coursework assignment");
              addSubMenu.add(cwk);
              JMenuItem lecture = new JMenuItem("Lecture");
              lecture.addActionListener(this);
              addSubMenu.add(lecture);
              JMenuItem seminar = new JMenuItem("Seminar sheet");
              addSubMenu.add(seminar);
              //Calendar menu
              JMenu calendarMenu = new JMenu("Calendar");
              menuBar.add(calendarMenu);
              calendarMenu.addSeparator();
              JMenu calendarSubMenu = new JMenu("Edit Calendar");
              calendarMenu.add(calendarSubMenu);
              JMenuItem eventa = new JMenuItem("Add/Remove Event");
              eventa.addActionListener(this);
              calendarSubMenu.add(eventa);
              JMenuItem calClear = new JMenuItem("Clear Calendar");
              calClear.addActionListener(this);
              calendarSubMenu.add(calClear);
              JMenu calendarSubMenuView = new JMenu("View");
              calendarMenu.add(calendarSubMenuView);
              JMenuItem year = new JMenuItem("By Year");
              year.addActionListener(this);
              calendarSubMenuView.add(year);
              JMenuItem month = new JMenuItem("By Month");
              month.addActionListener(this);          
              calendarSubMenuView.add(month);
              JMenuItem week = new JMenuItem("By Week");
              week.addActionListener(this);
              calendarSubMenuView.add(week);
              //Timetable menu
              JMenu timetableMenu = new JMenu("Timetable");
              menuBar.add(timetableMenu);
              timetableMenu.addSeparator();
              JMenu stimetableSubMenu = new JMenu("Social Timetable");
              timetableMenu.add(stimetableSubMenu);
              JMenu ltimetableSubMenu = new JMenu("Lecture Timetable");
              timetableMenu.add(ltimetableSubMenu);
              frame.setJMenuBar(menuBar);
    frame.setVisible(true);
         public void actionPerformed(ActionEvent e)
              JMenuItem source = (JMenuItem)(e.getSource());
              System.out.println(source.getText());     
              Calendar c = new Calendar();
              if(source.getText().equalsIgnoreCase("By Year"))
                   System.out.println("INSIDE");
                   c.buildArray();
                   c.calendarByYear(Calendar.calendarArray);     
              if(source.getText().equalsIgnoreCase("Add/Remove Event"))
                   c.eventInput();
              if(source.getText().equalsIgnoreCase("clear calendar"))
                   c.buildYear();
                   c.writeEvent(Calendar.calendarArray);
                   c.buildArray();
              if(source.getText().equalsIgnoreCase("lecture"))
                   System.out.println("Nearly working");
                   //JFileChooser jf = new JFileChooser();
                   //jf.showOpenDialog(frame);
                   FileManager fm = new FileManager();
                   //choose unit to add file to
                   JOptionPane unitOption = new JOptionPane();
                   Unit u = new Unit();
                   u.readCourseData();
                   //u.display(u.getUnit(0));
                   System.out.println((u.getUnit(0)).getUnitName());
                   String[] unitNames = new String[u.getUnitArray().size()];
                   for(int i=0;i<unitNames.length;i++)
                        //unitNames[i] = (((Unit)u.getUnitArray().get(i)).getUnitName());
                        //System.out.println(unitNames);
                        System.out.println((u.getUnit(i)).getUnitName());
                   //unitOption.showInputDialog("Select Unit to add lecture to",unitNames);
                   //needs to select where to store it
                   //fm.openFile(jf.getSelectedFile());
         public static void main(String args[])
              OrganiserGui gui = new OrganiserGui();
              gui.runGui();
    java.io.invalidclassexception: Unit; local class incompatible: stream classdesc serialversionUID = 3355176005651395533, local class serialversionUID = 307309993874795880

  • Tiger and USB communications problem....Invalid Class Exception

    I purchased my G5 last April, and installed Tiger on it. Since installtion of Tiger I have been unable to run WeatherLink 5.01, 5.0.2 or 5.03, even after reinstalling the operating system. The issue is that the software is unable to connect to the Vantage Pro2 weather station via the USB port.
    Each time the software shuts down, and here's the information in the Console:
    java.io.InvalidClassException: globals.ProgConfigData; Local class not compatible: stream classdesc serialVersionUID=-3030819089009633781 local class serialVersionUID=-3230663525674838887
    Index 1 for 'pxm#' 2062 out of range (must be between 0 and 0)
    Attempted to read past end of 'pxm#'(2062) resourcejava.io.FileNotFoundException: /WeatherLink Install Log.log (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:135)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:57)
    at globals.SoftwareVersionTool.save(SoftwareVersionTool.java:93)
    at win.main.MainWin.main(MainWin.java:4401)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.zerog.lax.LAX.launch(Unknown Source)
    at com.zerog.lax.LAX.main(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
    at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
    at apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)
    exception: null
    Exception occurred in main() of MainWin
    The people who developed the WeatherLink software have run out of answers for me.
    Thanks, John

    Sorry this post is so late but I'm only just now setting up a Vantage Pro2 weather station.
    You might want to check out a couple of alternatives to WeatherLink, neither of which is written in Java: wview and WeatherTracker. WeatherTracker has promise but is still in beta and has a lot of issues. However, it might be functional enough for you. You can download it through the WeatherTracker forums.
    wview is a different animal from WeatherLink and WeatherTracker in that it has no windowed application: it uses your web browser as its display application. The only difficulty is that it's open source, requiring you to download it, build it, and configure it, all from the Terminal. The instructions on the wview web site are pretty good, though, and there's even an OS X-specific quick start page. Since wview is native code and not computationally intensive, the system requirements are pretty low, too: it's running quite well on an old 466 MHz G3 iBook SE (with an Airport card) I had lying around gathering dust, which allows the VP2 console to be located just about anywhere and still used for data logging instead of requiring the purchase of a Wireless Envoy.
    You can check out my weather page to get an idea of wview's capabilities. As I write this, I'm using wview's built-in weather station simulator, but I will start using live data hopefully in about a week, pending the arrival of my WeatherLink package (only needed to get the data logger).

  • Invalid class exception

    Getting following exception from a EJB client :
    exception is:
         java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatible: stream classdesc serialVersionUID=-9219910240172116449 local class serialVersionUID=796770993296843510
    2004-08-11 17:46:03,091 ERROR [] [main]
    The EJB is properly deployed in JBoss App server.
    The classpath on client side has all the classes which are in the classpath of Jboss(Run script)
    The full exception trace is :
    Exception in thread "main" java.rmi.UnmarshalException: Error unmarshaling return; nested exceptio
    n is:
    java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatible: stream
    classdesc serialVersionUID=-9219910240172116449 local class serialVersionUID=796770993296843510
    java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatible: stream classdes
    c serialVersionUID=-9219910240172116449 local class serialVersionUID=796770993296843510
    at java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:518)
    at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:562)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:931)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:935)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:207)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117)
    at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
    Anybody has idea about this?
    Thanks

    The client and server code are in Sync.
    The classpath on client side:
    ANT_CLASSES="$ANT_HOME/lib/xerces.jar:$ANT_HOME/lib/commons-lang-2.0.jar:$ANT_HOME/lib/commons-logging.jar:$ANT_HOME/lib/jcs.jar"
    APP_CLASSPATH="$pbase/client/programs:$JBOSS_HOME/server/default/deploy/aurora.jar:$pbase/classes/common"
    JBOSS_CP="$JBOSS_HOME/client/jbossall-client.jar:$HOME/a/ejb.jar:$JAVA_HOME/lib/tools.jar"
    CLASSPATH=$JBOSS_CP:$ANT_CLASSES:$APP_CLASSPATH
    The classpath in Jboss run script:
    ANT_CLASSES="$ANT_HOME/lib/xerces.jar:$ANT_HOME/lib/commons-lang-2.0.jar:$ANT_HOME/lib/commons-logging.jar:$ANT_HOME/lib/jcs.jar"
    OR_CLASSES="/user11/oracle/8.1.7/jdbc/lib/classes12.zip"
    APP_CLASSPATH="$pbase/classes/common"
    JBOSS_CLASSPATH="$JAVA_HOME/lib/tools.jar:$ANT_CLASSES:$APP_CLASSPATH:$HOME/a/ejb.jar:$OR_CLASSES"
    Both (client and server ) are using same JDK 1.3.1.

  • Invalid Classes ( Objects)

    I am running 8.1.7 and I just look for all Objects that are Java classes and found that I have alot as INVALID, how can I recompile them or REVALIDATE them ?
    Any help will be great

    Hi Francisco,
    If the invalid classes are ones that you explicitly loaded using the
    "loadjava" tool, then the only way I know how to "revalidate" those
    classes would be to first remove them from the database (using the "dropjava"
    tool) and then reload them (using the "loadjava" tool).
    When you load the classes, make sure you use the "-resolve" flag, since
    this forces "validation" of the classes as they are loaded.
    You don't say what database version you are using, but you should look
    at the "Java Developer's Guide" (if you haven't already done so). It
    is available from here:
    http://tahiti.oracle.com
    If the "invalid" classes are those that get loaded as part of the
    database installation process, then you may need to re-install java
    in the database. This usually means executing the "initjvm.sql" script.
    Again, there are more details in the documentation available from
    the above-mentioned URL.
    Hope this has helped you.
    Good Luck,
    Avi.

  • Delphi 3 or Delphi XE gives Invalid class string error

    I have Delphi 3 and a runtime error occurs when I RUN this project. No build errors...
    The form appears correctly and I put the path to the GroupWise domain directory :
    F:\opt\novell\groupwise\mail\dom1
    I click on the CONNECT button and the error is :
    "Project admin_api.exe raised an exception class EOleSysError with message 'Invalid class string'. Process stopped. Use Step or Run to Continue"
    For Delphi XE the error is only "Invalid class string".
    What am I doing wrong ?
    Thank You
    Have downloaded the same GroupWise Administrative Object API code
    https://www.novell.com/developer/ndk...bject_api.html
    unit App_obj;
    interface
    uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    StdCtrls, OleAuto, Ole2;
    type
    TForm1 = class(TForm)
    Button1: TButton;
    Label6: TLabel;
    UserID: TEdit;
    Label7: TLabel;
    LastName: TEdit;
    Label8: TLabel;
    FirstName: TEdit;
    UserDistinguishedName: TEdit;
    Label10: TLabel;
    SystemInfo: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    SystemDescription: TEdit;
    SystemDistinguishedName: TEdit;
    SystemLastModifiedBy: TEdit;
    ConnectedDomainName: TEdit;
    SystemObjectID: TEdit;
    PostOfficeList: TComboBox;
    Label11: TLabel;
    Label9: TLabel;
    UserContext: TEdit;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    DomainPath: TEdit;
    Button2: TButton;
    procedure Initialize(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;
    var
    Form1: TForm1;
    vSystem:variant;
    vDomain:variant;
    const
    ADMIN_NAME = 'Admin';
    sDOT = '.';
    implementation
    {$R *.DFM}
    procedure TForm1.Initialize(Sender: TObject);
    begin
    //Initialize controls
    DomainPath.Text:='';
    SystemDescription.Text:='';
    SystemDistinguishedName.Text:='';
    SystemLastModifiedBy.Text:='';
    ConnectedDomainName.Text:='';
    SystemObjectID.Text:='';
    UserID.Text:='';
    LastName.Text:='';
    FirstName.Text:='';
    UserDistinguishedName.Text:='';
    UserContext.Text:='';
    UserID.SetFocus;
    end;
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vUsers:variant;
    vUser:variant;
    stemp:string;
    idotpos:integer;
    SelectedPO:string;
    sAdmin:string;
    begin
    //Get Selected PostOffice
    SelectedPO:=PostOfficeList.Items[PostOfficeList.ItemIndex];
    //Get Users Object
    vUsers:=vDomain.Users;
    //Find Admin user object
    vUser:=vUsers.Item(ADMIN_NAME,SelectedPO,Connected DomainName.Text);
    If UserContext.Text = '' then begin
    //Get Admin Context and use as Default
    sAdmin:=vUser.NetID;
    idotpos:=Pos(sDOT,sAdmin);
    stemp:=Copy(sAdmin,idotpos,256); //Copy everything after first dot include dot
    UserContext.Text:=stemp;
    end else begin
    //Use context string
    stemp:=UserContext.Text;
    end;
    //Make Distinguished name by adding UserID and admin context
    stemp:=UserID.Text+stemp;
    //Display User distinguished name
    UserDistinguishedName.Text:=stemp;
    //Add user
    vUser:=vUsers.Add(UserID.Text,LastName.Text,stemp,
    '',SelectedPO);
    //Set User first name
    vUser.GivenName:=FirstName.Text;
    //Commit User first name to system
    vUser.Commit;
    end;
    procedure TForm1.Button2Click(Sender: TObject);
    var
    vPostOffice:variant;
    vPostOffices:variant;
    vPOIterator:variant;
    begin
    //Get GroupWise Admin Object and connect to it
    if(DomainPath.Text = '') then begin
    ShowMessage('You must enter a valid Domain Path. Then press Login');
    exit;
    end;
    vSystem:=CreateOleObject('NovellGroupWareAdmin');
    vSystem.Connect(DomainPath.Text);
    //Get the connected Domain
    vDomain:=vSystem.ConnectedDomain;
    //List some Domain properties
    SystemDescription.Text:=vDomain.Description;
    SystemDistinguishedName.Text:=vDomain.Distinguishe dName;
    SystemLastModifiedBy.Text:=vDomain.LastModifiedBy;
    ConnectedDomainName.Text:=vDomain.Name;
    SystemObjectID.Text:=vDomain.ObjectID;
    //Initialize controls
    UserID.Text:='';
    LastName.Text:='';
    FirstName.Text:='';
    UserDistinguishedName.Text:='';
    UserContext.Text:='';
    UserID.SetFocus;
    //Get list of PostOffices for connected Domain
    vPostOffices:=vDomain.PostOffices;
    vPOIterator:=vPostOffices.CreateIterator;
    vPostOffice:=vPOIterator.Next;
    PostOfficeList.Clear;
    While( (NOT VarIsNULL(vPostOffice)) And (NOT varisempty(vPostOffice))) do begin
    PostOfficeList.Items.Add(vPostOffice.Name);
    vPostOffice:=vPOIterator.Next;
    end;
    //Set index to first item in list
    PostOfficeList.ItemIndex:=0;
    end;
    end.

    On 9/24/2013 10:46 PM, bperez wrote:
    >
    > I have Delphi 3 and a runtime error occurs when I RUN this project. No
    > build errors...
    >
    > The form appears correctly and I put the path to the GroupWise domain
    > directory :
    >
    > F:\opt\novell\groupwise\mail\dom1
    >
    > I click on the CONNECT button and the error is :
    >
    > "Project admin_api.exe raised an exception class EOleSysError with
    > message 'Invalid class string'. Process stopped. Use Step or Run to
    > Continue"
    >
    > For Delphi XE the error is only "Invalid class string".
    >
    > What am I doing wrong ?
    >
    > Thank You
    >
    > Have downloaded the same GroupWise Administrative Object API code
    > https://www.novell.com/developer/ndk...bject_api.html
    >
    > {/************************************************** *************************
    >
    > ************************************************** **************************/}
    > unit App_obj;
    >
    > interface
    >
    > uses
    > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    > Dialogs,
    > StdCtrls, OleAuto, Ole2;
    >
    > type
    > TForm1 = class(TForm)
    > Button1: TButton;
    > Label6: TLabel;
    > UserID: TEdit;
    > Label7: TLabel;
    > LastName: TEdit;
    > Label8: TLabel;
    > FirstName: TEdit;
    > UserDistinguishedName: TEdit;
    > Label10: TLabel;
    > SystemInfo: TGroupBox;
    > Label1: TLabel;
    > Label2: TLabel;
    > Label3: TLabel;
    > Label4: TLabel;
    > Label5: TLabel;
    > SystemDescription: TEdit;
    > SystemDistinguishedName: TEdit;
    > SystemLastModifiedBy: TEdit;
    > ConnectedDomainName: TEdit;
    > SystemObjectID: TEdit;
    > PostOfficeList: TComboBox;
    > Label11: TLabel;
    > Label9: TLabel;
    > UserContext: TEdit;
    > Label12: TLabel;
    > Label13: TLabel;
    > Label14: TLabel;
    > Label15: TLabel;
    > Label16: TLabel;
    > DomainPath: TEdit;
    > Button2: TButton;
    > procedure Initialize(Sender: TObject);
    > procedure Button1Click(Sender: TObject);
    > procedure Button2Click(Sender: TObject);
    > private
    > { Private declarations }
    > public
    > { Public declarations }
    > end;
    >
    > var
    > Form1: TForm1;
    > vSystem:variant;
    > vDomain:variant;
    >
    > const
    > ADMIN_NAME = 'Admin';
    > sDOT = '.';
    >
    > implementation
    >
    > {$R *.DFM}
    >
    > procedure TForm1.Initialize(Sender: TObject);
    > begin
    > //Initialize controls
    > DomainPath.Text:='';
    > SystemDescription.Text:='';
    > SystemDistinguishedName.Text:='';
    > SystemLastModifiedBy.Text:='';
    > ConnectedDomainName.Text:='';
    > SystemObjectID.Text:='';
    >
    > UserID.Text:='';
    > LastName.Text:='';
    > FirstName.Text:='';
    > UserDistinguishedName.Text:='';
    > UserContext.Text:='';
    > UserID.SetFocus;
    >
    > end;
    >
    > procedure TForm1.Button1Click(Sender: TObject);
    > var
    > vUsers:variant;
    > vUser:variant;
    > stemp:string;
    > idotpos:integer;
    > SelectedPO:string;
    > sAdmin:string;
    > begin
    > //Get Selected PostOffice
    > SelectedPO:=PostOfficeList.Items[PostOfficeList.ItemIndex];
    >
    > //Get Users Object
    > vUsers:=vDomain.Users;
    >
    > //Find Admin user object
    > vUser:=vUsers.Item(ADMIN_NAME,SelectedPO,Connected DomainName.Text);
    >
    > If UserContext.Text = '' then begin
    >
    > //Get Admin Context and use as Default
    > sAdmin:=vUser.NetID;
    > idotpos:=Pos(sDOT,sAdmin);
    > stemp:=Copy(sAdmin,idotpos,256); //Copy everything after first dot
    > include dot
    > UserContext.Text:=stemp;
    >
    > end else begin
    > //Use context string
    > stemp:=UserContext.Text;
    > end;
    >
    > //Make Distinguished name by adding UserID and admin context
    > stemp:=UserID.Text+stemp;
    >
    > //Display User distinguished name
    > UserDistinguishedName.Text:=stemp;
    >
    > //Add user
    > vUser:=vUsers.Add(UserID.Text,LastName.Text,stemp,
    > '',SelectedPO);
    >
    > //Set User first name
    > vUser.GivenName:=FirstName.Text;
    >
    > //Commit User first name to system
    > vUser.Commit;
    > end;
    >
    >
    >
    > procedure TForm1.Button2Click(Sender: TObject);
    > var
    > vPostOffice:variant;
    > vPostOffices:variant;
    > vPOIterator:variant;
    >
    > begin
    > //Get GroupWise Admin Object and connect to it
    > if(DomainPath.Text = '') then begin
    > ShowMessage('You must enter a valid Domain Path. Then press
    > Login');
    > exit;
    > end;
    > vSystem:=CreateOleObject('NovellGroupWareAdmin');
    >
    >
    > vSystem.Connect(DomainPath.Text);
    > //Get the connected Domain
    > vDomain:=vSystem.ConnectedDomain;
    >
    > //List some Domain properties
    > SystemDescription.Text:=vDomain.Description;
    > SystemDistinguishedName.Text:=vDomain.Distinguishe dName;
    > SystemLastModifiedBy.Text:=vDomain.LastModifiedBy;
    > ConnectedDomainName.Text:=vDomain.Name;
    > SystemObjectID.Text:=vDomain.ObjectID;
    >
    > //Initialize controls
    > UserID.Text:='';
    > LastName.Text:='';
    > FirstName.Text:='';
    > UserDistinguishedName.Text:='';
    > UserContext.Text:='';
    > UserID.SetFocus;
    >
    > //Get list of PostOffices for connected Domain
    > vPostOffices:=vDomain.PostOffices;
    > vPOIterator:=vPostOffices.CreateIterator;
    > vPostOffice:=vPOIterator.Next;
    > PostOfficeList.Clear;
    > While( (NOT VarIsNULL(vPostOffice)) And (NOT
    > varisempty(vPostOffice))) do begin
    > PostOfficeList.Items.Add(vPostOffice.Name);
    > vPostOffice:=vPOIterator.Next;
    > end;
    >
    > //Set index to first item in list
    > PostOfficeList.ItemIndex:=0;
    > end;
    >
    > end.
    >
    >
    gw client installed? Novell client installed?

  • Invalid Key Exception: Unsupported key type: Sun RSA public key, 1024 bits

    I am trying to retrieve certificates from Microsoft Keystore and extract its keys using SunMSCAPI in jdk 1.6. It gives me an invalid key exception, when I am trying to wrap the Symmetric key (which was previously used to perform AES encryption on data), using RSA algorithm.
    Code snippet:
               // RSA 1024 bits Asymmetric encryption of Symmetric AES key             
                // List the certificates from Microsoft KeyStore using SunMSCAPI.
                      System.out.println("List of certificates found in Microsoft Personal Keystore:");
                       KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
                       ks.load(null, null) ;
                       Enumeration en = ks.aliases() ;
                       PublicKey RSAPubKey = null;
                       Key RSAPrivKey = null;
                       int i = 0;
                       while (en.hasMoreElements()) {
                            String aliasKey = (String)en.nextElement() ;              
                            X509Certificate c = (X509Certificate) ks.getCertificate(aliasKey) ;     
                            String sss = ks.getCertificateAlias(c);
                            if(sss.equals("C5151997"))
                            System.out.println("---> alias : " + sss) ;
                            i= i + 1;
                            String str = c.toString();
                            System.out.println(" Certificate details : " + str ) ;
                          RSAPubKey = c.getPublicKey();
                            RSAPrivKey = ks.getKey(aliasKey, null);  //"mypassword".toCharArray()
                            Certificate[] chain = ks.getCertificateChain(aliasKey);     
                       System.out.println("No of certificates found from Personal MS Keystore: " + i);
                // Encrypt the generated Symmetric AES Key using RSA cipher      
                        Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding", ks.getProvider().getName());            
                       rsaCipher.init(Cipher.WRAP_MODE, RSAPubKey);
                       byte[] encryptedSymmKey = rsaCipher.wrap(aeskey);   
                       System.out.println("Encrypted Symmetric Key :" + new String(encryptedSymmKey));
                       System.out.println("Encrypted Symmetric Key Length in Bytes: " + encryptedSymmKey.length);
                       // RSA Decryption of Encrypted Symmetric AES key
                       rsaCipher.init(Cipher.UNWRAP_MODE, RSAPrivKey);
                       Key decryptedKey = rsaCipher.unwrap(encryptedSymmKey, "AES", Cipher.SECRET_KEY);Output:
    List of certificates found in Microsoft Personal Keystore:
    ---> alias : C5151997
    Certificate details : [
    Version: V3
    Subject: CN=C5151997, O=SAP-AG, C=DE
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 171871587533146191561538456391418351861663300588728159334223437391061141885590024223283480319626015611710315581642512941578588886825766256507714725820048129123720143461110410353346492039350478625370269565346566901446816729164309038944197418238814947654954590754593726047828813400082450341775203029183105860831
    public exponent: 65537
    Validity: [From: Mon Jan 24 18:17:49 IST 2011,
                   To: Wed Jan 23 18:17:49 IST 2013]
    Issuer: CN=SSO_CA, O=SAP-AG, C=DE
    SerialNumber: [    4d12c509 00000005 eb85]
    Certificate Extensions: 6
    [1]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: 07 E5 83 A1 B2 B7 DF 6B 4B 67 9C 1D 42 C9 0D F4 .......kKg..B...
    0010: 35 76 D3 F7 5v..
    [2]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: E4 C4 2C 93 20 AF DA 4C F2 53 68 4A C0 E7 EC 30 ..,. ..L.ShJ...0
    0010: 8C 0C 3B 9A ..;.
    [3]: ObjectId: 1.3.6.1.4.1.311.21.7 Criticality=false
    Extension unknown: DER encoded OCTET string =
    0000: 04 30 30 2E 06 26 2B 06 01 04 01 82 37 15 08 82 .00..&+.....7...
    0010: D1 E1 73 84 E4 FE 0B 84 FD 8B 15 83 E5 90 1B 83 ..s.............
    0020: E6 A1 43 81 62 84 B1 DA 50 9E D3 14 02 01 64 02 ..C.b...P.....d.
    0030: 01 1B ..
    [4]: ObjectId: 2.5.29.17 Criticality=false
    SubjectAlternativeName [
    RFC822Name: [email protected]
    [5]: ObjectId: 2.5.29.15 Criticality=true
    KeyUsage [
    DigitalSignature
    Non_repudiation
    Key_Encipherment
    Data_Encipherment
    [6]: ObjectId: 2.5.29.19 Criticality=true
    BasicConstraints:[
    CA:false
    PathLen: undefined
    Algorithm: [SHA1withRSA]
    Signature:
    0000: B3 C5 92 66 8D D7 ED 6D 51 12 63 CC F4 52 18 B9 ...f...mQ.c..R..
    0010: B8 A6 78 F7 ED 7D 78 18 DA 71 09 C9 AE C8 49 23 ..x...x..q....I#
    0020: F5 32 2F 0F D1 C0 4C 08 2B 6D 3C 11 B9 5F 5B B5 .2/...L.+m<.._[.
    0030: 05 D9 CA E6 F9 0A 94 14 E7 C6 7A DB 63 FE E5 EC ..........z.c...
    0040: 48 94 8C 0D 77 92 59 DE 34 6E 77 1A 24 FE E3 C1 H...w.Y.4nw.$...
    0050: D8 0B 52 6A 7E 22 13 71 D7 F8 AF D1 17 C8 64 4F ..Rj.".q......dO
    0060: 83 EA 2D 6A CA 7F C3 84 37 15 FE 99 73 1D 7C D1 ..-j....7...s...
    0070: 6D B4 99 09 62 B9 0F 18 33 4C C6 66 7A 9F C0 DB m...b...3L.fz...
    No of certificates found from Personal MS Keystore: 1
    Exception in thread "main" java.security.InvalidKeyException: Unsupported key type: Sun RSA public key, 1024 bits
    modulus: 171871587533146191561538456391418351861663300588728159334223437391061141885590024223283480319626015611710315581642512941578588886825766256507714725820048129123720143461110410353346492039350478625370269565346566901446816729164309038944197418238814947654954590754593726047828813400082450341775203029183105860831
    public exponent: 65537
         at sun.security.mscapi.RSACipher.init(RSACipher.java:176)
         at sun.security.mscapi.RSACipher.engineInit(RSACipher.java:129)
         at javax.crypto.Cipher.init(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at com.sap.srm.crpto.client.applet.CryptoClass.main(CryptoClass.java:102)
    Edited by: sabre150 on 18-Jul-2011 03:47
    Added [ code] tags to make code readable.

    A bit of research indicates that the classes of the keys obtained by
                          RSAPubKey = c.getPublicKey();
                               RSAPrivKey = ks.getKey(aliasKey, null);  //"mypassword".toCharArray()are sun.security.rsa.RSAPublicKeyImpl and sun.security.*mscapi*.RSAPrivateKey . It seems that for Cipher objects from the SunMSCAPI provider cannot accept RSA public keys of class sun.security.rsa.RSAPublicKeyImpl and that the SunMSCAPI will only accept RSA private keys of class sun.security.mscapi.RSAPrivateKey.
    This came up under different guise a couple of years ago. It makes sense since encrypting/wrapping with a public key does not represent a security problem (there is nothing secret in any of the encryption operations) when done outside of MSCAPI so one can use any provider that has the capability BUT the decryption/unwrapping must be done with the SunMSCAPI provider which delegates it to the MSCAPI.
    My working test code based on your code implementing this approach is :
            // RSA 1024 bits Asymmetric encryption of Symmetric AES key             
            // List the certificates from Microsoft KeyStore using SunMSCAPI.
            System.out.println("List of certificates found in Microsoft Personal Keystore:");
            KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
            ks.load(null, null);
            Enumeration en = ks.aliases();
            PublicKey RSAPubKey = null;
            Key RSAPrivKey = null;
            int i = 0;
            while (en.hasMoreElements())
                String aliasKey = (String) en.nextElement();
                X509Certificate c = (X509Certificate) ks.getCertificate(aliasKey);
                String sss = ks.getCertificateAlias(c);
                if (sss.equals("rsa_key")) // The alias for my key - make sure you change it back to your alias
                    System.out.println("---> alias : " + sss);
                    i = i + 1;
                    String str = c.toString();
                    System.out.println(" Certificate details : " + str);
                    RSAPubKey = c.getPublicKey();
             System.out.println(RSAPubKey.getClass().getName());
                   RSAPrivKey = ks.getKey(aliasKey, null);  //"mypassword".toCharArray()
            System.out.println(RSAPrivKey.getClass().getName());
                    Certificate[] chain = ks.getCertificateChain(aliasKey);
            System.out.println(ks.getProvider().getName());
            System.out.println("No of certificates found from Personal MS Keystore: " + i);
            Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");//, ks.getProvider().getName());       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                rsaCipher.init(Cipher.WRAP_MODE, RSAPubKey);
            byte[] keyBytes =
                1, 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 8, 9
            SecretKey aeskey = new SecretKeySpec(keyBytes, "AES");
            byte[] encryptedSymmKey = rsaCipher.wrap(aeskey);
            System.out.println("Encrypted Symmetric Key :" + Arrays.toString(encryptedSymmKey));
            System.out.println("Encrypted Symmetric Key Length in Bytes: " + encryptedSymmKey.length);
            // RSA Decryption of Encrypted Symmetric AES key
            Cipher unwrapRsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding", ks.getProvider().getName());       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            unwrapRsaCipher.init(Cipher.UNWRAP_MODE, RSAPrivKey);
            Key decryptedKey = unwrapRsaCipher.unwrap(encryptedSymmKey, "AES", Cipher.SECRET_KEY);
            System.out.println("Decrypted Symmetric Key :" + Arrays.toString(decryptedKey.getEncoded())); // Matches the 'keyBytes' above

  • Invalid Argument Exception on Java API's DB Close

    When closing the database via the Java API's close method, I am getting an invalid argument exception... how can this be fixed... subsequent access to the DB causes the JVM to crash??
    ERROR: An exception has occurred: java.lang.IllegalArgumentException: Invalid argument
    java.lang.IllegalArgumentException: Invalid argument
    at com.sleepycat.db.internal.db_javaJNI.DbEnv_close0(Native Method)
    at com.sleepycat.db.internal.DbEnv.close0(DbEnv.java:217)
    at com.sleepycat.db.internal.DbEnv.close(DbEnv.java:77)
    at com.sleepycat.db.Environment.close(Environment.java:39)
    at com.sleepycat.dbxml.XmlManager.closeInternal(XmlManager.java:301)
    at com.sleepycat.dbxml.XmlManager.delete(XmlManager.java:33)
    at com.sleepycat.dbxml.XmlManager.close(XmlManager.java:310)
    at com.iconnect.data.adapters.BerkleyXMLDBImpl.insert(BerkleyXMLDBImpl.java:827)
    at com.iconnect.data.DataManagerFactory.insert(DataManagerFactory.java:182)
    at Xindice2Berkley.main(Xindice2Berkley.java:99)

    I had the same problem. I could fix it by carefully calling the delete() function on all those DBXML Xml..xyz objects that you create when you perform queries etc. It seems that those Java objects have some 'shadow' object in the underlying DLL and by calling delete() you free resources that remain otherwise assigned (maybe somebody with a C++ background who programmed this stuff?). Call delete() before the Java object gets out of scope. For instance:
    results = mgr.query(collection,context,null);
    XmlValue value;
    try {
    while ((value = results.next()) != null) {
    XmlValue c = value.getFirstChild();
    String ref = c.getNodeValue();
    c.delete(); c = null;
    value.delete(); value = null;
    catch (Exception e) {
    finally {
    if (results != null) {
    results.delete();
    results = null;
    Once i did this on all possible dbxml objects i used in my code, the java.lang.IllegalArgumentException: Invalid argument disappeared.
    Message was edited by:
    user562374

  • Invalid class file format... major.minor version '49.0' is too recent ...

    I am using the Eclipse 3.1 and Oracel BPEL designer 0.9.13
    After I created a new BPEL process (named: trybpel), I got the following output in the console:
    uildfile: D:\eclipse\workspace\trybpel\build.xml
    main:
    [bpelc] &#27491;&#22312;&#39564;&#35777; "D:\eclipse\workspace\trybpel\trybpel.bpel" ...
    [bpelc] error: Invalid class file format in D:\Java\jre1.5.0\lib\rt.jar(java/lang/Object.class). The major.minor version '49.0' is too recent for this tool to understand.
    [bpelc] error: Class java.lang.Object not found in class com.collaxa.cube.engine.core.BaseCubeProcess.
    [bpelc] 2 errors
    BUILD FAILED: D:\eclipse\workspace\trybpel\build.xml:28: ORABPEL-01005
    Total time: 8 seconds
    I am puzzled with the information in bold. Would anyone tell me how to fix this problem? Thank you very much.

    the same error ORABPEL-01005, but not the same error message,
    Errors occurred when compile the bpel process using bpel designer for Eclipse:
    (com.oracle.bpel.designer_0.9.13)
    using PM: bpel_jboss_101200
    More error infomation following:
    Buildfile: E:\OraBpelDEclipse3.2\workspace\AboutTest\build.xml
    main:
    [bpelc] E:\OraBpelDEclipse3.2\workspace\AboutTest\temp\bpelc762.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:835: Invalid expression statement.
    [bpelc] retun true;
    [bpelc] ^
    [bpelc] E:\OraBpelDEclipse3.2\workspace\AboutTest\temp\bpelc762.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:835: ';' expected.
    [bpelc] retun true;
    [bpelc] ^
    [bpelc] E:\OraBpelDEclipse3.2\workspace\AboutTest\temp\bpelc762.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:208: Method setPartneLinkBinding(com.collaxa.cube.rm.suitcase.PartnerLinkBindingDescriptor) not found in class com.collaxa.cube.engine.types.bpel.CXPartnerLink.
    [bpelc] __pl.setPartneLinkBinding(getProcessDescriptor().getPartnerLinkBindings().getPartnerLinkBinding(__pl.getName()));
    [bpelc] ^
    [bpelc] E:\OraBpelDEclipse3.2\workspace\AboutTest\temp\bpelc762.tmp\BPEL-INF\src\bpel\p0\BPEL_BIN.java:584: Undefined variable: __ctx
    [bpelc] __setOutgoingLinks(__sc, __ctx);
    [bpelc] ^
    [bpelc] 4 errors
    BUILD FAILED
    E:\OraBpelDEclipse3.2\workspace\AboutTest\build.xml:28: ORABPEL-01005
    Error in java files auto-generated when compiling ,why?
    Thanks!

  • BindingException - Invalid Class Received

    Hello friends -
    I'm currently getting the following error at servicegen ant time:
    weblogic.xml.schema.binding.BindingExceptio
    n: Invalid class received: interface java.util.Enumeration loaded from file:/C:/bea/jdk1
    41_05/jre/lib/rt.jar!/java/util/Enumeration.class. All classes that will be serialized
    or deserialized must be non-interface, non-abstract classes that provide a public default constructor
    I've done some reading, but most of what I find seems to indicate that this is an issue with wanting to return an unserializable object type from a web service. In my case, I simply want to use a Properties object inside of my web service to retrieve values that would be useful to change without a recompilation. My input and output do not include Enumeration type objects. If I modify my methods to use hardcoded values instead of opening a file using Properties, servicegen will compile the web service fine.
    I've also seen some postings indicating this could be a classpath related issue, but have yet to make progress on that end either.
    Is it impossible to use / reference any object which does not implement serializable within a web service, even if your input or return types do not utilize these objects?
    Any and all guidance is appreciated.
    Thanks!
    cm

    I think it is too late to respond but this is what i relize at this point.I am getting the same error but with java.util.Map the reason is these are not supported data types by servicegen so you need to write a data type.Please let me know if you resolved this issue if so How?

  • Invalid Key Exception for DES Encryption during cipher initialization.

    All,
    We are trying to implement DES Encryption in IBM Mainframe Z series. The code looks like...
    <code>
    public String encrypt(String input){
    String outputStr = null;
    SecretKeySpec keySpec = null;
    SecretKeyFactory keyFactory = null;
    SecretKey key = null;
    keySpec = new SecretKeySpec(keyPassword.getBytes("ISO-8859-1"), "DES");
    Cipher cipher = Cipher.getInstance("DES","IBMJCE");
    cipher.init(Cipher.ENCRYPT_MODE, key);
    BASE64Encoder encode = new BASE64Encoder();
    output = cipher.doFinal(input.getBytes("ISO-8859-1"));
    outputStr = encode.encode(output);
    </code> with relevant try catch etc.
    However we are getting an exception -
    java.security.InvalidKeyException
    at com.ibm.crypto.provider.DESCipher.engineGetKeySize(Unknown Source)
    at javax.crypto.Cipher.init(Unknown Source)
    The same code is working in Windows.
    Please let us know if there s anything wrong - or there is a work-around.
    JDK Version in Mainframe is 1.4
    Thanks
    Srini

    DES keys are 8 bytes with the Least Significant Bit (LSB) of each byte being used as a parity bit but taking no part in the encryption process. DES keys are binary data and are normally provided as bytes and not as a String object. If 'keyPassword' does not reference a String containing exactly 8 ISO-8859-1 characters then you will get the Invalid Key Exception since the key has to be exactly 8 bytes.
    I have to ask why you don't have exactly 8 characters in your password? The fact that your code talks of passwords and not key-bytes hints that you should maybe be using Password Based Encryption (PBE).

  • ASP Error message: Invalid class string

    Server object, ASP 0177 (0x800401F3)
    Invalid class string
    /asap/admin/insert.asp
    I have seen that the installation of MSXML 2.0 may be the solution to this error message I am getting. How do I go about installing this? I have downloaded and thought I installed, but still get this message. Anybody else seen this and know of possible solution?
    Please help...

    I just noticed the customer is on PL39 and the version I am on here is PL43.  Could that be presenting a problem?
    Thanks,
    EJD

  • Operations Manager failed to run a WMI query-Invalid class

    Hi Team,
    may of the windows 2008 R2 sp1 and sp2 servers getting below SCOM 2012 alert. Please help me to fix the same.
    SCOM version : SCOM 2012 R2
    Alert: Operations Manager failed to run a WMI query
    Source: server Name
    Path: server Name
    Last modified by: System
    Last modified time: 2/6/2014 8:33:22 AM
    Alert description: Object enumeration failed
    Query: 'SELECT * FROM MetaFrame_Server WHERE ServerName="server Name"'
    HRESULT: 0x80041010
    Details: Invalid class
    One or more workflows were affected by this.
    Workflow name: Citrix.PresentationServer.ActiveSessions.PerformanceMonitor

    First try it with WBEMTEST to see what is going with the WMI class. The error you are getting usually means WMI misses that class and you should load the mof again/ maybe rebuild the entire repository (careful as the windows files are all located
    on 1 folder, but applications tend to store it in their own folders, like citrix, ibm, etc).
    Try to run this command:
    mofcomp "<Programfiles>\Citrix\System32\Citrix\WMI\ .Mof file for citrix"
    {citrixProv.XP10FR3.mof, metaframeProv.XP10FR3.mof, and mgmt.XP10FR4.mof files}
    Then, run the WBEMTest again and the namespace should be returned successfully. Then restarting the health service on agent.
    Also you can refer below link
    https://support.citrix.com/article/CTX122283
    Please remember, if you see a post that helped you please click (Vote As Helpful) and if it answered your question, please click (Mark As Answer).

  • VeriSign Java Object Signing (Class 3) Digital ID

    Hi,
    I have a VeriSign Java Object Signing (Class 3) Digital ID.
    How do i convert this to a file i can use for signing?
    I previously had a '.p12' file and used jarsigner which worked.
    Any help would be greatly appreciated!
    Thanks,
    J

    I just received our Verisign "Java Object Signing
    (Class 3) Digital ID". When I try to import it I get
    the following error:
    keytool error: java.lang.Exception: Input not an X.509
    certificate.
    The command I am using to import the cert is :
    keytool -import -alias pcs -file cert.cer -keystore
    vs.keystore -trustcacerts
    Any idea what I am doing wrong? I am using JDK 1.3,
    do I need to upgrade to 1.4 to import certs currently
    being provided by Verisign?
    Thanks,
    JimIf you did as I did and ordered a rsa certificate, you need to add the option
    -keyalg rsa
    to your command line.
    lmd

  • How to resolve preverifying class exception while building

    Hi,
    I am new to J2ME, i am getting preverifying class exception when ever building a application using Wireless Toolkit 2.1, JDK1.5, CLDC 1.1.
    actually i need to run web application on mobiles (PDA), can any one suggests how to resolve the above exception and what are the jar files required in classpath.
    Please let me know.
    Thanks
    ST_Reddy.

    Then leave it as it is. If the method doesn't throw the exception it is not a problem.
    If you need to throw the exception in some rare cases, then throw RuntimeException. It is not required to declare such exception in interface.

Maybe you are looking for