das-developers / das2java

The original das2 library. Provides interactive publication-ready 2-D plotting
https://das2.org
GNU Lesser General Public License v3.0
4 stars 0 forks source link

"Already connected" error at HttpFileSystem.doDownload #84

Open jbfaden opened 7 months ago

jbfaden commented 7 months ago

Bill noticed he was getting the error "java.lang.IllegalStateException: Already connected" when running a script twice in Autoplot. First, he runs

https://abbith.physics.uiowa.edu/jbf/juno/-/blob/master/team/wigglePlot/wigglePlotSapClipFast.jy?orbit='56'&model=''&c10plus=True&clip='2023-363'&shells='05,10,20,30,40,50'

which will ask for credentials, and then the orbit 56 plot is drawn properly. When he then runs the script again to switch to orbit 57, the error occurs.

It's not clear why this is suddenly happening. Nothing has changed in the code recently, so maybe it's the Java version, though I can generate the problem at my site on Linux. The same issue shows with Autoplot v2023a_10, which has been out for a month. So maybe we have never noticed this before and the bug has always been there.

jbfaden commented 7 months ago

I'm fixing this by simply catching the error and issuing a log message at INFO. If the connection is already made, then it stands to reason that the header already contains the credentials so they don't need to be set again. This seems to be the case.