mbeckerle opened a new issue, #651:
URL: https://github.com/apache/daffodil-vscode/issues/651
Using the daffodilDebugClasspath is problematic.
If a schema file is found in a jar on the daffodilDebugClasspath, then it is
displayed, and you can step it, but setting a breakpoint in it results in a
null pointer exception (NPE) because the jar-file path to the file of interest
(which is ethernetIP.dfdl.xsd) is "non-hierarchical".
```
ERROR o.a.d.d.d.DAPodil - unhandled error
java.lang.NullPointerException: null
at java.base/sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:75)
at java.base/sun.nio.fs.UnixPath.<init>(UnixPath.java:69)
at
java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at
org.apache.daffodil.debugger.dap.DAPodil.$anonfun$setBreakpoints$1(DAPodil.scala:267)
```
If you arrange for the ordinary text file to be found on the classpath
first, before the jar, then it works.
The specific schema I was testing with was PCAP, using the 1.3.0-RC2 of the
vscode extension.
PCAP requires that the ethernetIP schema is on the classpath. To use the
VSCode debugger and stop at a breakpoint set in the ethernetIP.dfdl.xsd file,
you must setup the daffodilDebugClasspath in launch.json like this:
```
"daffodilDebugClasspath":
"${workspaceFolder}/../ethernetIP/src/main/resources:${workspaceFolder}/lib_managed/jars/com.owlcyberdefense/dfdl-ethernetip/dfdl-ethernetip-1.2.0.jar",
```
This is because I have PCAP and ethernetIP projects checked out from github
in adjacent directories. The ethernetIP source tree's src/main/resources must
be on the daffodilDebugClasspath AND the jar file with the code in it, and the
jar has to be later on the classpath so that it gets used for the code, but not
for the schema files.
Note that the source and the jar are required because ethernetIP provides
not just XML Schema files, but a plug-in layer-transformer (scala code) that
computes IPv4 checksums over data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]