bugDataExplorer - Bugs: bug #63653, DataExplorer fails with...

 
 

bug #63653: DataExplorer fails with `java.lang.NullPointerException: Cannot read field "width" because the return value [...]`.

Submitter:  None
Submitted:  Fri 13 Jan 2023 02:49:34 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Discussion locked!

Jump to the original submission

Mon 13 Feb 2023 05:03:43 PM UTC, comment #17: 

Aron, thanks for feedback.

Close problem.

regards Winfried

Winfried Brügmann <brueg>
Group administrator
Mon 13 Feb 2023 04:18:52 PM UTC, comment #16: 

Sorry for the delay, life kicked in ...

It was indeed an old java version. Using java-17-openjdk, everything works fine now. Thanks

Aaron Mueller <aaronmueller>
Wed 18 Jan 2023 01:33:56 PM UTC, comment #15: 

Aaron, I executed the following using my Manjaro system at terminal.

history of entered commands

  500  tar -xzvf ~/Downloads/dataexplorer-3.7.4-src.tar.gz
  501  rm -rf /opt/DataExplorer/
  502  sudo rm -rf /opt/DataExplorer/
  503  ls -l /opt
  504  pwd
  505  rm -rf dataexplorer-3.7.4/
  506  cd /tmp
  507  tar -xzvf ~/Downloads/dataexplorer-3.7.4-src.tar.gz
  508  cd dataexplorer-3.7.4/
  509  ./configure --prefix=/opt
  510  make
  511  sudo make install
  512  cd ..
  513  unzip /opt/DataExplorer/devices/AkkuMaster.jar
  514  cat META-INF/MANIFEST.MF
 
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.12
Created-By: root
Implementation-Version: 3.7.4
Built-Date: 2023-01-18 14:21:33
Bundle-Version: 3.7.4
Bundle-SymbolicName: AkkuMaster
Bundle-Description: Implementation for Htronic AkkuMaster C4
Export-Service: AkkuMasterC4:Htronic:SERIAL_IO

results of make and make install can be piped into file to verify if build steps are the same. If this doesn't help ant can be run verbose which give a very detailed output.

Winfried Brügmann <brueg>
Group administrator
Tue 17 Jan 2023 09:36:19 PM UTC, comment #14: 

The resulting META-INF/MANIFEST.MF in the DataExplorer.jar looks like this:

```
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.12
Created-By: aaron
Implementation-Version: 3.7.4
Built-Date: 2023-01-17 22:05:05
Main-Class: gde.GDE
Class-Path: java/ext/juniversalchardet.jar java/ext/jaxb-api.jar java/
 ext/jaxb-core.jar java/ext/jaxb-runtime.jar java/ext/istack-commons-r
 untime.jar java/ext/activation.jar java/ext/gson.jar java/ext/swt.jar
  java/ext/jSerialComm.jar java/ext/RXTXcomm.jar java/ext/usb-api.jar
 java/ext/usb4java-javax.jar java/ext/usb4java.jar java/ext/commons-la
 ng3.jar java/ext/libusb4java.jar java/ext/jtouchbar.jar java/ext/jtou
 chbar-swt.jar
```

The META-INF/MANIFEST.MF in the resulting devices/AkkuMaster.jar for example looks like this:

```
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.12
Created-By: aaron
Implementation-Version: 3.7.4
Built-Date: 2023-01-17 22:05:06
Bundle-Version: 3.7.4
Bundle-SymbolicName: AkkuMaster
Bundle-Description: Implementation for Htronic AkkuMaster C4
Export-Service: ${export.services}
```

Building it "manually" without the ArchLinux PKGBUILD file results in the same thing. So I don't think the PKGBUILD suddenly broke apart by itself.

My Java/Ant skills are a decade old, so correct me if I am wrong. This looks for me like Ant is not correctly substituting the export.services variable in the MANIFEST.MF files. As you mentioned, the export.services variable comes from gde.tools.ExportServiceBuilder. This may be the root of the problem.

Is there a way I can compile/execute the ExportServiceBuilder.java separately to test if this is working correctly? A simple javac ... did not the trick.

Aaron Mueller <aaronmueller>
Tue 17 Jan 2023 02:27:41 PM UTC, comment #13: 

Entries in jar MANIFEST.MF should look after build like this:
Export-Service: AkkuMasterC4:Htronic:SERIAL_IO

The Export-Services result in a table to set up the device list: device-name, manufacturer, communication interface

If build error is ignored, the UI may appear, but no device will be selectable and usable.



Winfried Brügmann <brueg>
Group administrator
Tue 17 Jan 2023 02:14:23 PM UTC, comment #12: 

Aaron,
exception is SEVERE  gde.config.Settings.updateDeviceProperties() - wrong number of arguments in ${export.services}
java.lang.IllegalArgumentException: wrong number of arguments in ${export.services}
at gde.config.ExportService.<init>(ExportService.java:98)
at gde.utils.FileUtils.getDeviceJarServices(FileUtils.java:1154)
at gde.config.Settings.checkDeviceProperties(Settings.java:444)
at gde.config.Settings.initialize(Settings.java:360)
at gde.config.Settings.getInstance(Settings.java:313)
at gde.GDE$1.run(GDE.java:469)

Each build.xml look like
<target name="package" depends="compile">
<echo message="Building using ${os.name} ${os.arch}" />
<tstamp>
     <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<java classname="gde.tools.ExportServiceBuilder" outputproperty="export.services">
    <arg value="${basedir}"/>
    <arg value="${graupner.hidden}"/>
    <classpath>
        <pathelement location="../DataExplorer/build/DataExplorer.jar"/>
    </classpath>
</java>
<manifest file="src/META-INF/MANIFEST.MF">
    <attribute name="Implementation-Version" value="${version.num}"/>
<attribute name="Created-By" value="${user.name}"/>
<attribute name="Built-Date" value="${TODAY}"/>
    <attribute name="Bundle-Version" value="${version.num}"/>
    <attribute name="Bundle-SymbolicName" value="${ant.project.name}"/>
    <attribute name="Bundle-Description" value="Implementation for Graupner Hott binary log data"/>
    <attribute name="Export-Service" value="${export.services}"/>
    </manifest>
    <jar manifest="src/META-INF/MANIFEST.MF" jarfile="build/${ant.project.name}.jar" compress="true" index="true" >
       <fileset dir="${module.output}" includes="**/*.class"/>
    <fileset dir="src" includes="**/*.xml"/>
    <fileset dir="src" includes="**/*.jpg"/>
    <fileset dir="src" includes="**/*.gif"/>
    <fileset dir="src" includes="**/*.png"/>
    <fileset dir="src" includes="**/*.properties"/>
    <fileset dir="src" includes="**/*.html"/>
    <fileset dir="src" includes="**/*.css"/>
    </jar>
</target>
The ExportServiceBuilder is building part of jar manifest, I assume your build does not exec this correctly.

Due to this exception, settings doesn't get initialised correctly and therefore the window is not correct initialised and null.

mfG Winfried

Winfried Brügmann <brueg>
Group administrator
Tue 17 Jan 2023 01:32:41 PM UTC, comment #11: 

Aron, the missing initialisation of window in settings class is a follow up error. Please check the bootstrap.log written to /tmp while starting DataExplorer.

You may also download the source package and build it manually by typing ./configure, make, make install. Check out if the resulting jar files are identically.
mfG, Winfried

Winfried Brügmann <brueg>
Group administrator
Tue 17 Jan 2023 01:25:16 PM UTC, comment #10: 

I am the maintainer of the dataexplorer package on ArchLinux.
Got the same problem as mentioned by @dreieck (Distribution: Manjaro Linux).

Changing the JDK to 11 or 17 to build the project does not make any difference. This looks like a bug in the code to me. Maybe some incompatibilities with a newer version?

```this.window``` is somehow not been set in Settings#initialize(). If I set it to a new ```Rectangle``` instance, everything worked fine. I am not familiar with the codebase, so I've patched the ArchLinux package with that "ugly hotfix" until this issue is resolved properly.

https://aur.archlinux.org/cgit/aur.git/tree/window.patch?h=dataexplorer

Aaron Mueller <aaronmueller>
Sat 14 Jan 2023 02:26:00 PM UTC, comment #9: 

I manually run content of the given build script , excluding copy all the udev rules on Manjaro which is an arch Linux distribution. Mainly it is also ./configure --prefix=/opt; make; make install.
Build script declaring makedepends=("apache-ant" "jdk8-openjdk"). I used -release=8 as compile option which is invalid using jdk8. I would propose to change it to 11 or 17. My Manjaro use jdk11 as standard.
RXTXcomm get still packaged, but jSerialComm is used as default for serial communication. RXTXcomm is only fall back option if for some reason jSerialComm make trouble.

No idea anymore what's going wrong in your case.

Winfried Brügmann <brueg>
Group administrator
Fri 13 Jan 2023 07:21:20 PM UTC, comment #8: 


> Is DataExplorer build using configure, make, make install ?


Yes, I am building according to this recipe.

> I have verified manual build and install using source, I am not able to force problems as described? Used openJDK 11 on Ubuntu.


So I think I need to track down the build process.

Regards!

Drei Eck <dreieck>
Fri 13 Jan 2023 05:47:34 PM UTC, comment #7: 

I have verified manual build and install using source, I am not able to force problems as described? Used openJDK 11 on Ubuntu.

Winfried Brügmann <brueg>
Group administrator
Fri 13 Jan 2023 05:35:54 PM UTC, comment #6: 

bootstrap.log contains a lot of exceptions
2023-01-13 17:12:13.541 000015 SEVERE  gde.config.Settings.updateDeviceProperties() - wrong number of arguments in ${export.services}
java.lang.IllegalArgumentException: wrong number of arguments in ${export.services}
at gde.config.ExportService.<init>(ExportService.java:98)
at gde.utils.FileUtils.getDeviceJarServices(FileUtils.java:1154)
at gde.config.Settings.checkDeviceProperties(Settings.java:444)
at gde.config.Settings.initialize(Settings.java:360)
at gde.config.Settings.getInstance(Settings.java:313)
at gde.GDE$1.run(GDE.java:469)

It look like a build error. Is DataExplorer build using configure, make, make install ?

Winfried Brügmann <brueg>
Group administrator
Fri 13 Jan 2023 04:49:33 PM UTC, comment #5: 


> Please attach the bootstrap.log located in /tmp


Here.


(file #54219)

Drei Eck <dreieck>
Fri 13 Jan 2023 04:35:26 PM UTC, comment #4: 

Please attach the bootstrap.log located in /tmp

thanks, Winfried

Winfried Brügmann <brueg>
Group administrator
Fri 13 Jan 2023 04:14:01 PM UTC, comment #3: 

Ahoj,

> it seams to me DataExplorer get started in Eclipse IDE.


No, I don't use Exlipse.


> Java 19 is actually not tested and not in the list of supported
> runtimes. I assume, this is the problem. I propose to use runtime 11
> to 17 LTS.


I tested with Java 11 anbd Java 17 (both OpenJDK), and it fails, too.

With `java --version | head -n1` = `openjdk 11.0.17 2022-10-18`:

```
java.lang.NullPointerException
at gde.ui.DataExplorer.execute(DataExplorer.java:406)
at gde.GDE.main(GDE.java:544)
```

With `java --version | head -n1` = `openjdk 17.0.5 2022-10-18`:

```
java.lang.NullPointerException: Cannot read field "width" because the return value of "gde.config.Settings.getWindow()" is null
at gde.ui.DataExplorer.execute(DataExplorer.java:406)
at gde.GDE.main(GDE.java:544)
```

Regards!

Drei Eck <dreieck>
Fri 13 Jan 2023 03:33:57 PM UTC, comment #2: 

Hallo,
it seams to me DataExplorer get started in Eclipse IDE. At minimum a dev-build is required to enable execution within Eclipse.

If this is a result starting DataExplorer.jar as shown the class loader fail finding runtime required jars, since directory structure is not available as required.

Java 19 is actually not tested and not in the list of supported runtimes. I assume, this is the problem. I propose to use runtime 11 to 17 LTS.

cheers Winfried

Winfried Brügmann <brueg>
Group administrator
Fri 13 Jan 2023 03:06:54 PM UTC, comment #1: 

This is my username here: "dreieck". I have created this issue.

Drei Eck <dreieck>
Fri 13 Jan 2023 02:49:34 PM UTC, original submission:  

Ahoj,

when I start dataexplorer, I get a null pointer exception `java.lang.NullPointerException: Cannot read field "width" because the return value of "gde.config.Settings.getWindow()" is null`:

java -jar DataExplorer.jar:



(java:31111): Gtk-WARNING **: 15:44:35.857: Theme parsing error: gtk.css:2440:18: '-gtk-icon-filter' is not a valid property name

(java:31111): Gtk-WARNING **: 15:44:35.866: Theme parsing error: gtk.css:6258:18: '-gtk-icon-filter' is not a valid property name
java.lang.NullPointerException: Cannot read field "width" because the return value of "gde.config.Settings.getWindow()" is null
        at gde.ui.DataExplorer.execute(DataExplorer.java:406)
        at gde.GDE.main(GDE.java:544)


I have both GTK2 and GTK3 installed.

java --version

openjdk 19.0.1 2022-10-18
OpenJDK Runtime Environment (build 19.0.1+10)
OpenJDK 64-Bit Server VM (build 19.0.1+10, mixed mode)


Operating system: Artix GNU/Linux (rolling release).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #54219:  bootstrap.log added by dreieck (36KiB - text/x-log - /tmp/bootstrap.log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by aaronmueller (Posted a comment)
  • -email is unavailable- added by brueg (Posted a comment)
  • -email is unavailable- added by dreieck (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-13 brueg StatusNone Confirmed
        Open/ClosedOpen Closed
        Discussion LockNone Locked
    2023-01-13 dreieck Attached File- Added bootstrap.log, #54219

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code