cmantunes

Papilio loader: Null-pointer

10 posts in this topic

For some reason I can no longer use papilio loader. I get this:

 

com.sun.java.swing.plaf.windows.WindowsLookAndFeel
-- listing properties --
java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=C:\Program Files (x86)\Java\jre1.8.0_...
java.vm.version=25.111-b14
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
java.vm.name=Java HotSpot(TM) Client VM
file.encoding.pkg=sun.io
user.script=
user.country=US
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=Service Pack 1
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\Program Files (x86)\Gadget Factory...
java.runtime.version=1.8.0_111-b14
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files (x86)\Java\jre1.8.0_...
os.arch=x86
java.io.tmpdir=C:\Users\Carlos\AppData\Local\Temp\
line.separator=

java.vm.specification.vendor=Oracle Corporation
user.variant=
os.name=Windows 7
sun.jnu.encoding=Cp1252
java.library.path=C:\ProgramData\Oracle\Java\javapath;C...
sun.awt.enableExtraMouseButtons=true
java.specification.name=Java Platform API Specification
java.class.version=52.0
sun.management.compiler=HotSpot Client Compiler
os.version=6.1
user.home=C:\Users\Carlos
user.timezone=
java.awt.printerjob=sun.awt.windows.WPrinterJob
file.encoding=Cp1252
java.specification.version=1.8
user.name=Carlos
java.class.path=papilio-loader.jar
java.vm.specification.version=1.8
sun.arch.data.model=32
java.home=C:\Program Files (x86)\Java\jre1.8.0_111
sun.java.command=papilio-loader.jar
java.specification.vendor=Oracle Corporation
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode

java.version=1.8.0_111
java.ext.dirs=C:\Program Files (x86)\Java\jre1.8.0_...
sun.boot.class.path=C:\Program Files (x86)\Java\jre1.8.0_...
sun.stderr.encoding=cp437
java.vendor=Oracle Corporation
file.separator=\
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.stdout.encoding=cp437
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at net.gadgetfactory.papilio.loader.TargetPanel.PopulateLastFiles(Target
Panel.java:442)
        at net.gadgetfactory.papilio.loader.PapilioLoader.PopulateProject(Papili
oLoader.java:1068)
        at net.gadgetfactory.papilio.loader.PapilioLoader.<init>(PapilioLoader.j
ava:358)
        at net.gadgetfactory.papilio.loader.PapilioLoader$1.run(PapilioLoader.ja
va:180)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)

        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(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)
 

Share this post


Link to post
Share on other sites

Any ideas on this? I can use the command line (papilio-prog.exe) but it is way less convenient than the GUI. Thanks!

This is the culprit. I don't know enough Java to fix this myself, though.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at net.gadgetfactory.papilio.loader.TargetPanel.PopulateLastFiles(TargetPanel.java:442)

 

Share this post


Link to post
Share on other sites

OK, it seems I found the problem. I fed papilio-loader a bit file and I didn't get any error. The problem is with the preference "Load last files on startup". If this is checked, I get the null pointer. If not, papilio loader works fine.

Share this post


Link to post
Share on other sites

Hmmm, ok. Thank you for the information on this problem. I'll have to do some testing over the next couple of days.

Thanks,
Jack.

Share this post


Link to post
Share on other sites

@cmantunes

were you in simple mode or something and the UI crashed at one time?

 

 

@Jack, as you know, i really dont like JAVA, and am really rubbish in it, but

in :: TargetPanel.java

looks like the problem could be in 

    public void StoreLastFiles(Properties settings) {
        settings.setProperty("LastBitFile", txtQBitFile.getText().trim());
        if (!bSimpleMode){
            settings.setProperty("LastBmmFile", txtQBmmFile.getText().trim());
            settings.setProperty("LastHexFile", txtQHexFile.getText().trim());
        }
    }


you could try instead of

 

    public void PopulateLastFiles(String lastBitFile, String lastBmmFile, String lastHexFile) {
        txtQBitFile.setText(lastBitFile);
        txtQBmmFile.setText(lastBmmFile);
        txtQHexFile.setText(lastHexFile);
    }


    


to

    public void PopulateLastFiles(String lastBitFile, String lastBmmFile, String lastHexFile) {
        txtQBitFile.setText(lastBitFile);
        if (!bSimpleMode){
            txtQBmmFile.setText(lastBmmFile);
            txtQHexFile.setText(lastHexFile);
        } else {
            /*  not sure what safe defaults would be */
            txtQBmmFile.setText(" ");
            txtQHexFile.setText(" ");
        }
    }


OR

 

    public void PopulateLastFiles(String lastBitFile, String lastBmmFile, String lastHexFile) {
        if (lastBitFile) {
            txtQBitFile.setText(lastBitFile);
        } else {
            txtQBitFile.setText(" ");    /*  not sure what safe defaults would be */
        }
        if (lastBmmFile) {
            txtQBmmFile.setText(lastBmmFile);
        } else {
            txtQBmmFile.setText(" ");    /*  not sure what safe defaults would be */
        }

        if (lastHexFile) {
            txtQHexFile.setText(lastHexFile);
        } else {
            txtQHexFile.setText(" ");    /*  not sure what safe defaults would be */
        }
    }

 

 

You could probably even just not do the } else { part and just 

if (blah) { txtBlah.setText(blah); }  

OR

you could patch StoreLastFiles to always write defaults regardless of bSimpleMode

not sure whats the better option....
 

Share this post


Link to post
Share on other sites

Ok, 

I will have to circle back around and look at this in a week or two. The good news is that my wife and I are expecting a baby tomorrow!!!!! So I'm going to be out of commission for a little while. :) 

Jack

Share this post


Link to post
Share on other sites
On 11/18/2016 at 1:43 PM, Felix said:

if cmantunes had replied I would have offered to fork and make the changes for you to have him test. .

That would be nice. :) Maybe he will be able to reply again. Things are still pretty hectic here...

Jack.

Share this post


Link to post
Share on other sites
On 11/21/2016 at 7:16 PM, Jack Gassett said:

That would be nice. :) Maybe he will be able to reply again. Things are still pretty hectic here...

Jack.

If got to same trouble in Windows (usually nothing happens when you try to run papilio-loader) go to c:\Users\..user_name..\AppData\Roaming\ and delete papilio-loader content preference file. Don't forget to end Java bin processes  in Task Manager before running papilio-loader again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now