jw3 / example-daffodil-vscode

A VS Code extension for DFDL with Daffodil
Apache License 2.0
2 stars 3 forks source link

Windows Illegal char ':' for data file path #119

Closed jw3 closed 2 years ago

jw3 commented 2 years ago

In a workspace without a launch.json, debugging the xsd file with ctrl+p and selecting the data file shown in the error message.

09:30:26.761 [io-compute-2] DEBUG org.apache.daffodil.debugger.dap.Parse - deliverParseData: Errored(java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:///c:/Users/wassj/Downloads/test-dfdl-workspace/jpeg.dfdl.xsd)

Further up the stack

09:30:21.137 [io-compute-0] INFO org.apache.daffodil.debugger.dap.DAPSession - <R #1 initialize success {"supportsConfigurationDoneRequest":true,"supportsHitConditionalBreakpoints":false,"supportsConditionalBreakpoints":false,"supportsEvaluateForHovers":false,"supportsCompletionsRequest":false,"supportsRestartFrame":false,"supportsSetVariable":false,"supportsRestartRequest":false,"supportTerminateDebuggee":false,"supportsDelayedStackTraceLoading":false,"supportsLogPoints":false,"supportsExceptionInfoRequest":false,"supportsDataBreakpoints":false,"supportsClipboardContext":false,"supportsLoadedSourcesRequest":false}
09:30:21.140 [io-compute-2] INFO org.apache.daffodil.debugger.dap.DAPSession - <E initialized
09:30:21.147 [io-compute-1] INFO org.apache.daffodil.debugger.dap.DAPSession - R> #2 launch {"type":"dfdl","name":"Run File","request":"launch","program":"c:\\Users\\wassj\\Downloads\\test-dfdl-workspace\\jpeg.dfdl.xsd","data":"c:\\Users\\wassj\\Downloads\\test-dfdl-workspace\\works.jpg","debugServer":4711,"infosetOutput":{"type":"file","path":"jpeg-infoset.xml"},"__sessionId":"1f794440-be74-438c-9e9d-af41c60b8dbd"}
09:30:21.150 [io-compute-3] INFO org.apache.daffodil.debugger.dap.DAPSession - R> #3 configurationDone null
jw3 commented 2 years ago

Using v0.0.15-pre3

Which is merged to master now

arosien commented 2 years ago

If there's a stack trace, can you post? If not, I'll find it and make sure future exceptions log the stack trace.

jw3 commented 2 years ago

There was not, but I can post the full console output

09:30:17.989 [io-compute-1] INFO org.apache.daffodil.debugger.dap.DAPodil -
******************************************************
A DAP server for debugging Daffodil schema processors.

Build info:
  version: 0.0.15-pre3
  daffodilVersion: 3.1.0
  scalaVersion: 2.12.13
  sbtVersion: 1.5.1
******************************************************
09:30:17.989 [io-compute-1] INFO org.apache.daffodil.debugger.dap.DAPodil - launched with options listenPort: 4711, listenTimeout: 10 seconds
09:30:18.060 [io-compute-1] INFO org.apache.daffodil.debugger.dap.DAPodil - waiting at tcp://0.0.0.0:4711
09:30:20.564 [io-compute-2] INFO org.apache.daffodil.debugger.dap.DAPodil - connected at tcp://0.0.0.0:4711
09:30:21.049 [io-compute-1] INFO org.apache.daffodil.debugger.dap.DAPSession - R> #1 initialize {"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"dfdl","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true}
09:30:21.137 [io-compute-0] INFO org.apache.daffodil.debugger.dap.DAPSession - <R #1 initialize success {"supportsConfigurationDoneRequest":true,"supportsHitConditionalBreakpoints":false,"supportsConditionalBreakpoints":false,"supportsEvaluateForHovers":false,"supportsCompletionsRequest":false,"supportsRestartFrame":false,"supportsSetVariable":false,"supportsRestartRequest":false,"supportTerminateDebuggee":false,"supportsDelayedStackTraceLoading":false,"supportsLogPoints":false,"supportsExceptionInfoRequest":false,"supportsDataBreakpoints":false,"supportsClipboardContext":false,"supportsLoadedSourcesRequest":false}
09:30:21.140 [io-compute-2] INFO org.apache.daffodil.debugger.dap.DAPSession - <E initialized
09:30:21.147 [io-compute-1] INFO org.apache.daffodil.debugger.dap.DAPSession - R> #2 launch {"type":"dfdl","name":"Run File","request":"launch","program":"c:\\Users\\wassj\\Downloads\\test-dfdl-workspace\\jpeg.dfdl.xsd","data":"c:\\Users\\wassj\\Downloads\\test-dfdl-workspace\\works.jpg","debugServer":4711,"infosetOutput":{"type":"file","path":"jpeg-infoset.xml"},"__sessionId":"1f794440-be74-438c-9e9d-af41c60b8dbd"}
09:30:21.150 [io-compute-3] INFO org.apache.daffodil.debugger.dap.DAPSession - R> #3 configurationDone null
09:30:26.609 [io-compute-3] DEBUG org.apache.daffodil.debugger.dap.DAPodil - awaiting first stack frame
09:30:26.732 [io-compute-0] DEBUG org.apache.daffodil.debugger.dap.Parse.DaffodilDebugger - pre-checkBreakpoints
09:30:26.732 [io-compute-0] DEBUG org.apache.daffodil.debugger.dap.Parse.DaffodilDebugger - pre-control await
09:30:26.732 [io-compute-0] DEBUG org.apache.daffodil.debugger.dap.Parse.DaffodilDebugger - post-control
await
09:30:26.747 [io-compute-3] DEBUG org.apache.daffodil.debugger.dap.Parse.DaffodilDebugger - pre-checkBreakpoints
09:30:26.750 [io-compute-3] DEBUG org.apache.daffodil.debugger.dap.Parse.DaffodilDebugger - pre-control await
09:30:26.761 [io-compute-2] DEBUG org.apache.daffodil.debugger.dap.Parse - deliverParseData: Errored(java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:///c:/Users/wassj/Downloads/test-dfdl-workspace/jpeg.dfdl.xsd)
09:30:26.775 [io-compute-3] DEBUG org.apache.daffodil.debugger.dap.Parse - infosetChanges (orig): Canceled
arosien commented 2 years ago

Thanks. I'm on a mac so I'm guessing a bit. But I think it's some escaping when the Java Path is converted to a URI for the Daffodil code.

arosien commented 2 years ago

OMG https://eed3si9n.com/encoding-file-path-as-URI-reference šŸ¤¦

arosien commented 2 years ago

https://github.com/jw3/example-daffodil-vscode/pull/121#issuecomment-909615855

arosien commented 2 years ago

Re: URI => Path: https://stackoverflow.com/questions/43972777/exception-in-thread-main-java-nio-file-invalidpathexception-illegal-char/43973911#43973911