How to use a Java SDK from Amazon?

2016-01-09 Thread Laws
I'm not sure if this is a Clojure question, but I'm not sure where else to 
ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
with this requirement, which I must deal with if I am to get the app into 
the Amazon app store: 

Check the request signature to verify the authenticity of the request. 
Alexa signs all HTTPS requests.
   
   - The Java library does this verification in the SpeechletServlet class. 
   If you do not use the Java library, you must do this verification yourself.
   - If you use the Java library without using the SpeechletServlet class, 
   you can use theSpeechletRequestSignatureVerifier class to do this.


For some bizarre reason, Amazon does not make its SDK available via the 
main Maven repository. Many developers have asked Amazon to change this, 
but for now, we have to: 

git clone g...@github.com:amzn/alexa-skills-kit-java.git

I thought I could then: 

cp -r ../../alexa-skills-kit-java/src/* src/java/

In my project.clj file I have: 

  :source-paths  ["src/clojure"]
  :java-source-paths ["src/java"]
  :main salesslick.core
  :aot :all

So all of alexa-skills-kit-java/src is now in my src/java directory. 

I still end up with these kinds of dependency issues: 

Compiling 47 source files to 
/Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
 
error: package org.slf4j does not exist
import org.slf4j.Logger;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
 
error: package org.slf4j does not exist
import org.slf4j.LoggerFactory;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
 
error: cannot find symbol
private static final Logger log = 
LoggerFactory.getLogger(ApplicationIdVerifier.class);
^
symbol: class Logger
location: class ApplicationIdVerifier
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^

[shortened to avoid boredom]


What would I have to do to get a line such as this to resolve: 

import org.apache.commons.lang3.Validate;

??? 

I know there are many Clojure developers who also do a great deal of Java 
development, but I am not one of them. I love Clojure/Leinengen because 
most of the time it protects me from this craziness. 

However, if I knew of an easy way to compile the Amazon SDK on its own, 
then I would be happy to compile it and include it as a Jar. I have 
included Jars before, so I am fairly comfortable with that process. 

Any suggestions? 






-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Laws
Nevermind. I just noticed they offer a Jar:

https://github.com/amzn/alexa-skills-kit-java/tree/master/repo/alexa-skills-kit/alexa-skills-kit/1.1

I'll just use that.

Ignore this post. 


On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>
> I'm not sure if this is a Clojure question, but I'm not sure where else to 
> ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
> with this requirement, which I must deal with if I am to get the app into 
> the Amazon app store: 
>
> Check the request signature to verify the authenticity of the request. 
> Alexa signs all HTTPS requests.
>
>- The Java library does this verification in the SpeechletServlet class. 
>If you do not use the Java library, you must do this verification yourself.
>- If you use the Java library without using the SpeechletServlet class, 
>you can use theSpeechletRequestSignatureVerifier class to do this.
>
>
> For some bizarre reason, Amazon does not make its SDK available via the 
> main Maven repository. Many developers have asked Amazon to change this, 
> but for now, we have to: 
>
> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>
> I thought I could then: 
>
> cp -r ../../alexa-skills-kit-java/src/* src/java/
>
> In my project.clj file I have: 
>
>   :source-paths  ["src/clojure"]
>   :java-source-paths ["src/java"]
>   :main salesslick.core
>   :aot :all
>
> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>
> I still end up with these kinds of dependency issues: 
>
> Compiling 47 source files to 
> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>  
> error: package org.slf4j does not exist
> import org.slf4j.Logger;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>  
> error: package org.slf4j does not exist
> import org.slf4j.LoggerFactory;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>  
> error: cannot find symbol
> private static final Logger log = 
> LoggerFactory.getLogger(ApplicationIdVerifier.class);
> ^
> symbol: class Logger
> location: class ApplicationIdVerifier
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
>
> [shortened to avoid boredom]
>
>
> What would I have to do to get a line such as this to resolve: 
>
> import org.apache.commons.lang3.Validate;
>
> ??? 
>
> I know there are many Clojure developers who also do a great deal of Java 
> development, but I am not one of them. I love Clojure/Leinengen because 
> most of the time it protects me from this craziness. 
>
> However, if I knew of an easy way to compile the Amazon SDK on its own, 
> then I would be happy to compile it and include it as a Jar. I have 
> included Jars before, so I am fairly comfortable with that process. 
>
> Any suggestions? 
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Laws
Damn. I tried localrepo, just like I have in the past: 

lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1

and then in project.clj: 

  :dependencies [[org.clojure/clojure "1.6.0"]
 [alexa-sdk "1.1"]

but I still ran into configuration issues:

Compiling salesvoice.core
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/slf4j/LoggerFactory, compiling:(query.clj:1:1)

Have others dealt with this issue, when using an SDK that uses slf4j? Is 
there an obvious way to configure this? 



On Saturday, January 9, 2016 at 5:17:00 PM UTC-5, Laws wrote:
>
> Nevermind. I just noticed they offer a Jar:
>
>
> https://github.com/amzn/alexa-skills-kit-java/tree/master/repo/alexa-skills-kit/alexa-skills-kit/1.1
>
> I'll just use that.
>
> Ignore this post. 
>
>
> On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>>
>> I'm not sure if this is a Clojure question, but I'm not sure where else 
>> to ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
>> with this requirement, which I must deal with if I am to get the app into 
>> the Amazon app store: 
>>
>> Check the request signature to verify the authenticity of the request. 
>> Alexa signs all HTTPS requests.
>>
>>- The Java library does this verification in the SpeechletServlet class. 
>>If you do not use the Java library, you must do this verification 
>> yourself.
>>- If you use the Java library without using the SpeechletServlet class, 
>>you can use theSpeechletRequestSignatureVerifier class to do this.
>>
>>
>> For some bizarre reason, Amazon does not make its SDK available via the 
>> main Maven repository. Many developers have asked Amazon to change this, 
>> but for now, we have to: 
>>
>> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>>
>> I thought I could then: 
>>
>> cp -r ../../alexa-skills-kit-java/src/* src/java/
>>
>> In my project.clj file I have: 
>>
>>   :source-paths  ["src/clojure"]
>>   :java-source-paths ["src/java"]
>>   :main salesslick.core
>>   :aot :all
>>
>> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>>
>> I still end up with these kinds of dependency issues: 
>>
>> Compiling 47 source files to 
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>>  
>> error: package org.slf4j does not exist
>> import org.slf4j.Logger;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>>  
>> error: package org.slf4j does not exist
>> import org.slf4j.LoggerFactory;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>>  
>> error: cannot find symbol
>> private static final Logger log = 
>> LoggerFactory.getLogger(ApplicationIdVerifier.class);
>> ^
>> symbol: class Logger
>> location: class ApplicationIdVerifier
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>>
>> [shortened to avoid boredom]
>>
>>
>> What would I have to do to get a line such as this to resolve: 
>>
>> import org.apache.commons.lang3.Validate;
>>
>> ??? 
>>
>> I know there are many Clojure developers who also do a great deal of Java 
>> development, but I am not one of them. I love Clojure/Leinengen because 
>> most of the time it protects me from this craziness. 
>>
>> However, if I knew of an easy way to compile the Amazon SDK on its own, 
>> then I would be happy to compile it and include it as a Jar. I have 
>> included Jars before, so I am fairly comfortable with that process. 
>>
>> Any suggestions? 
>>
>>
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at

Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Allen Johnson
I'm not sure if this helps but a quick glance at the github project you
linked to contains a pom file which uses the following maven coordinates:


  com.amazon.alexa
  alexa-skills-kit
  1.1.1


You may want to try that in leiningen instead.

:dependencies [[org.clojure/clojure "1.6.0"]
 [com.amazon.alexa/alexa-skills-kit "1.1.1"]]

If that doesn't transitively pull in the other dependencies you need then
you could try to list them manually -- refer to the sample pom file[1].

[1]:
https://github.com/amzn/alexa-skills-kit-java/blob/master/samples/pom.xml

Good luck!

AJ


On Sat, Jan 9, 2016 at 5:39 PM Laws  wrote:

> Damn. I tried localrepo, just like I have in the past:
>
> lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1
>
> and then in project.clj:
>
>   :dependencies [[org.clojure/clojure "1.6.0"]
>  [alexa-sdk "1.1"]
>
> but I still ran into configuration issues:
>
> Compiling salesvoice.core
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/slf4j/LoggerFactory, compiling:(query.clj:1:1)
>
> Have others dealt with this issue, when using an SDK that uses slf4j? Is
> there an obvious way to configure this?
>
>
>
> On Saturday, January 9, 2016 at 5:17:00 PM UTC-5, Laws wrote:
>>
>> Nevermind. I just noticed they offer a Jar:
>>
>>
>> https://github.com/amzn/alexa-skills-kit-java/tree/master/repo/alexa-skills-kit/alexa-skills-kit/1.1
>>
>> I'll just use that.
>>
>> Ignore this post.
>>
>>
>> On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>>>
>>> I'm not sure if this is a Clojure question, but I'm not sure where else
>>> to ask. I've been working on an app for the Amazon Echo. I'm trying to deal
>>> with this requirement, which I must deal with if I am to get the app into
>>> the Amazon app store:
>>>
>>> Check the request signature to verify the authenticity of the request.
>>> Alexa signs all HTTPS requests.
>>>
>>>- The Java library does this verification in the SpeechletServlet class.
>>>If you do not use the Java library, you must do this verification 
>>> yourself.
>>>- If you use the Java library without using the SpeechletServlet class,
>>>you can use theSpeechletRequestSignatureVerifier class to do this.
>>>
>>>
>>> For some bizarre reason, Amazon does not make its SDK available via the
>>> main Maven repository. Many developers have asked Amazon to change this,
>>> but for now, we have to:
>>>
>>> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>>>
>>> I thought I could then:
>>>
>>> cp -r ../../alexa-skills-kit-java/src/* src/java/
>>>
>>> In my project.clj file I have:
>>>
>>>   :source-paths  ["src/clojure"]
>>>   :java-source-paths ["src/java"]
>>>   :main salesslick.core
>>>   :aot :all
>>>
>>> So all of alexa-skills-kit-java/src is now in my src/java directory.
>>>
>>> I still end up with these kinds of dependency issues:
>>>
>>> Compiling 47 source files to
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>>> error: package org.slf4j does not exist
>>> import org.slf4j.Logger;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>>> error: package org.slf4j does not exist
>>> import org.slf4j.LoggerFactory;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>>> error: cannot find symbol
>>> private static final Logger log =
>>> LoggerFactory.getLogger(ApplicationIdVerifier.class);
>>> ^
>>> symbol: class Logger
>>> location: class ApplicationIdVerifier
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>>
>>> [shortened to avoid boredom]
>>>
>>>
>>> What would I have to do to get a line such as this to resolve:
>>>
>>> import org.apache.commons.lang3.Validate;
>>>
>>> ???
>>>
>>> I know there are many Clojure developers who also do a great deal of
>>> Java development, but I am not one of them. I love 

Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Shantanu Kumar


On Sunday, 10 January 2016 04:09:45 UTC+5:30, Laws wrote:
>
> Damn. I tried localrepo, just like I have in the past: 
>
> lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1
>
> and then in project.clj: 
>
>   :dependencies [[org.clojure/clojure "1.6.0"]
>  [alexa-sdk "1.1"]
>
> but I still ran into configuration issues:
>
> Compiling salesvoice.core
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/slf4j/LoggerFactory, compiling:(query.clj:1:1)
>
> Have others dealt with this issue, when using an SDK that uses slf4j? Is 
> there an obvious way to configure this? 
>

Logback natively implements the SLF4j API. I guess including Logback in 
your dependencies and putting in a resources/logback.xml file for 
configuration would do the trick. For example, 
https://github.com/kumarshantanu/logback-bundle (just stick to core-bundle 
for a start) includes several related logback artifacts to make it all work 
together.

Shantanu
 

>
>
>
> On Saturday, January 9, 2016 at 5:17:00 PM UTC-5, Laws wrote:
>>
>> Nevermind. I just noticed they offer a Jar:
>>
>>
>> https://github.com/amzn/alexa-skills-kit-java/tree/master/repo/alexa-skills-kit/alexa-skills-kit/1.1
>>
>> I'll just use that.
>>
>> Ignore this post. 
>>
>>
>> On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>>>
>>> I'm not sure if this is a Clojure question, but I'm not sure where else 
>>> to ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
>>> with this requirement, which I must deal with if I am to get the app into 
>>> the Amazon app store: 
>>>
>>> Check the request signature to verify the authenticity of the request. 
>>> Alexa signs all HTTPS requests.
>>>
>>>- The Java library does this verification in the SpeechletServlet class. 
>>>If you do not use the Java library, you must do this verification 
>>> yourself.
>>>- If you use the Java library without using the SpeechletServlet class, 
>>>you can use theSpeechletRequestSignatureVerifier class to do this.
>>>
>>>
>>> For some bizarre reason, Amazon does not make its SDK available via the 
>>> main Maven repository. Many developers have asked Amazon to change this, 
>>> but for now, we have to: 
>>>
>>> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>>>
>>> I thought I could then: 
>>>
>>> cp -r ../../alexa-skills-kit-java/src/* src/java/
>>>
>>> In my project.clj file I have: 
>>>
>>>   :source-paths  ["src/clojure"]
>>>   :java-source-paths ["src/java"]
>>>   :main salesslick.core
>>>   :aot :all
>>>
>>> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>>>
>>> I still end up with these kinds of dependency issues: 
>>>
>>> Compiling 47 source files to 
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>>>  
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>>>  
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>>>  
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>>>  
>>> error: package org.slf4j does not exist
>>> import org.slf4j.Logger;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>>>  
>>> error: package org.slf4j does not exist
>>> import org.slf4j.LoggerFactory;
>>> ^
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>>>  
>>> error: cannot find symbol
>>> private static final Logger log = 
>>> LoggerFactory.getLogger(ApplicationIdVerifier.class);
>>> ^
>>> symbol: class Logger
>>> location: class ApplicationIdVerifier
>>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>>>  
>>> error: package org.apache.commons.lang3 does not exist
>>> import org.apache.commons.lang3.Validate;
>>> ^
>>>
>>> [shortened to avoid boredom]
>>>
>>>
>>> What would I have to do to get a line such as this to resolve: 
>>>
>>> import org.apache.commons.lang3.Validate;
>>>
>>> ??? 
>>>
>>> I know there are many Clojure developers who also do a great deal of 
>>> Java development, but I am not one of them. I love Clojure/Leinengen 
>>> because most of the time it protects me from this craziness. 
>>>
>>> However, if I knew of an easy way to compile the Amazon SDK on its own, 
>>> then 

[ANN] 19th Tutorial the modern-cljs

2016-01-09 Thread Mimmo Cosenza
Hi all,
I just published the 19th tutorial of the modern-cljs series. Based on a 
reference sample, it tries to explain how to make a library compliant with the 
Reader Conditionals extension:

https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-19.md
 


HIH

Cheers

Mimmo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Laws

Thanks for all the suggestions. I got this working like this:

I used the Leinengen "localrepo" plugin to install the Amazon SDK like this:

lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1

and this created a very basic pom.xml file here: 

~/.m2/repository/alexa-sdk/alexa-sdk/1.1/alexa-sdk-1.1.pom

and this file only consisted of: 


http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
  4.0.0
  alexa-sdk
  alexa-sdk
  1.1
  alexa-sdk


So I opened this file up in emacs and I put the cursor between these 2 
lines: 

  alexa-sdk



and then I copy and pasted most of the content of this file: 

https://github.com/amzn/alexa-skills-kit-java/blob/master/samples/pom.xml

I copied 
   

and that got me passed the dependency errors. 




On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>
> I'm not sure if this is a Clojure question, but I'm not sure where else to 
> ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
> with this requirement, which I must deal with if I am to get the app into 
> the Amazon app store: 
>
> Check the request signature to verify the authenticity of the request. 
> Alexa signs all HTTPS requests.
>
>- The Java library does this verification in the SpeechletServlet class. 
>If you do not use the Java library, you must do this verification yourself.
>- If you use the Java library without using the SpeechletServlet class, 
>you can use theSpeechletRequestSignatureVerifier class to do this.
>
>
> For some bizarre reason, Amazon does not make its SDK available via the 
> main Maven repository. Many developers have asked Amazon to change this, 
> but for now, we have to: 
>
> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>
> I thought I could then: 
>
> cp -r ../../alexa-skills-kit-java/src/* src/java/
>
> In my project.clj file I have: 
>
>   :source-paths  ["src/clojure"]
>   :java-source-paths ["src/java"]
>   :main salesslick.core
>   :aot :all
>
> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>
> I still end up with these kinds of dependency issues: 
>
> Compiling 47 source files to 
> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>  
> error: package org.slf4j does not exist
> import org.slf4j.Logger;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>  
> error: package org.slf4j does not exist
> import org.slf4j.LoggerFactory;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>  
> error: cannot find symbol
> private static final Logger log = 
> LoggerFactory.getLogger(ApplicationIdVerifier.class);
> ^
> symbol: class Logger
> location: class ApplicationIdVerifier
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
>
> [shortened to avoid boredom]
>
>
> What would I have to do to get a line such as this to resolve: 
>
> import org.apache.commons.lang3.Validate;
>
> ??? 
>
> I know there are many Clojure developers who also do a great deal of Java 
> development, but I am not one of them. I love Clojure/Leinengen because 
> most of the time it protects me from this craziness. 
>
> However, if I knew of an easy way to compile the Amazon SDK on its own, 
> then I would be happy to compile it and include it as a Jar. I have 
> included Jars before, so I am fairly comfortable with that process. 
>
> Any suggestions? 
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at

Re: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread Laws
And yes, I did try running "lein clean".


On Sunday, January 10, 2016 at 2:28:00 AM UTC-5, Laws wrote:
>
> I've been staring at this for awhile, and moving it around, and re-typing 
> it, without seeing what the real error is. 
>
> I have a file called server.clj which includes this at the top in its 
> namespace declaration: 
>
> (ns salesvoice.server
>   (:require
>[salesvoice.query :as query]
>
>
> In query.clj, I have this: 
>
>
> (defn make-response
>   [company-name outputSpeech-text]
>   {"version"  "1.0"
>"sessionAttributes"  {
>  "company-name"  company-name
>  "user-id" "user-id"
>  }
>"response"  {
> "outputSpeech"  {
>  "type"  "PlainText"
>  "text"  outputSpeech-text
>  }
> "card"  {
>  "type"  "Simple"
>  "title"  (str "Sales Report for " company-name)
>  "content"  outputSpeech-text
>  } 
> "reprompt"  {
>  "outputSpeech"  {
>   "type"  "PlainText"
>   "text"  "Can I help you with 
> anything else?"
>   }
>  }
> "shouldEndSession"  true
> }
>})
>
>
> When I type "lein uberjar" at the command line I get: 
>
>
> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
> declaration make-response should be a vector, compiling:(server.clj:1:1)
>
> The parameter declaration for make-response is a vector. I am not clear 
> why I am getting this error. 
>
> Things I tried:
>
> 1.) moving this around in the file. It had been in the middle of 
> query.clj, but I moved it to the top, its now the first function defined in 
> that file
>
> 2.) re-typing the parameter declaration
>
> 3.) looking for other functions that have the same name, but grep shows 
> this is the only declaration
>
> So what could the real issue be? 
>
> Also, why does the error seem to show up when server.clj is including 
> query.clj. Shouldn't the error appear when query.clj is compiled? 
>
>
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread Laws
I've been staring at this for awhile, and moving it around, and re-typing 
it, without seeing what the real error is. 

I have a file called server.clj which includes this at the top in its 
namespace declaration: 

(ns salesvoice.server
  (:require
   [salesvoice.query :as query]


In query.clj, I have this: 


(defn make-response
  [company-name outputSpeech-text]
  {"version"  "1.0"
   "sessionAttributes"  {
 "company-name"  company-name
 "user-id" "user-id"
 }
   "response"  {
"outputSpeech"  {
 "type"  "PlainText"
 "text"  outputSpeech-text
 }
"card"  {
 "type"  "Simple"
 "title"  (str "Sales Report for " company-name)
 "content"  outputSpeech-text
 } 
"reprompt"  {
 "outputSpeech"  {
  "type"  "PlainText"
  "text"  "Can I help you with 
anything else?"
  }
 }
"shouldEndSession"  true
}
   })


When I type "lein uberjar" at the command line I get: 


Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
declaration make-response should be a vector, compiling:(server.clj:1:1)

The parameter declaration for make-response is a vector. I am not clear why 
I am getting this error. 

Things I tried:

1.) moving this around in the file. It had been in the middle of query.clj, 
but I moved it to the top, its now the first function defined in that file

2.) re-typing the parameter declaration

3.) looking for other functions that have the same name, but grep shows 
this is the only declaration

So what could the real issue be? 

Also, why does the error seem to show up when server.clj is including 
query.clj. Shouldn't the error appear when query.clj is compiled? 









-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread James Elliott
That is puzzling indeed. There doesn’t seem to be anything wrong with the 
function itself, as you say. I can evaluate it and run it.

There must be some other element of your environment which you have not 
shared here which is throwing sand in the gears.

On Sunday, January 10, 2016 at 1:28:00 AM UTC-6, Laws wrote:
>
> I've been staring at this for awhile, and moving it around, and re-typing 
> it, without seeing what the real error is. 
>
> I have a file called server.clj which includes this at the top in its 
> namespace declaration: 
>
> (ns salesvoice.server
>   (:require
>[salesvoice.query :as query]
>
>
> In query.clj, I have this: 
>
>
> (defn make-response
>   [company-name outputSpeech-text]
>   {"version"  "1.0"
>"sessionAttributes"  {
>  "company-name"  company-name
>  "user-id" "user-id"
>  }
>"response"  {
> "outputSpeech"  {
>  "type"  "PlainText"
>  "text"  outputSpeech-text
>  }
> "card"  {
>  "type"  "Simple"
>  "title"  (str "Sales Report for " company-name)
>  "content"  outputSpeech-text
>  } 
> "reprompt"  {
>  "outputSpeech"  {
>   "type"  "PlainText"
>   "text"  "Can I help you with 
> anything else?"
>   }
>  }
> "shouldEndSession"  true
> }
>})
>
>
> When I type "lein uberjar" at the command line I get: 
>
>
> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
> declaration make-response should be a vector, compiling:(server.clj:1:1)
>
> The parameter declaration for make-response is a vector. I am not clear 
> why I am getting this error. 
>
> Things I tried:
>
> 1.) moving this around in the file. It had been in the middle of 
> query.clj, but I moved it to the top, its now the first function defined in 
> that file
>
> 2.) re-typing the parameter declaration
>
> 3.) looking for other functions that have the same name, but grep shows 
> this is the only declaration
>
> So what could the real issue be? 
>
> Also, why does the error seem to show up when server.clj is including 
> query.clj. Shouldn't the error appear when query.clj is compiled? 
>
>
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread Laws
I would guess that I was dealing with some variant of this: 

http://dev.clojure.org/jira/browse/CLJ-1629

but I can not figure out how my function is malformed. 


On Sunday, January 10, 2016 at 2:28:00 AM UTC-5, Laws wrote:
>
> I've been staring at this for awhile, and moving it around, and re-typing 
> it, without seeing what the real error is. 
>
> I have a file called server.clj which includes this at the top in its 
> namespace declaration: 
>
> (ns salesvoice.server
>   (:require
>[salesvoice.query :as query]
>
>
> In query.clj, I have this: 
>
>
> (defn make-response
>   [company-name outputSpeech-text]
>   {"version"  "1.0"
>"sessionAttributes"  {
>  "company-name"  company-name
>  "user-id" "user-id"
>  }
>"response"  {
> "outputSpeech"  {
>  "type"  "PlainText"
>  "text"  outputSpeech-text
>  }
> "card"  {
>  "type"  "Simple"
>  "title"  (str "Sales Report for " company-name)
>  "content"  outputSpeech-text
>  } 
> "reprompt"  {
>  "outputSpeech"  {
>   "type"  "PlainText"
>   "text"  "Can I help you with 
> anything else?"
>   }
>  }
> "shouldEndSession"  true
> }
>})
>
>
> When I type "lein uberjar" at the command line I get: 
>
>
> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
> declaration make-response should be a vector, compiling:(server.clj:1:1)
>
> The parameter declaration for make-response is a vector. I am not clear 
> why I am getting this error. 
>
> Things I tried:
>
> 1.) moving this around in the file. It had been in the middle of 
> query.clj, but I moved it to the top, its now the first function defined in 
> that file
>
> 2.) re-typing the parameter declaration
>
> 3.) looking for other functions that have the same name, but grep shows 
> this is the only declaration
>
> So what could the real issue be? 
>
> Also, why does the error seem to show up when server.clj is including 
> query.clj. Shouldn't the error appear when query.clj is compiled? 
>
>
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.