10
epse
3y

Today in Cursed Java error messages, this beauty: `java.net.MalformedURLException: no protocol: "http://knowledgebase-api.development.svc.cluster.local/..."`

Yes, no protocol. You read that right. There is in fact a protocol there.

Comments
  • 5
    Let us know what the problem was if you solve it.

    Im thinking there might be Something wrong with the string that doesn't show in the error, maybe an extra double slash, fucked up semicolon or something? Possiblly if this isn't comming from the URL or URI class then maybe some 3rd party lib is throwing it explicitly, no idea why they would though?

    Dunno, at first sight it looks good to me too
  • 6
    That exception doesn't usually quote the URL IIRC. Does your URL literally start and end with "? If so then that's the issue.

    Could also be an encoding thing.
  • 9
    @AlmondSauce bingo! Or at least, partially. The config system apparently read in quotes as is, and prepended a BOM (which is invisible in the log)
  • 2
    @Hazarth it's from new URL(url), but nice guess! It's the quotes unfortunately
  • 3
    @epse BOM has bitten me to
  • 0
  • 1
    @johnmelodyme Spring Boot. Simultaneously the best and worst thing
  • 1
    @epse how is spring according to your experience?
  • 1
    @johnmelodyme Spring is fine I guess, the documentation so pretty bad imo, you always have to look for some third party site to figure out the @Annotation magic, but that's an issue in the entire Java ecosystem. Most (even big) libraries we use in this services have "docs" that are little more than an autogenerated list of classes and their methods. And it's pretty heavy if you only use it for a microservice, if you make a monolith then the overhead isn't that bad.

    Overall its pretty decent for the java ecosystem and does provide a lot of utility classes to plaster over some of the glaring deficiencies in the standard library and other common libraries.
  • 1
    @epse interesting...
Add Comment