22 Mar 2014, 11:30
Generic-user-small

Jesse Diaz (4 posts)

Dear Yogthos,

I have gotten to the very end of chapter 5 with minimal fuss, but when I made and ran the home.clj ns I got an error that said hiccup.element wasn’t on the classpath. No matter what I did I could not get the namespace to load. I eventually copied and pasted the code to a new project using the default lein template. hiccup seemed to work, but now I am getting this:

Exception in thread "main" java.io.FileNotFoundException: Could not locate reporting_example/reports?__init.class or reporting_example/reports?.clj on classpath: 

I have triple checked the class-path and name-space names a zillion times but it just isn’t acknowledging that reports.clj’ with (ns reporting-example.reports …) is in the reporting_example folder. I can’t require it in the repl either. I get symbol not found every time I try to call a function from the namespace.

My directory tree structure is printed below. The code itself is basically copied and pasted from the files you have on media.pragprog.com (in case typo was the issue). The core.clj file was automatically included, and I haven’t deleted it yet. I left all those Java .class files in their because I don’t know what they are doing exactly and thought they might help you to help me :)

As an aside, when I ran the

(pdf 
  [{:header "Wow that was easy"}...)

function, it threw up a symbol not found error on the ‘(pdf’ line, but when I replaced it with the example function from clj-pdf in the usage section on github, it worked like a breeze and created the doc.pdf file immediately. No idea why.

Much gratitude,

Jesse

.
├── LICENSE
├── README.md
├── doc
│   └── intro.md
├── project.clj
├── resources
├── src
│   └── reporting_example
│       ├── core.clj
│       ├── models
│       │   └── db.clj
│       ├── reports.clj
│       ├── routes
│       │   └── home.clj
│       └── views
│           └── layout.clj
├── target 
│   ├── classes
│   │   ├── clojure
│   │   │   └── java
│   │   │       ├── jdbc$as_identifier.class
│   │   │       ├── jdbc$as_key.class
│   │   │       ├── jdbc$as_keyword.class
│   │   │       ├── jdbc$as_named_identifier.class 
│   │   │       ├── jdbc$as_named_keyword.class
│   │   │       ├── jdbc$as_properties.class
│   │   │       ├── jdbc$as_quoted_identifier.class
│   │   │       ├── jdbc$as_quoted_str.class
│   │   │       ├── jdbc$as_str.class
│   │   │       ├── jdbc$connection.class
│   │   │       ├── jdbc$create_table.class
│   │   │       ├── jdbc$create_table_ddl$fn__128.class 
│   │   │       ├── jdbc$create_table_ddl$specs_to_string__130.class
│   │   │       ├── jdbc$create_table_ddl.class
│   │   │       ├── jdbc$delete_rows.class
│   │   │       ├── jdbc$do_commands$fn__102.class
│   │   │       ├── jdbc$do_commands.class
│   │   │       ├── jdbc$do_prepared$fn__116.class
│   │   │       ├── jdbc$do_prepared$fn__122.class
│   │   │       ├── jdbc$do_prepared.class
│   │   │       ├── jdbc$do_prepared_return_keys$fn__137.class
│   │   │       ├── jdbc$do_prepared_return_keys.class
│   │   │       ├── jdbc$drop_table.class
│   │   │       ├── jdbc$execute_batch.class
│   │   │       ├── jdbc$find_connection.class
│   │   │       ├── jdbc$fn__31.class
│   │   │       ├── jdbc$get_connection.class
│   │   │       ├── jdbc$insert_record.class
│   │   │       ├── jdbc$insert_records$ins_v__142.class
│   │   │       ├── jdbc$insert_records.class
│   │   │       ├── jdbc$insert_rows.class
│   │   │       ├── jdbc$insert_values.class
│   │   │       ├── jdbc$is_rollback_only.class 
│   │   │       ├── jdbc$loading__4910__auto__.class
│   │   │       ├── jdbc$make_cols_unique$fn__61.class
│   │   │       ├── jdbc$make_cols_unique.class
│   │   │       ├── jdbc$make_name_unique.class
│   │   │       ├── jdbc$parse_properties_uri.class  
│   │   │       ├── jdbc$prepare_statement$fn__109.class 
│   │   │       ├── jdbc$prepare_statement.class
│   │   │       ├── jdbc$print_sql_exception.class
│   │   │       ├── jdbc$print_sql_exception_chain.class
│   │   │       ├── jdbc$print_update_counts$fn__157.class
│   │   │       ├── jdbc$print_update_counts.class 
│   │   │       ├── jdbc$resultset_seq$fn__65.class
│   │   │       ├── jdbc$resultset_seq$row_values__67$fn__68.class
│   │   │       ├── jdbc$resultset_seq$row_values__67.class
│   │   │       ├── jdbc$resultset_seq$thisfn__71$fn__72.class
│   │   │       ├── jdbc$resultset_seq$thisfn__71.class
│   │   │       ├── jdbc$resultset_seq.class
│   │   │       ├── jdbc$rollback$fn__86.class  
│   │   │       ├── jdbc$rollback.class
│   │   │       ├── jdbc$set_parameters$fn__113.class
│   │   │       ├── jdbc$set_parameters.class 
│   │   │       ├── jdbc$set_rollback_only.class
│   │   │       ├── jdbc$strip_jdbc.class
│   │   │       ├── jdbc$transaction.class
│   │   │       ├── jdbc$transaction_STAR_$throw_non_rte__89.class
│   │   │       ├── jdbc$transaction_STAR_.class
│   │   │       ├── jdbc$update_or_insert_values$fn__150.class
│   │   │       ├── jdbc$update_or_insert_values.class
│   │   │       ├── jdbc$update_values.class
│   │   │       ├── jdbc$with_connection.class
│   │   │       ├── jdbc$with_connection_STAR_.class
│   │   │       ├── jdbc$with_naming_strategy.class
│   │   │       ├── jdbc$with_query_results.class
│   │   │       ├── jdbc$with_query_results_STAR_.class
│   │   │       ├── jdbc$with_quoted_identifiers.class
│   │   │       └── jdbc__init.class
│   │   └── reporting_example
│   │       ├── core$fn__26.class
│   │       ├── core$foo.class
│   │       ├── core$loading__4910__auto__.class
│   │       ├── core__init.class
│   │       └── models
│   │           ├── db$create_employee_table.class
│   │           ├── db$fn__160.class
│   │           ├── db$loading__4910__auto__.class
│   │           ├── db$read_employees$fn__163$fn__164.class
│   │           ├── db$read_employees$fn__163.class  
│   │           ├── db$read_employees.class
│   │           └── db__init.class
│   └── stale
│       └── extract-native.dependencies
└── test
    └── reporting_example
        └── core_test.clj
22 Mar 2014, 11:29
Generic-user-small

Jesse Diaz (4 posts)

Nevermind. After closing and reopening lighttable it suddenly recognized the namespace in the path and I was able to include layout.clj and all of the server stuff to get it to display.

  You must be logged in to comment