Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution error (MalformedURLException) at java.net.URL/<init> #22

Open
wimvelzeboer opened this issue Jun 11, 2021 · 1 comment
Open

Comments

@wimvelzeboer
Copy link

wimvelzeboer commented Jun 11, 2021

Hi
While trying to setup a connection with Salesforce I ran into the following issue:

Execution error (MalformedURLException) at java.net.URL/ (URL.java:672).
no protocol: /services/data/v51.0/sobjects/Account

This is code that I used, and I got a warning and exception while loading it into the REPL

Connecting to local nREPL server...
nREPL server started on port 56447 on host localhost - nrepl://localhost:56447
Clojure 1.10.1
(ns mytest.core )
=> nil
(use 'salesforce.core)
WARNING: update already refers to: #'clojure.core/update in namespace: clj-http.client, being replaced by: #'clj-http.client/update
=> nil
(def config
  {:client-id "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
   :client-secret "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
   :username "[email protected]"
   :password "XXXXX"
   :security-token ""  
   :login-host "test.salesforce.com"})
=> #'mytest.core/config

(def auth-info (auth! config))
Execution error (ExceptionInfo) at slingshot.support/stack-trace (support.clj:194).
clj-http: status 400

(set-version! (latest-version))
=> "51.0"

(defn foo
  "I don't do a whole lot."
  []
  (println "My First Salesforce connection!")
  (so->all "Account" auth-info))
=> #'mytest.core/foo

(foo)
My First Salesforce connection!
Execution error (MalformedURLException) at java.net.URL/<init> (URL.java:672).
no protocol: /services/data/v51.0/sobjects/Account

Any thoughts on how I can resolve this?

@wimvelzeboer
Copy link
Author

Ah, I seem to have found the issue.
I read in the documentation that you can:

"...optionally pass in :login-host if you want to use test.salesforce.com or my.salesforce.com addresses"

So, I added the :login-host to the config map, but after some digging through the source code it seems that you have to use
:sandbox? :IS_SANDBOX instead.

That's correct right?
Should the README.md file then be updated or is this something that should be added to the source code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant