NULL POINTER EXCEPTION!

I was trying to create a handler for the web service above.

It should be the equivalent of (Java):

public class Calculator {
                public int add(int i1, int i2) {
                        return i1 + i2;
                }
                public int subtract(int i1, int i2) {
                        return i1 - i2;
                }
}

So I basically wrote the following:

(def Calculator
  (proxy [] []
    (add [x y] (+ x y))
    (subtract [x y] (- x y))))

But I get the following error:

java.lang.NullPointerException

Anybody have a clue?




On Dec 4, 9:09 pm, Rock <rocco.ro...@gmail.com> wrote:
> Looks pretty good. Thank you so much.
>
> This does however worry me a little from another point of view.
> There's always been a lot of talk about how easy it is to interface
> Clojure to Java. Yet, when it comes to a lot of situations (for
> instance, when dealing with annotations as in the JAX-WS SOAP web
> service facility), it doesn't seem at all straightforward. By the way,
> anybody know what the story is with Java annotations currently? I read
> somewhere that Clojure 1.2 (or possibly 1.3) can support them to a
> certain extent.
>
> On Dec 4, 8:11 pm, Shantanu Kumar <kumar.shant...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I guess you should look at XML-RPC2, which has a simpler 
> > usage:http://ws.apache.org/xmlrpc/xmlrpc2/server.html
>
> > Regards,
> > Shantanu
>
> > On Dec 4, 10:26 pm, Rock <rocco.ro...@gmail.com> wrote:
>
> > > I'm desperately trying to implement an xml-rpc server with Clojure
> > > (trying to convince the company I work for here in Italy to give it a
> > > shot). I'm pretty well versed in Lisp, but I have yet to acquire
> > > sufficient experience with Clojure's Java interop capabilities.
>
> > > I've read the docs for implementing a server with ws-xmlrpc here:
>
> > >http://ws.apache.org/xmlrpc/server.html
>
> > > But I really can't figure out how to translate this to Clojure.
>
> > > Thanks to all for any help in this respect.

-- 
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

Reply via email to