Exception problems utilizing javax.swing.UIManager

I am in the process of creating a simple console environment for a certain application that runs in windows mainly but programmed in Java. Am trying to set the LookAndFeel to windows but it keeps throwing a java.lang.ClassNotFoundException_.
try {
        javax.swing.UIManager.setLookAndFeel("com.sun.java.plat.windows.WindowsClassicLookAndFeel");
} catch (Exception e) { System.err.println("Error: "+e); }After thinking I just simply didn't have the package installed correctly I wrote a simple app to check...
public static void main(String[] args) {
     javax.swing.UIManager.LookAndFeelInfo[] info = javax.swing.UIManager.getInstalledLookAndFeels();
     for(int i=0; i<info.length;i++){
          String LFname = info.getName();
          String className = info[i].getClassName();
          System.out.println(LFname+" : "+className);
}This gave me the output...Metal : javax.swing.plaf.metal.MetalLookAndFeel
CDE/Motif : com.sun.java.swing.plaf.motif.MotifLookAndFeel
Windows : com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Windows Classic : com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeelSo I can only assume that I have the the necessary resources installed correctly. Any thoughts on what might be causing my problem?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

So I can only assume that I have the the necessary resources installed correctly. Any thoughts on what might be causing my problem?
com.sun.java.plat.windows.WindowsClassicLookAndFeel // the class you're trying to set
com.sun.java.plaf.windows.WindowsClassicLookAndFeel // the class that is actually availableSee the difference?
~

Similar Messages

  • Exception at javax.swing.UIManager.setLookAndFeel(UIManager.java:435)

    Only in one machine (AIX 5.2 with J2RE 1.3.1 IBM) I got the following exception:
    "main" (TID:0x300C19D8, sys_thread_t:0x3003EF58, state:R, native ID:0x1) prio=5
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:105)
         at sun.awt.X11GraphicsEnvironment.<init>(X11GraphicsEnvironment.java:82)
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Class.java:262)
         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:72)
         at java.awt.Font.initializeFont(Font.java:285)
         at java.awt.Font.<init>(Font.java:319)
         at javax.swing.plaf.FontUIResource.<init>(FontUIResource.java:51)
         at javax.swing.plaf.basic.BasicLookAndFeel.getFont(BasicLookAndFeel.java:252)
         at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:271)
         at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:210)
         at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:80)
         at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1088)
         at javax.swing.UIManager.setLookAndFeel(UIManager.java:408)
         at javax.swing.UIManager.setLookAndFeel(UIManager.java:435)
    Other machine works fine.
    Any suggestion?
    Grazie

    So I can only assume that I have the the necessary resources installed correctly. Any thoughts on what might be causing my problem?
    com.sun.java.plat.windows.WindowsClassicLookAndFeel // the class you're trying to set
    com.sun.java.plaf.windows.WindowsClassicLookAndFeel // the class that is actually availableSee the difference?
    ~

  • Why can i not get the class javax/swing/UImanager from installanywhere??

    I use Installanywhere to pack my program,but when i double-click the short-cut,it says no class found :javax/swing/UImanage.
    anybody can tell what happened?
    thanks.

    who can help me ? none want to help me.

  • Javax.swing.KeyStroke

    When i use Swing with PJ i get some errors about javax.swing.KeyStroke:
    java.lang.NoSuchFieldException
    at java.lang.Class.getField()
    at javax.swing.KeyStroke.getKeyStroke()
    at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults()
    at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults()
    at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults()
    at javax.swing.UIManager.setLookAndFeel()
    at javax.swing.UIManager.setLookAndFeel()
    at javax.swing.UIManager.initializeDefaultLAF()
    at javax.swing.UIManager.initialize()
    at javax.swing.UIManager.maybeInitialize()
    at javax.swing.UIManager.getUI()
    at javax.swing.JPanel.updateUI()
    at javax.swing.JPanel.<init>()
    at javax.swing.JPanel.<init>()
    at javax.swing.JRootPane.createGlassPane()
    at javax.swing.JRootPane.<init>()
    at javax.swing.JFrame.createRootPane()
    at javax.swing.JFrame.frameInit()
    at javax.swing.JFrame.<init>()
    java.lang.Error: Unrecognized keycode name: VK_KP_LEFT
    at javax.swing.KeyStroke.getKeyStroke()
    at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults()
    at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults()
    at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults()
    at javax.swing.UIManager.setLookAndFeel()
    at javax.swing.UIManager.setLookAndFeel()
    at javax.swing.UIManager.initializeDefaultLAF()
    at javax.swing.UIManager.initialize()
    at javax.swing.UIManager.maybeInitialize()
    at javax.swing.UIManager.getUI()
    at javax.swing.JPanel.updateUI()
    at javax.swing.JPanel.<init>()
    at javax.swing.JPanel.<init>()
    at javax.swing.JRootPane.createGlassPane()
    at javax.swing.JRootPane.<init>()
    at javax.swing.JFrame.createRootPane()
    at javax.swing.JFrame.frameInit()
    at javax.swing.JFrame.<init>()
    Could someone help me?

    Refer to the bug database (bugid = 4309057)
    http://developer.java.sun.com/developer/bugParade/bugs/4309057.html
    Here the workaround:
    Fix the problem yourself by changing SwingUtilites to test for "Class.getPackage" which is 1.2 specific and has not been introduced to pJava:
    Method m = Class.class.getMethod("getPackage", null);Re-Jar the swingclasses and enjoy your Swing application running on PersonalJava....
    Herbie

  • Javaclassnotfound javax.swing.JPanel in a applet

    Hi,
    I have a applet which use a class which have the code
    import javax.swing.JPanel;
    public class WebPanel extends JPanel implements Runnable{
    Applet parent;
    i compile it with jdk1.2.2
    my problem is that when i try to run the applet on a Internet Explorer navigator it give me a
    javaclassnotfound javax.swing.JPanel
    problem.
    Javax.swing.JPanel is�nt in IExploter?
    Should i put the javax.swing.Jpanel class in the jar fije?
    Where i can find it?
    Thanks in advance.

    forgot to mention this...get the plug in here:
    http://java.sun.com/products/plugin/
    read the intstructions, u might have to do some 'applet conversion' ....u'll know what I mean when u install the plugin
    good luck

  • UIManager.look and feel buttons or javax.swing

    Hey,
    i want to use the ok, cancel etc. button that you get in a JFileChooser or a JOptionPane.
    Can they be found in the UIManager or in the javax.swing?
    i tried to extract them from the JFileChooser by:
    JFileChooser chooser = new JFileChooser("/"); //Linux
    JPanel mypanel = new JPanel();
    mypanel.add(chooser.getComponentAt(2)); //the button panelthis works, but i don't know how to overwrite the actionlistener to make the buttons listen to my actionlistener.
    thanks in advance
    Grad_

    It returns an int value according to what button was clicked
    http://72.5.124.55/docs/books/tutorial/uiswing/components/filechooser.html
    http://java.sun.com/developer/JDCTechTips/2004/tt0316.html

  • Problem Loading an Image with javax Swing from a JApplet

    First of all, i use JCreator as java creater and have the newest version of java sdk version.
    Now i need to load an image from the harddrive on which the JApplet is located. I need to do this from inside the JApplet. I have put my pictures in a map 'images' which is located in the same directory as the classes + htm file. It works from inside JCreator, but as soon as i open the normal htm it just WON'T load that image (grmbl).
    Here is my code for loading the image:
    public BufferedImage loadImage (String filename, int transparency)
         Image image;
         if (app)
              image = Toolkit.getDefaultToolkit().getImage(("./images/"+filename));
         else
              String location = "";
              location = "./images/"+filename;
              image = Toolkit.getDefaultToolkit().getImage(location);
         MediaTracker mediaTracker = new MediaTracker(new Container());
         mediaTracker.addImage(image, 0);
         try
              mediaTracker.waitForID(0);
         catch (Exception e)
    Could anybody help me out here??
    I tried a url already using getCodeBase() or getDocumentBase() but that gives an error because it cannot find those if using a JApplet.

    Why don't you use javax.swing.ImageIcon? If you already have a flag telling if it's an application or applet, use the getDocumentBase() to base the URL in the applet part only.

  • Javax.swing.GroupLayout - problem

    Hi
    Puzzling problem has occurred when developing the same application on different PC�s and using the same IDE (Netbeans 5.5) on both.
    The problem is that the �javax.swing.GroupLayout� class is being used when inserting netbeans GUI components on one of the PC�s. However, the other PC uses �org.jdesktop.layout.GroupLayout� and generates an error when trying to compile the �javax.swing.GroupLayout� components. It cannot find the javax.swing.GroupLayout� class.
    The jdk is jdk 6 for both.
    Can anyone shed any light on this?
    Regards
    GB

    Did you check the project properties?
    Project properties | Categories: Libraries --> Java Platform: JDK 1.6
    (javax.swing.GroupLayout works only with 1.6)

  • Import javax.swing problems

    hey
    I am new to java and have recently downloaded j2sdk1.4.2_04. I am trying to create a simple graphical application. However, It doesnt seem to import the javax.swing.* libraries. I understand that there is the src.zip in the directory, so I unzipped it but it still doesn't read the package. I read elsewhere on this forum that you should set the path to src.zip. I have tried that and it also doesnt work. My current path is:
    PATH=C:\j2sdk1.4.2_04\lib\src.zip;C:\j2sdk1.4.2_04\bin
    Is there an error in this, or what else should I try? All suggestions greatly appreciated.

    There's no need to set your classpath when importing any of the standard packages that are provided by the JDK. Perhaps you could post a (small) code sample and the compiler error you are getting.

  • Javax.swing.JTextPane - COLOR Problem

    Hi
    I am using javax.swing.JTextPane object to display text recieved from two servers.
    How can I make messages recieved from Server 1 to be in RED and while from Server 2
    to be in Green? i.e. the window should look...
    (red) Server 1 says ta ta
    (green) Server 2 says Hello
    My code looks....
    javax.swing.JTextPane WINDOW;
    String message1 = connection1.getMessage();
    ..........// What code should I put here??? to make this message look RED??
    ..........// Color of previous text should remain as it is...
    WINDOW.setText(WINDOW.getText() + message1);An Example would be highly appreciated.
    Regards
    Fahad

    Hi,
    that is the wrong way - try this method in your JTextPane subclass
    public void appendText(String s,Color col) {
    StyledDocument sd = getStyledDocument();
    SimpleAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setForground(attr,col);
    try { sd.insertString(sd.getLength(),s,attr); }
    catch (BadLocationException e) {}
    } // end of methodand use it in your code like that
    WINDOW.appendText(message1,Color.red);
    hope that helps
    greetings Marsian

  • 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

  • Javax.swing.text.TableView bug in 1.4 beta 2 ?

    Hi,
    I derived a class from TableView, which worked fine with 1.3, but now causes the following exception as soon as being layouted:
    java.lang.Error: should not happen: class com.lexetius.swing.text.LexTableView
    at javax.swing.text.BoxView.baselineLayout(Unknown Source)
    at javax.swing.text.ParagraphView$Row.layoutMinorAxis(Unknown Source)
    at javax.swing.text.BoxView.setSpanOnAxis(Unknown Source)
    at javax.swing.text.BoxView.layout(Unknown Source)
    at javax.swing.text.BoxView.setSize(Unknown Source)
    at javax.swing.text.BoxView.updateChildSizes(Unknown Source)
    at javax.swing.text.BoxView.setSpanOnAxis(Unknown Source)
    at javax.swing.text.BoxView.layout(Unknown Source)
    at javax.swing.text.FlowView.layout(Unknown Source)
    at javax.swing.text.BoxView.setSize(Unknown Source)
    at javax.swing.text.BoxView.updateChildSizes(Unknown Source)
    at javax.swing.text.BoxView.setSpanOnAxis(Unknown Source)
    at javax.swing.text.BoxView.layout(Unknown Source)
    at javax.swing.text.BoxView.setSize(Unknown Source)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(Unknown Source)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(Unknown Source)
    at javax.swing.JComponent.getPreferredSize(Unknown Source)
    at javax.swing.JEditorPane.getPreferredSize(Unknown Source)
    at javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
    at java.awt.Container.layout(Unknown Source)
    at java.awt.Container.doLayout(Unknown Source)
    at java.awt.Container.validateTree(Unknown Source)
    at java.awt.Container.validate(Unknown Source)
    at javax.swing.RepaintManager.validateInvalidComponents(Unknown Source)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknow
    n Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    any ideas???

    I wrote the com.lexetius.swing.text.LexTableView component myself. It is derived directly from javax.swing.text.TableView and it adds virtually no functionality. I'm quite sure, the problem comes from the TableView class, but I can't verify that directly, since this class is abstract (why is that, anyway??).
    It would certainly help me very much, if anybody had a component, which is also derived from javax.swing.text.TableView and works with the 1.4 beta.

  • [HELP! ] why my program thows a javax.swing.text.ChangedCharSetException?

    there's the source:
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.border.*;
    class HTMLMagician extends JFrame
         protected static final String APP_NAME="HTML Magician V1.0 Produced By V Studio";
         protected JTextPane hm_textPane;
         protected StyleSheet hm_styleSheet;
         protected HTMLEditorKit html_kit;
         protected HTMLDocument html_document;
         protected JMenuBar hm_menuBar;
         protected JToolBar hm_toolBar;
         protected JFileChooser hm_fileChooser;
         protected File current_file;
         protected boolean text_changed=false;
         public HTMLMagician()
              super(APP_NAME);
              setSize(800,600);
              getContentPane().setLayout(new BorderLayout());
              produceMenuBar();
              hm_textPane=new JTextPane();
              html_kit=new HTMLEditorKit();
              hm_textPane.setEditorKit(html_kit);
              JScrollPane textPane_scrollPane=new JScrollPane();
              textPane_scrollPane.getViewport().add(hm_textPane);
              getContentPane().add(textPane_scrollPane,BorderLayout.CENTER);
              hm_fileChooser=new JFileChooser();
              javax.swing.filechooser.FileFilter hm_filter=new javax.swing.filechooser.FileFilter()
                   public boolean accept(File pathname)
                        if(pathname.isDirectory())
                             return true;
                        String ext_name=pathname.getName().toLowerCase();
                        if(ext_name.endsWith(".htm"))
                             return true;
                        if(ext_name.endsWith(".html"))
                             return true;
                        if(ext_name.endsWith(".asp"))
                             return true;
                        if(ext_name.endsWith(".jsp"))
                             return true;
                        if(ext_name.endsWith(".css"))
                             return true;
                        if(ext_name.endsWith(".php"))
                             return true;
                        if(ext_name.endsWith(".aspx"))
                             return true;
                        if(ext_name.endsWith(".xml"))
                             return true;
                        if(ext_name.endsWith(".txt"))
                             return true;
                        return false;
                   public String getDescription()
                        return "HTML files(*.htm,*.html,*.asp,*.jsp,*.css,*.php,*.aspx,*.xml)";
              hm_fileChooser.setAcceptAllFileFilterUsed(false);
              hm_fileChooser.setFileFilter(hm_filter);
              try
                   File dir=(new File(".")).getCanonicalFile();
                   hm_fileChooser.setCurrentDirectory(dir);
              }catch(IOException ex)
                   showError(ex,"Error openning current directory");
              newDocument();
              WindowListener action_winClose=new WindowAdapter()
                   public void windowClosing(WindowEvent evt)
                        if(!promptToSave())
                             return;
                        System.exit(0);
              addWindowListener(action_winClose);
              setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              setVisible(true);
         protected void produceMenuBar()
              hm_menuBar=new JMenuBar();
              hm_toolBar=new JToolBar();
              JMenu menu_file=new JMenu("File");
              menu_file.setMnemonic('f');
              ImageIcon icon_new=new ImageIcon("imgs/file.gif");
              Action action_new=new AbstractAction("New",icon_new)
                   public void actionPerformed(ActionEvent evt)
                        if(!promptToSave())
                             return;
                        newDocument();
              JMenuItem item_new=new JMenuItem(action_new);
              item_new.setMnemonic('n');
              item_new.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,InputEvent.CTRL_MASK));
              menu_file.add(item_new);
              JButton button_new=hm_toolBar.add(action_new);
              ImageIcon icon_open=new ImageIcon("imgs/folder_open.gif");
              Action action_open=new AbstractAction("Open...",icon_open)
                   public void actionPerformed(ActionEvent evt)
                        if(!promptToSave())
                             return;
                        openDocument();
              JMenuItem item_open=new JMenuItem(action_open);
              item_open.setMnemonic('o');
              item_open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,InputEvent.CTRL_MASK));
              menu_file.add(item_open);
              JButton button_open=hm_toolBar.add(action_open);
              ImageIcon icon_save=new ImageIcon("imgs/floppy.gif");
              Action action_save=new AbstractAction("Save",icon_save)
                   public void actionPerformed(ActionEvent evt)
                        saveAs(false);
              JMenuItem item_save=new JMenuItem(action_save);
              item_save.setMnemonic('s');
              item_save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,InputEvent.CTRL_MASK));
              menu_file.add(item_save);
              JButton button_save=hm_toolBar.add(action_save);
              Action action_saveAs=new AbstractAction("Save As...")
                   public void actionPerformed(ActionEvent evt)
                        saveAs(true);
              JMenuItem item_saveAs=new JMenuItem(action_saveAs);
              item_saveAs.setMnemonic('a');
              item_saveAs.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,InputEvent.CTRL_MASK));
              menu_file.add(item_saveAs);
              menu_file.addSeparator();
              Action action_close=new AbstractAction("Quit")
                   public void actionPerformed(ActionEvent evt)
                        if(!promptToSave())
                             return;
                        System.exit(0);
              JMenuItem item_exit=new JMenuItem(action_close);
              item_exit.setMnemonic('q');
              item_exit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,InputEvent.CTRL_MASK));
              menu_file.add(item_exit);
              hm_menuBar.add(menu_file);
              setJMenuBar(hm_menuBar);
              getContentPane().add(hm_toolBar,BorderLayout.NORTH);
         protected String getDocumentName()
              return current_file==null ? "Untitled" : current_file.getName();
         protected void newDocument()
              html_document=(HTMLDocument)html_kit.createDefaultDocument();
              hm_styleSheet=html_document.getStyleSheet();
              hm_textPane.setDocument(html_document);
              current_file=null;
              setTitle(getDocumentName()+" - "+APP_NAME);
              Runnable runner=new Runnable()
                   public void run()
                        text_changed=false;
                        html_document.addDocumentListener(new action_textChanged());
              SwingUtilities.invokeLater(runner);
         protected void openDocument()
              if(hm_fileChooser.showOpenDialog(HTMLMagician.this)!=JFileChooser.APPROVE_OPTION)
                   return;
              File f=hm_fileChooser.getSelectedFile();
              if(f==null || !f.isFile())
                   return;
              current_file=f;
              setTitle(getDocumentName()+" - "+APP_NAME);
              HTMLMagician.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
              try
                   InputStream in=new FileInputStream(current_file);
                   html_document=(HTMLDocument)html_kit.createDefaultDocument();
                   html_kit.read(in,html_document,0);
                   hm_styleSheet=html_document.getStyleSheet();
                   hm_textPane.setDocument(html_document);
                   in.close();
              }catch(Exception ex)
                   showError(ex,"Error openning file "+current_file);
              HTMLMagician.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
              Runnable runner=new Runnable()
                   public void run()
                        text_changed=false;
                        html_document.addDocumentListener(new action_textChanged());
              SwingUtilities.invokeLater(runner);
         protected boolean saveAs(boolean as)
              if(!as && !text_changed)
                   return true;
              if(as || current_file==null)
                   if(hm_fileChooser.showSaveDialog(HTMLMagician.this)!=JFileChooser.APPROVE_OPTION)
                        return false;
                   File f=hm_fileChooser.getSelectedFile();
                   if(f==null || !f.isFile())
                        return false;
                   current_file=f;
                   setTitle(getDocumentName()+" - "+APP_NAME);
              HTMLMagician.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
              try
                   OutputStream out=new FileOutputStream(current_file);
                   html_kit.write(out,html_document,0,html_document.getLength());
                   out.close();
              }catch(Exception ex)
                   showError(ex,"Error saving file "+current_file);
              HTMLMagician.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
              return true;
         protected boolean promptToSave()
              if(!text_changed)
                   return true;
              int result=JOptionPane.showConfirmDialog(this,"Save change to "+getDocumentName(),APP_NAME,JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE);
              switch(result)
                   case JOptionPane.YES_OPTION:
                        if(!saveAs(false))
                             return false;
                        return true;
                   case JOptionPane.NO_OPTION:
                        return true;
                   case JOptionPane.CANCEL_OPTION:
                        return false;
              return true;
         protected void showError(Exception ex,String message)
              ex.printStackTrace();
              JOptionPane.showMessageDialog(this,message,APP_NAME,JOptionPane.WARNING_MESSAGE);
         public static void main(String[] args)
              new HTMLMagician();
         class action_textChanged implements DocumentListener
              public void changedUpdate(DocumentEvent evt)
                   text_changed=true;
              public void insertUpdate(DocumentEvent evt)
                   text_changed=true;
              public void removeUpdate(DocumentEvent evt)
                   text_changed=true;
    when i open a .html file,the command output :
    javax.swing.text.ChangedCharSetException
         at javax.swing.text.html.parser.DocumentParser.handleEmptyTag(Unknown Source)
         at javax.swing.text.html.parser.Parser.startTag(Unknown Source)
         at javax.swing.text.html.parser.Parser.parseTag(Unknown Source)
         at javax.swing.text.html.parser.Parser.parseContent(Unknown Source)
         at javax.swing.text.html.parser.Parser.parse(Unknown Source)
         at javax.swing.text.html.parser.DocumentParser.parse(Unknown Source)
         at javax.swing.text.html.parser.ParserDelegator.parse(Unknown Source)
         at javax.swing.text.html.HTMLEditorKit.read(Unknown Source)
         at javax.swing.text.DefaultEditorKit.read(Unknown Source)
         at HTMLMagician.openDocument(HTMLMagician.java:222)
         at HTMLMagician$4.actionPerformed(HTMLMagician.java:128)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    why? what's wrong? thanks

    The DocumentParser seems to throw a ChangedCharSetException if it finds a "http-equiv" meta tag for "content-type" or "charset" and if the parser's "ignoreCharSet" property is set to false on creation.

  • AAARGH!!! Can't understand javax.swing.text.*

    Good afternoon...
    does anybody understand javax.swing.text classes? i've read a number of
    books, downloaded docs (including those from the javax.swing.text author), and googled everything i could think of. but nothing seems to explain it to me so that i can understand it! maybe i'm just dense, but maybe it really is that difficult.
    i want to create a read-only document, who's source is not necessarily a
    string, but perhaps an ArrayList of objects with a HashMap of attributes. or even something simpler for now, just an object with a fixed number of attributes. i want to display this information in a JTextArea. i tried implementing a Document and passing it to the JTextArea constructor but just got a NullPointerException.
    does anybody know where i can find more information on creating my own
    document types?
    here's the code for my ReadOnlyDocument class if anyone of you are generous (& adventurous) enough to take a look:
    import java.util.ArrayList;
    import javax.swing.event.DocumentListener;
    import javax.swing.event.UndoableEditListener;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.Element;
    import javax.swing.text.Position;
    import javax.swing.text.Segment;
    public class ReadOnlyDocument implements Document{
        private String myContent = "this is the contents of my document!";
        private ArrayList listeners;
        private ReadOnlyDocument refSelf = this;
        public ReadOnlyDocument() {
         System.out.println("ReadOnlyDocument.<init>");
        public int getLength() {
         System.out.println("ReadOnlyDocument.getLength() = " + myContent.length());
            return myContent.length();
        public void addDocumentListener(DocumentListener listener) {
         System.out.println("ReadOnlyDocument.addDocumentListener(" + listener + ")");
            if (listeners != null) {
                listeners = new ArrayList();
                listeners.add(listener);
            } else {
                listeners = new ArrayList();
                listeners.add(listener);
        public void removeDocumentListener(DocumentListener listener) {
         System.out.println("ReadOnlyDocument.removeDocumentListener(" +
    listener + ")");
            if (listeners != null) {
                listeners.remove(listener);
        public void addUndoableEditListener(UndoableEditListener listener) {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.addUndoableEditListener(" +
    listener + ")");
        public void removeUndoableEditListener(UndoableEditListener listener) {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.removeUndoableEditListener(" +
    listener + ")");
        public Object getProperty(Object key) {
            System.out.println("ReadOnlyDocument.getProperty(" + key + ") =
    null");
            return null;
        public void putProperty(Object key, Object value) {
               System.out.println("ReadOnlyDocument.putProperty(" + key + ")");
        public void remove(int offs, int len) throws BadLocationException {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.remove(" + offs + ", " + len +
        public void insertString(int offset, String str, AttributeSet a) throws
    BadLocationException {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.insertString(" + offset + ", " +
    str + ", " + a + ")");
        public String getText(int offset, int length) throws
    BadLocationException {
         System.out.print("ReadOnlyDocument.getText(" + offset + ", " + length +
    ") = ");
            if ((offset >= 0) && (length >= 0) && (offset+length <=
    myContent.length()+1)) {
             System.out.println(myContent.substring(offset, offset+length-1));
                return myContent.substring(offset, offset+length-1);
            } else {
             System.out.println("BadLocationException!");
                throw new BadLocationException("Bad location requested", 0);
        public void getText(int offset, int length, Segment txt) throws
    BadLocationException {
         System.out.print("ReadOnlyDocument.getText(" + offset + ", " + length +
    ", " + txt + ") = ");
            if ((offset >= 0) && (length >= 0) && (offset+length <=
    myContent.length()+1)) {
             System.out.println(myContent.substring(offset, offset+length-1));
                txt = new Segment(myContent.toCharArray(), offset, length);
            } else {
             System.out.println("BadLocationException!");
                throw new BadLocationException("Bad location requested", 0);
        public Position getStartPosition() {
         System.out.println("ReadOnlyDocument.getStartPosition() = 0");
      return new Position() {
       public int getOffset() {
        return 0;
        public Position getEndPosition() {
         System.out.println("ReadOnlyDocument.getEndPosition() = " +
    myContent.length());
      return new Position() {
       public int getOffset() {
        return myContent.length();
        public Position createPosition(int offs) throws BadLocationException {
         System.out.println("ReadOnlyDocument.createPosition(" + offs + ") =
    0");
            if ((offs >= 0) && (offs <= myContent.length()-1)) {
       return new Position() {
        public int getOffset() {
         return 0;
      } else {
       throw new BadLocationException("Bad location requested", 0);
        public Element[] getRootElements() {
         System.out.println("ReadOnlyDocument.getRootElements()");
         Element[] roots = {new Element() {
       public Document getDocument() {
        return refSelf;
       public Element getParentElement() {
        return null;
       public String getName() {
        return "ReadOnlyRoot";
       public AttributeSet getAttributes() {
        return null;
       public int getStartOffset() {
        return 0;
       public int getEndOffset() {
        return myContent.length() - 1;
       public int getElementIndex(int offset) {
        return 0;
       public int getElementCount() {
        return 0;
       public Element getElement(int index) {
        return null;
       public boolean isLeaf() {
        return true;
      return roots;
        public Element getDefaultRootElement() {
         System.out.println("ReadOnlyDocument.getDefaultRootElement()");
      return new Element() {
       public Document getDocument() {
        return refSelf;
       public Element getParentElement() {
        return null;
       public String getName() {
        return "ReadOnlyRoot";
       public AttributeSet getAttributes() {
        return null;
       public int getStartOffset() {
        return 0;
       public int getEndOffset() {
        return myContent.length() - 1;
       public int getElementIndex(int offset) {
        return 0;
       public int getElementCount() {
        return 0;
       public Element getElement(int index) {
        return null;
       public boolean isLeaf() {
        return true;
        public void render(Runnable r) {
            // not sure what to put here
         System.out.println("ReadOnlyDocument.render(" + r + ")");
    }and here's a simple class to display the document/generate the error:
    import java.awt.event.*;
    import javax.swing.*;
    public class ReadOnlyFrame extends JFrame {
    public ReadOnlyFrame() {
      super();
      setTitle("Read Only Document");
      addWindowListener(new WindowAdapter() {
       public void windowClosed(WindowEvent e) {
        System.exit(0);
      getContentPane().add(new JTextArea(new ReadOnlyDocument()));
      setSize(200, 200);
    public static void main(String[] args) {
      ReadOnlyFrame rof = new ReadOnlyFrame();
      rof.setVisible(true);
    Headed for the second star to the right and straight on till morning...
    Eric Schultz
    aka: Storkman
    http://community.webshots.com/user/storky1
    mailto:EricSchultzATcanadaDOTcom

    if you are getting that print before the timer
    starts, then I'd expect it's not blocking. The
    problem with these small snippets of code is that we
    can't really tell what might be going on elsewhere.Yes, I realize that. AAMOF, there isn't anything going on elsewhere, i.e.
    the GestureController object spawns another thread when it gets
    created. That other thread blocks until a 'Mover' object is delivered to
    the GestureController object. The mutex/synchronizing stuff works
    like the textbook version, i.e. no deadlock, no deadly embrace, no
    nothing. When the timer is started, the Mover is supposed to
    call back the 'animate' method, just a method in the GestureController
    object.
    All the System.out.prints show that it gets there. The task (an ActionListener)
    dispatched by that timer doesn't start. As you can see above, I've
    used System.out.prints for that too. It is as if that Timer doesn't start.
    I still haven't found anything ... This is what the 'auto.move' thing is
    supposed to do:     static class DragMover implements Mover {
              DrawableStack from;
              DrawableStack to;
              int position;
              DragMover(DrawableStack from, int position, DrawableStack to) {
                   this.from= from;
                   this.to  = to;
                   this.position= position;
              public void move() {
                   System.out.println("moving the stuff...");
                   GestureController.getGestureController().animate(from, position, to);
              public void undo() { }          
         }... the line "moving stuff ..." isn't displayed either, i.e. the actionPerformed
    method is never called and then ... there's nothing in between there, i.e.
    the Timer is supposed to call that method.
    Thank you for your reply, much appreciated and,
    kind regards,
    Jos
    by that timer (an ActionListener)

  • Finder exception problem

    I'm having a problem using EJB2.0, under JBoss using the IntelliJ IDEA as my IDE.
    I'm getting a strange error when I try to login after making some changes to add a new enterprise java bean. I created the bean's Local and HomeLocal interfaces, abstract class project history bean, and added the entity and query tags to ejb-jar.xml deployment descriptor file. I have also added the table to the instance of the database on my home machine.
    For some strange reason, when I now try to login I get a finder exception from the user.findByPrimaryKey. This is a database table/EJB that has beeen part of the application forever. I have used the debug faculty to check the line where this method is called and it does contain the correct value for the method argument. The appropriate record is in the table, and the database and code have been updated with all recent changes. Any suggestions on where I should go from here to debug this? Have I missed some necessary step as far as adding a new EKB is concerned? Here's the error message and stack trace:
    19:57:14,312 ERROR [LogInterceptor] RuntimeException in method: public abstract lingonet.user.UserLocal lingonet.user.UserHomeLocal.findByPrimaryKey(java.lang.String) throws javax.ejb.FinderException:
    java.lang.IllegalStateException: createBeanClassInstanceCommand == null
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:560)
         at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:124)
         at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:224)
         at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:146)
         at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:96)
         at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
         at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
         at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
         at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:126)
         at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:99)
         at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
         at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
         at org.jboss.ejb.Container.invoke(Container.java:891)
         at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
         at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
         at $Proxy71.findByPrimaryKey(Unknown Source)
         at lingonet.beans.WebUserBean.login(WebUserBean.java:95)
         at lingonet.beans.WebUserBean.<init>(WebUserBean.java:78)
         at lingonet.LoginServlet.process(LoginServlet.java:40)
         at lingonet.LoginServlet.doGet(LoginServlet.java:29)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:619)

    Hi
    It's working on WLS6.0 SP2 very well.
    Macsym
    PenFriend <[email protected]> wrote:
    Macsym,
    this isa known issue Cr06867. As a workaround chamge the name of the
    methods to not start with
    a find.
    macsym wrote:
    I've tried to re-run it. In my
    classpath=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;
    but the problem still here. I'v just changed examples under WLS totest it.
    BTW I using WLS6.1 SP1.
    Thanks any way.
    Macsym
    Rob Woollen <rob@trebor_nelloow.moc> wrote:
    It looks like you need to re-run weblogic.ejbc. Also make sure that
    your classes are only
    in the ejb-jar file and not the server's classpath.
    Finally, what version of WLS are you using? It shouldn't be throwing
    an AssertionError for
    this.
    -- Rob
    macsym wrote:
    Hi
    I met a very funny problem. when I try to deploy a entity BMP.(compilewas ok).
    The bean have a method called findSubElements(this is not a findermethod). I
    got the a exception:
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ ejbFindXXXmethod
    for 'findSubElements(java.lang.String,jav
    a.lang.String,java.lang.String)' not found on class 'entity.XXXEntityBean_sgz73u_Impl'.
    what should I do to fix that ?
    Thanks for help.

Maybe you are looking for

  • Sftp on Solaris 10 with ssh_config(5) support?

    Solaris 10 comes with sftp as part of its image. Underneath, it uses sun-ssh, which supports ssh_config(4). Is there any patches/upgrades out there that supports ssh_config(5)? Thanks very much in advance for your help, pam

  • HT3743 My daughter has iphone 3G cannot download facebook keeps saying ios 4.3 needed how do i do it? Its driving me mad

    ios 4.3?

  • PSE Organizer sort order

    Using PSE 11. I am trying to sort my photos in order Newest first.  I select Sort by: Newest and they are sorted in newest DATE order but within each date they are sorted on oldest time order, which seems odd... how can I get PSE to sort so that Newe

  • Forecast error Messages

    Dear Friends: In forecast view, I got the folllowing error messages. 1.Model Choice Process 2 accessed 2.Initialization started 3.Ex-post Forecast carried out 4.Time series Characteristic changed. How to overcome the errors?Please advise. All the hel

  • Buying an iMac

    Hi Guys, Merry Christmas and a Happy New Year! Hopefully I'm chucking this into the right place. I'm a student at the moment, and already own an iBook. At the moment, my desktop is a Windows-based PC, but definately starting to show its age and compa