nroduit / Weasis

Weasis is a DICOM viewer available as a desktop application or as a web-based application.
https://nroduit.github.io
Other
828 stars 295 forks source link

Error loadin an image from URL with defined port #121

Closed neklepat closed 4 years ago

neklepat commented 4 years ago

Command $dicom:get -r http://localhost:8080/public/file/14Q446XZN9WZ7C1HUQ?accessToken=H6OH267AQB7MLD06Q does not open image when Weasis is already open.

Same command opens image without problem when Weas is not running yet.

Desktop (please complete the following information):

I can see this error in log file:

04.05.2020 09:23:59.951 SEVERE [AWT-EventQueue-0] org.weasis.launcher.WeasisLauncher: Execute command java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.weasis.launcher.WeasisLauncher.commandSessionExecute(WeasisLauncher.java:637) at org.weasis.launcher.WeasisLauncher.lambda$executeCommands$1(WeasisLauncher.java:377) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 4: http://localhost:8080/public/file at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229) at java.base/java.nio.file.Path.resolve(Path.java:515) at org.apache.felix.gogo.runtime.Expander.generateFileNames(Expander.java) at org.apache.felix.gogo.runtime.Expander.expand(Expander.java) at org.apache.felix.gogo.runtime.Expander.expand(Expander.java) at org.apache.felix.gogo.runtime.Expander.expand(Expander.java) at org.apache.felix.gogo.runtime.Closure.eval(Closure.java) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java) at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java) at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java) at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

nroduit commented 4 years ago

Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 4: http://localhost:8080/public/file Please read https://nroduit.github.io/en/getting-started/weasis-protocol/#how-to-build-an-uri

neklepat commented 4 years ago

Readed many times... It seems URL encoding nor the port number is not the problem, but the parameters.

I have 2 tabs in Weasis when I call this command line twice: C:\Program Files\Weasis>weasis $dicom:get -r https://nroduit.github.io:443/samples/us-palette.dcm

I have 1 tab when I call it twice with URL parameter: C:\Program Files\Weasis>weasis $dicom:get -r https://nroduit.github.io:443/samples/us-palette.dcm?test=test

Same behavior with browser URL: weasis://%24dicom%3Aget+-r+https%3A%2F%2Fnroduit.github.io%3A443%2Fsamples%2Fus-palette.dcm%3Ftest%3Dtest

Or I am missing something else?

nroduit commented 4 years ago

Activate the log file: https://nroduit.github.io/en/faq/#how-to-enable-weasis-logging

And post the errors

neklepat commented 4 years ago

Executed twice: C:\Program Files\Weasis>weasis $dicom:get -r https://nroduit.github.io:443/samples/us-palette.dcm?test=test

boot-0.log boot-1.log

nroduit commented 4 years ago

Calling directly the Weasis binary is not recommended because the shell will interpret characters from parameters and this is different on each system. The command must be at least quoted.

Using the command $dicom:get -r for several files is not recommended because there is a problem to handle asynchronous processes correctly without knowing the metadata of the files before reading them, prefer to use a manifest which the best way to handle download concurrency and and the refresh of the asynchronous processes.

nroduit commented 4 years ago

See also https://nroduit.github.io/en/basics/commands/#weasis-portable-distribution which is similar of the used of Weasis binary directly.

neklepat commented 4 years ago

Bad thing is, that I am not able to even call manifest by weasis://%24dicom%3Aget%20-w%20https%3A%2F%2Fnroduit.github.io%2Fsamples%2FLumbar%2Fmf.xml%3Ftest%3Dtest with parameters. I must close Weasis viewer everytime before opening next file. I need to add accessToken to URL. The behavior is the same, see logs.

I will try to investigate problem myself, when I would be able to run app in debug mode. Any advice how to do that is welcome. Now I fight with this error running WeasisLAuncher class: 05.05.2020 15:09:28.643 INFO [main] org.weasis.launcher.ConfigData: Initialization of the launch configuration... Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/felix/framework/util/Util

boot-0.log boot-1.log

nroduit commented 4 years ago

You should refer to https://nroduit.github.io/en/getting-started/guidelines/

When you click on the launch buttons in https://nroduit.github.io/en/getting-started/weasis-protocol/ only the first time the images are loaded. Do you confirm it?

neklepat commented 4 years ago

No, I can not confirm that. Launch buttons have URLs without parameters and these works fine. When I want to use GET parameter like ?authToken=BLAHBLAHBLAH, the image loads only first time.

It seems that there is problem to handover parameters to the first running process through opened socket.

nroduit commented 4 years ago

You should try to double quote the URL because the character ? could be interpret by the OSGI command interpreter.

neklepat commented 4 years ago

And it works! Tank you a lot!

Resulting URL with parameters: C:\Program Files\Weasis>start weasis://%24dicom%3Aget+-r+%22https%3A%2F%2Fnroduit.github.io%2Fsamples%2Fus-palette.dcm%3Ftest%3Dtest%26test1%3Dtest1%22