• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calling Java from clojure

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I am calling my defined java class from clojure file which will return a integer value
But , I am getting the proper integer value

Ex: I am returning '12345' from java,
when i call the file from clojure , I am getting "namespace_of_java_file@141cd01"

Please help me
 
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to provide a lot more detail than that!

At least show us your code.
 
Gayathri kopparapu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the sample code
clojure file ::
(defn send-to-geolocation-touchpoint [id services {:keys [code]}]
(log :info (str "inside the send-to-location-touchpoint"))
(let [body (doto (MainSample.)
(.myResult code))]
body)

java file::
public class MainSample {
public Map myResult(final String Cdoe,final String Id){

Logger LOG = Logger.getLogger(MainSample.class);
Map result=null;
try{
result.put("area_code",Cdoe);
result.put("id",Id);
return result;}
catch (Exception e){
System.out.println(e);
}
return result;
}
}
 
Sean Corfield
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your function returns the MainSample object - body - so if you print that you'll get what you are seeing. So there's no error here.

What are you trying to do?
 
Gayathri kopparapu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to print the 'result'...how can i print it
 
Sean Corfield
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
returns the Object.
returns the result of calling method on the Object.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic