# FileNotFound Exception with example code

**URL:** <https://forum.datomic.com/t/filenotfound-exception-with-example-code/496>\
**Category:** Datomic Cloud\
**Created:** [June 29, 2018, 5:47am UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496 "2018-06-29T05:47:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkrishnan2005](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hkrishnan2005](https://forum.datomic.com/u/hkrishnan2005)\
**Post date:** [June 29, 2018, 5:47am UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/1 "2018-06-29T05:47:57Z")

</div>

When used the ION Starter files in my example, I am getting this error…

CompilerException java.io.FileNotFoundException: Could not locate datomic/ion/lambda/api\_gateway\_\_init.class or datomic/ion/lambda/api\_gateway.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name., compiling:(/Users/horizon/clj\_projects/dctest/src/clj/dctest/datomic/ion/starter.clj:1:1)

DEPS.EDN file

{:paths [“src” “resources”]  
:deps {;; Note that the Datomic client API is _not_ a production  
;; dep. It is already installed for you in Datomic Cloud.

```
    ;; The ion library includes helpers for interacting with
    ;; AWS, e.g. the ionize function to convert a Ring-like
    ;; web function so that it implements the contract expected
    ;; by AWS API Gateway.
    com.datomic/ion {:mvn/version "0.9.7"}
    org.clojure/data.json {:mvn/version "0.2.6"}
    org.clojure/clojure {:mvn/version "1.9.0"}
    com.datomic/ion-dev {:mvn/version "0.9.162"}
    com.datomic/client-cloud {:mvn/version "0.8.54"}}

```

:mvn/repos {“datomic-cloud” {:url “s3://datomic-releases-1fc2183a/maven/releases”}}  
:aliases  
{:dev  
{:extra-deps  
{  
;; The client-cloud library is a dev-time only dep  
;; so that you can test interactively from a REPL.  
com.datomic/client-cloud {:mvn/version “0.8.54”}

```
;; The ion-dev tooling implements the :push and
;; :deploy commands and is needed only at dev time.
com.datomic/ion-dev {:mvn/version "0.9.162"}}}}}
```

---

<div class="post-metadata">

**Author:** ![hkrishnan2005](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hkrishnan2005](https://forum.datomic.com/u/hkrishnan2005)\
**Post date:** [July 2, 2018, 10:53pm UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/2 "2018-07-02T22:53:19Z")

</div>

Any suggestion? May be I am doing something very silly…

---

<div class="post-metadata">

**Author:** ![jaret](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/jaret/32/45_2.png) [@jaret](https://forum.datomic.com/u/jaret)\
**Post date:** [July 3, 2018, 1:25pm UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/3 "2018-07-03T13:25:11Z")

</div>

Hi Hkrishnan2005,

What command are you running at the time of this error? Could you copy it here? Are you running a :push?

Thanks,  
Jaret

---

<div class="post-metadata">

**Author:** ![hkrishnan2005](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hkrishnan2005](https://forum.datomic.com/u/hkrishnan2005)\
**Post date:** [July 3, 2018, 2:10pm UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/4 "2018-07-03T14:10:16Z")

</div>

clj…following exactly as the tutorial/the video says…trying to ionize the function…My objective is to move my backend functions to ions behind a lambda, and connect it to an API Gateway…

I also added the deps.edn/config files to an existing project…with lein-tools-deps plugin…

Additional errors…

Could not find artifact com.datomic:ion:jar:0.9.7 in central ([https://repo1.maven.org/maven2/](https://repo1.maven.org/maven2/))  
Could not find artifact com.datomic:ion:jar:0.9.7 in clojars ([https://repo.clojars.org/](https://repo.clojars.org/))  
Could not find artifact com.datomic:java-io:jar:0.1.12 in central ([https://repo1.maven.org/maven2/](https://repo1.maven.org/maven2/))  
Could not find artifact com.datomic:java-io:jar:0.1.12 in clojars ([https://repo.clojars.org/](https://repo.clojars.org/))  
Could not find artifact com.cognitect:s3-libs:jar:0.9.34 in central ([https://repo1.maven.org/maven2/](https://repo1.maven.org/maven2/))  
Could not find artifact com.cognitect:s3-libs:jar:0.9.34 in clojars ([https://repo.clojars.org/](https://repo.clojars.org/))  
Could not find artifact com.datomic:ion-dev:jar:0.9.162 in central ([https://repo1.maven.org/maven2/](https://repo1.maven.org/maven2/))  
Could not find artifact com.datomic:ion-dev:jar:0.9.162 in clojars ([https://repo.clojars.org/](https://repo.clojars.org/))  
This could be due to a typo in :dependencies, file system permissions, or network issues.

Going back to basics… trying create a simple web app with (cljs/reagent/figwheel) front end, accessing Datomic Cloud backend, with local dev, and prod on aws…

A few guide lines on the workflow might be useful. Thanks.

---

<div class="post-metadata">

**Author:** ![jaret](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/jaret/32/45_2.png) [@jaret](https://forum.datomic.com/u/jaret)\
**Post date:** [July 3, 2018, 7:37pm UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/5 "2018-07-03T19:37:56Z")

</div>

I’d recommend that you leave lein out of the equation and use only what is in the Ions Tutorial. Start with Ion-starter tutorial app and build up to your application:

[https://docs.datomic.com/cloud/ions/ions-tutorial.html](https://docs.datomic.com/cloud/ions/ions-tutorial.html)

If you still run into errors pulling down the artifacts please post the results here.

---

<div class="post-metadata">

**Author:** ![sho](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@sho](https://forum.datomic.com/u/sho)\
**Post date:** [July 18, 2018, 6:32am UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/7 "2018-07-18T06:32:56Z")

</div>

Hi @jaret,

I’m grappling with the same exception, which shows up when I require datomic.client.api. Initially I had no such issue with the ion-starter tutorial and had been able to build my own ion project without problem. But at one point, requiring datomic.client.api started failing. Not quite sure how to solve it, I just deleted .m2 folder, reinstalled clojure, and downloaded the fresh ion-starter tutorial from the git repo. When I try to load the starter.clj file, I get the following error.

```auto
2. Unhandled clojure.lang.Compiler$CompilerException
   Error compiling src/datomic/ion/starter.clj at (1:1)

1. Caused by java.io.FileNotFoundException
   Could not locate datomic/client/api__init.class or datomic/client/api.clj on
   classpath.

                   RT.java: 463 clojure.lang.RT/load
                   RT.java: 426 clojure.lang.RT/load
                  core.clj: 6046 clojure.core/load/fn
                  core.clj: 6045 clojure.core/load
                  core.clj: 6029 clojure.core/load
               RestFn.java: 408 clojure.lang.RestFn/invoke
                  core.clj: 5848 clojure.core/load-one
                  core.clj: 5843 clojure.core/load-one
                  core.clj: 5888 clojure.core/load-lib/fn
                  core.clj: 5887 clojure.core/load-lib
                  core.clj: 5868 clojure.core/load-lib
               RestFn.java: 142 clojure.lang.RestFn/applyTo
                  core.clj: 659 clojure.core/apply
                  core.clj: 5925 clojure.core/load-libs
                  core.clj: 5909 clojure.core/load-libs
               RestFn.java: 137 clojure.lang.RestFn/applyTo
                  core.clj: 659 clojure.core/apply
                  core.clj: 5947 clojure.core/require
                  core.clj: 5947 clojure.core/require
               RestFn.java: 512 clojure.lang.RestFn/invoke
               starter.clj: 4 datomic.ion.starter/eval10717/loading--auto--
               starter.clj: 4 datomic.ion.starter/eval10717
               starter.clj: 4 datomic.ion.starter/eval10717
             Compiler.java: 7062 clojure.lang.Compiler/eval
             Compiler.java: 7051 clojure.lang.Compiler/eval
             Compiler.java: 7514 clojure.lang.Compiler/load
                       nil: 1 user$eval10710/invokeStatic
                       nil: 1 user$eval10710/invoke
             Compiler.java: 7062 clojure.lang.Compiler/eval
             Compiler.java: 7025 clojure.lang.Compiler/eval
                  core.clj: 3206 clojure.core/eval
                  core.clj: 3202 clojure.core/eval
                  main.clj: 243 clojure.main/repl/read-eval-print/fn
                  main.clj: 243 clojure.main/repl/read-eval-print
                  main.clj: 261 clojure.main/repl/fn
                  main.clj: 261 clojure.main/repl
                  main.clj: 177 clojure.main/repl
               RestFn.java: 1523 clojure.lang.RestFn/invoke
    interruptible_eval.clj: 87 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
                  AFn.java: 152 clojure.lang.AFn/applyToHelper
                  AFn.java: 144 clojure.lang.AFn/applyTo
                  core.clj: 657 clojure.core/apply
                  core.clj: 1965 clojure.core/with-bindings*
                  core.clj: 1965 clojure.core/with-bindings*
               RestFn.java: 425 clojure.lang.RestFn/invoke
    interruptible_eval.clj: 85 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj: 55 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj: 222 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
    interruptible_eval.clj: 190 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
                  AFn.java: 22 clojure.lang.AFn/run
   ThreadPoolExecutor.java: 1149 java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java: 624 java.util.concurrent.ThreadPoolExecutor$Worker/run
               Thread.java: 748 java.lang.Thread/run

```

---

<div class="post-metadata">

**Author:** ![sho](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@sho](https://forum.datomic.com/u/sho)\
**Post date:** [July 18, 2018, 7:12am UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/8 "2018-07-18T07:12:02Z")

</div>

@hkrishnan2005 @jaret, I have found a solution at least for my case.

I checked .m2 folder which was emptied minutes ago and found the com/datomic/client-cloud folder missing. So I added the datomic-cloud dependency to the main :deps map and then I see the exception disappear. However, if I remove the dependency from the :deps map and only keep :extra-deps in the dev aliase, I get the exception back again.

@hkrishnan2005 From my experience, I suggest you include com.datomic/ion-dev in the main :deps map.

@jaret What puzzles me is that I didn’t have this kind of trouble when I did the ion-starter project a few weeks ago. I mean I didn’t need to add the com.datomic/client-cloud to the main :deps map. Now I’ve got to. Weird. I’m not well-educated about dependency problems, so I cannot provide better explanation than this report.

---

<div class="post-metadata">

**Author:** ![theronic](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/theronic/32/198_2.png) [@theronic](https://forum.datomic.com/u/theronic)\
**Post date:** [July 20, 2018, 2:16pm UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/9 "2018-07-20T14:16:41Z")

</div>

Having the same problem with ion-starter tutorial. I tried to manually delete the datomic/ion-dev and ~/datomic-cloud folders from ~/.m2 in the hope that it would refetch, but no dice.

---

<div class="post-metadata">

**Author:** ![theronic](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/theronic/32/198_2.png) [@theronic](https://forum.datomic.com/u/theronic)\
**Post date:** [July 20, 2018, 2:26pm UTC](https://forum.datomic.com/t/filenotfound-exception-with-example-code/496/10 "2018-07-20T14:26:30Z")

</div>

Resolved by updating clojure-tools to fix deps.edn alias support. I’m on OSX, so I ran `brew upgrade clojure` and this fixed it.
