Coder Social home page Coder Social logo

Comments (9)

chewiebug avatar chewiebug commented on July 21, 2024

Hi Chris

I have never tested this functionality since it was built in before I
started to improve GCViewer. So it might be that I broke something
there. The code opening files from URLs should be the same if open from
GUI or commandline.

What error message do you get? Does your file open when you use the GUI?
Why do you replace '' with '/'? '' should never be part of a URL.

Regards, Jörg

from gcviewer.

ChrisHZ avatar ChrisHZ commented on July 21, 2024

Hi, When I try it without my change I get an occasional hang (something to do with user preferences) and the last time it tried to load the URL from the current directory so in this case failed to read file C:\MemoryApps\http:\localhost:8080\LastGC.log

Looking at the code I couldn't see it working it seemed to just pass the argument to the method expecting a file name.

With the change I have it working though I got an occasional fail to read the file (my jnlp passes a null argument) (it may be a webstart bug as there was one reported around these lines though I thought it fixed), so I have now changed to passing and reading a system property from within the JNLP to gcviewer and that works every time.

I still am investigating an issue where I have an occasional issue where it fails to read user preferences and null pointers on loading recentURLs, I've changed the code to just empty string if it can't load from the file rather than crash and that works fine.

My use case is as part of my test results I have a web page of GC logs, I previously had the option to copy the link as an URL into gc viewer manually which does work but it was suggested if I could web start gcviewer and pass the URL requested in that would be nicer and I do have it working in principle.

thanks for the reply

Chris

PS I needed the replace but that may just have been with the way I was testing, I don't need that replace in real world usage.

from gcviewer.

chewiebug avatar chewiebug commented on July 21, 2024

Hi Chris,

Ok, I have (finally) found the place in the code you are pointing at. It indeed won't work with URLs - I think it should so I marked this issue a bug.

You seem to have found a second issue with those occasional hangs / NullPointerExceptions. Does it occur when there is no gcviewer.properties file available? Is there a way to reproduce this hang / NPE?

Regards, Jörg

from gcviewer.

ChrisHZ avatar ChrisHZ commented on July 21, 2024

Hi,

With regard to the NPE , I suspect its how I was using it, I appear to have corrupted the gcviewer.properties with the URLS I have saved (recent URLS). So when it loadPreferences it loads the file but mis interprets some of my recent urls as null some how .

In the gcviewer code in RecentURLsMode.java URLSet createSortedFileStrings this fixes the issue fileStrings[i] = (urls[i] != null) ? urls[i].toString() : ""; I'd rather it lost my recent urls than crashed.

I suspect its something to do with my use case and I may be able to clean up my URLs (escape remove some parameters) to get round it (its had no trouble using the URL to read the file, just this preference loading bit when you stop and come back into gcviewer).

With regard to the parameter I am still using my change to a system property for the filename as webstart has not been reliable for me in passing a command line parameter, I am, still investigating it but I have seen accounts of others with the same issue.

from gcviewer.

ChrisHZ avatar ChrisHZ commented on July 21, 2024

Sorry didn't mean the close .. lol

from gcviewer.

chewiebug avatar chewiebug commented on July 21, 2024

Hi Chris,

I have pushed fixes to support URLs from the command line and prevention of the NPE when gcviewer.properties contains corrupt entries.

Does it now work for you?

Regards, Jörg

from gcviewer.

ChrisHZ avatar ChrisHZ commented on July 21, 2024

Hi,

Thanks for the effort.I'm testing now and will get back to you.

Chris

from gcviewer.

ChrisHZ avatar ChrisHZ commented on July 21, 2024

Hi,

Just to confirm I have been using the latest version for a couple of days without issue.

Chris

from gcviewer.

chewiebug avatar chewiebug commented on July 21, 2024

Hi Chris,

Thank you very much for reporting and testing!

Regards, Jörg

from gcviewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.