A weird running exception

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

A weird running exception

Postby lumino » Mon Jun 29, 2009 7:51 pm

I packaged my project into executable file toolv2.6.jar, and sent it to some persons. It's runnable for everybody except for my project manager. When he runs the jar file, everytime the exception comes out. Anybody who can help me, Please?
I have listed the EXCEPTION below.
The exception figures out something wrong with initMode(). Does it really need to change the argument for initMode()?
---------------------------------------------------------------------------------------------------------------------------
D:\>java -jar toolv2.6.jar

Exception in thread "main" java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.simontuffs.onejar.Boot.run(Boot.java:247)

at com.simontuffs.onejar.Boot.main(Boot.java:105)

Caused by: java.lang.IllegalArgumentException: initMode must be one of the follo

wing values - DockableBarContext.STATE_FLOATING, DockableBarContext.STATE_HIDDEN

, DockableBarContext.STATE_HORI_DOCKED or DockableBarContext.STATE_VERT_DOCKED

at com.jidesoft.action.DockableBarContext.setInitMode(Unknown Source)

at com.jidesoft.action.i.a(Unknown Source)

at com.jidesoft.action.DefaultDockableBarManager.a(Unknown Source)

at com.jidesoft.action.DefaultDockableBarManager.access$1700(Unknown Sou

rce)

at com.jidesoft.action.DefaultDockableBarManager$9.run(Unknown 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)
lumino
 
Posts: 4
Joined: Mon Jun 29, 2009 7:32 pm

Re: A weird running exception

Postby JIDE Support » Mon Jun 29, 2009 8:54 pm

Most likely the layout file is wrong. Do you have the layout file that you can post here as attachment?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36468
Joined: Sun Sep 14, 2003 10:49 am

Re: A weird running exception

Postby lumino » Mon Jun 29, 2009 11:22 pm

The code below, as u can see, I did set the initMode with parameter DockContext.STATE_HIDDEN
Here is the code: optionsFrame.getContext().setInitMode(DockContext.STATE_HIDDEN);
If my layout file was wrong, why there is only one guy who cannot run the jar file ?
Thanks

-----------------------------------------------------------------------------------------------------------

...
public static void main(String[] args) {



LookAndFeelFactory.installDefaultLookAndFeelAndExtension();

_frame = _frame == null ? new ConfigTool(TITLE) : _frame;

// add a widnow listener
_windowListener = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
super.windowClosing(e);
clearUp();
}
};
_frame.addWindowListener(_windowListener);
_frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
// create tabbed-document interface and add it to workspace area
// For those components you used to add to the CENTER of JFrame’s ContentPane
_documentPane = new DocumentPane();
//Workspace getWorkspace, container for a document windows
_frame.getDockingManager().getWorkspace().setLayout(new BorderLayout());
_frame.getDockingManager().getWorkspace().add((Component) _documentPane, BorderLayout.CENTER);
// add toolbar
// _frame.getDockableBarManager().addDockableBar(MenuFactory.createMenuCommandBar());
_frame.setJMenuBar(MenuFactory.createMenuCommandBar());

// add status bar
_statusBar = createStatusBar();
_frame.getContentPane().add(_statusBar, BorderLayout.AFTER_LAST_LINE);

// add all dockable frames
_frame.getDockingManager().addFrame(new ProjectFrame(PROJECT_DOCKABLEFRAME_KEY));
DockableFrame optionsFrame = new DockableFrame(PROPERTIES_DOCKABLEFRAME_KEY, IconsResource.getImageIcon(IconsResource.Frame.OPTIONS));
// optionsFrame.getContext().setInitMode(DockContext.STATE_FLOATING);
optionsFrame.getContext().setInitMode(DockContext.STATE_HIDDEN);
_frame.getDockingManager().addFrame(optionsFrame);

_frame.getDockingManager().setDefaultFocusComponent((JComponent) _documentPane);
// let dockablebar manager handles frame bounds and state.
//Typically, for all nested LayoutPersistences (including DockingManager and DockableBarManager),
//you should call both setUseFrameBounds(false) and setUseFrameState(false) before loadLayoutData so that only
// the top level LayoutPersistence will set the frame bounds and state.
_frame.getDockingManager().setUseFrameBounds(false);
_frame.getDockingManager().setUseFrameState(false);

// choose a frame style with LookAndFeel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// to add addtional UIDefault for JIDE component
LookAndFeelFactory.installJideExtension(LookAndFeelFactory.VSNET_STYLE);
} catch (ClassNotFoundException e1) {
e1.printStackTrace();
} catch (InstantiationException e1) {
e1.printStackTrace();
} catch (IllegalAccessException e1) {
e1.printStackTrace();
} catch (UnsupportedLookAndFeelException e1) {
e1.printStackTrace();
}
_frame.getLayoutPersistence().loadLayoutData();
_frame.setSize(800, 400);
_frame.getDockingManager().showFrame(PROPERTIES_DOCKABLEFRAME_KEY);
_frame.getDockingManager().setShowGripper(true);

_frame.toFront();
}
lumino
 
Posts: 4
Joined: Mon Jun 29, 2009 7:32 pm

Re: A weird running exception

Postby JIDE Support » Tue Jun 30, 2009 6:12 am

The exception is triggered by _frame.getLayoutPersistence().loadLayoutData();. Since different machine has different layout file, that's why only one of your customer gets this exception.

It would be better to get the layout persistence file so that we can see how it gets corrupted.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36468
Joined: Sun Sep 14, 2003 10:49 am

Re: A weird running exception

Postby lumino » Tue Jun 30, 2009 6:22 pm

Would you pliz tell me what is a layout file? Do you mean the original code in JIDE Action FrameWork?
Thanks.
lumino
 
Posts: 4
Joined: Mon Jun 29, 2009 7:32 pm

Re: A weird running exception

Postby JIDE Support » Tue Jun 30, 2009 6:51 pm

We should mention more about layout file in JIDE Docking Framework Developer Guide (the layout mechanism is the same for JIDE Action Framework as in JIDE Docking Framework). By default, we use javax pref package to save the layout, which will be in registry on Windows.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36468
Joined: Sun Sep 14, 2003 10:49 am

Re: A weird running exception

Postby lumino » Tue Jun 30, 2009 7:30 pm

OK. Following the JIDE_Docking_Framework_Developer_Guide, I got the layout persistence file in methode saveLayoutDataToFile(String arg0). But the file encoding is uft-16LE and garbled characters inside.
Pliz see the attachment.
Thx.
Attachments
layout.xml
(723 Bytes) Downloaded 501 times
lumino
 
Posts: 4
Joined: Mon Jun 29, 2009 7:32 pm

Re: A weird running exception

Postby JIDE Support » Tue Jun 30, 2009 8:27 pm

The layout is binary so you probably shouldn't use xml as the suffix. We usually use .layout as the suffix. I renamed it to default.layout and put it on C: root. Then I used the code below to load it. It loads fine so there is no problem in the layout file. If possible, you may ask the one who had problem to load this layout on his computer.

Code: Select all
import com.jidesoft.action.CommandBar;
import com.jidesoft.action.DefaultDockableBarHolder;
import com.jidesoft.action.DockableBar;
import com.jidesoft.action.DockableBarFactory;
import com.jidesoft.icons.JideIconsFactory;
import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.office2003.Office2003Painter;
import com.jidesoft.status.LabelStatusBarItem;
import com.jidesoft.status.StatusBar;
import com.jidesoft.swing.ContentContainer;
import com.jidesoft.swing.JideBoxLayout;
import com.jidesoft.swing.JideButton;
import com.jidesoft.utils.Lm;
import com.jidesoft.utils.PortingUtils;
import com.jidesoft.utils.SystemInfo;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class ActionFrameworkLoader extends DefaultDockableBarHolder {

    private static ActionFrameworkLoader _frame;

    public ActionFrameworkLoader(String title) throws HeadlessException {
        super(title);
    }

    public ActionFrameworkLoader() throws HeadlessException {
        this("");
    }

    public static void main(String[] args) {
        PortingUtils.prerequisiteChecking();

        // setNative(true) will make the color used by action framework to be kept the same as native XP theme.
        Office2003Painter.setNative(SystemInfo.isWindowsXP());

        LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
        showDemo(true);

    }

    public ActionFrameworkLoader(GraphicsConfiguration gc) {
        super(gc);
    }

    public static void showDemo(final boolean exit) {
        if (_frame != null) {
            _frame.toFront();
            return;
        }
        _frame = new ActionFrameworkLoader("Layout Loader for JIDE Action Framework");
        _frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        _frame.setIconImage(JideIconsFactory.getImageIcon(JideIconsFactory.JIDE32).getImage());

        // add a window listener so that timer can be stopped when exit
        _frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                super.windowClosing(e);
                clearUp();
                if (exit) {
                    System.exit(0);
                }
            }
        });

        // add command bar
        _frame.getDockableBarManager().setDockableBarFactory(new DockableBarFactory() {
            @Override
            public DockableBar create(String key) {
                CommandBar bar = new CommandBar(key);
                bar.add(new JideButton("New"));
                return bar;
            }
        });

        _frame.getDockableBarManager().loadLayoutDataFromFile("c:\\default.layout");

        if (Lm.DEMO) {
            Lm.a();
        }

        _frame.toFront();
    }

    private static void clearUp() {
        if (_frame.getDockableBarManager() != null) {
            _frame.getDockableBarManager().saveLayoutData();
        }
        _frame.dispose();
        _frame = null;
    }
}
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36468
Joined: Sun Sep 14, 2003 10:49 am

Re: A weird running exception

Postby Kalyani » Thu Jan 05, 2012 12:55 am

I packed my JIDE project into a .jar file. It runs fine on my computer when i double click on the jar. But it is giving the following exception on my QA's machine :

Exception in thread "main" java.lang.NoClassDefFoundError: com/jidesoft/combobox
/DateComboBox
Caused by: java.lang.ClassNotFoundException: com.jidesoft.combobox.DateComboBox
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: comac.pmt.gui.JIDE.PmtInterface. Program will exit.


Can you please tell me what all is needed to run a JIDE project executable on another machine. ?
Thanks a lot for your timely support.
Kalyani
 
Posts: 10
Joined: Fri Nov 11, 2011 12:59 am

Re: A weird running exception

Postby JIDE Support » Thu Jan 05, 2012 2:54 pm

Hi Kalyani,

I have no clue what caused the exception. You can probably try to compare the difference between your computer and the QA computer and see if you can figure out what's going on. Note the end of the exception says "Could not find the main class: comac.pmt.gui.JIDE.PmtInterface". It sounds weird too but could be a clue.

BTW, could you recreate a new thread next time? The original author will receive email notifications when you post on the same thread. As the topics are totally different, it will be annoying for them to get notifications.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36468
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: Google [Bot] and 5 guests

cron