File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache hivemind problem : There is no service point for interface.

 
Shifali Rana
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a simple add service using apache hivemind.

Whenever I am trying to call the add service it is giving the following exception

org.apache.hivemind.ApplicationRuntimeException: There is no service point for interface com.example.Adder.

Below are the classes that are used to create the add service
---------------------------------------------------

package com.example;

public interface Adder
{
public int add(int arg1, int arg2);
}

---------------------------------------------------

package com.example.impl;

import com.example.Adder;

public class AdderImpl implements Adder
{
public int add(int arg1, int arg2)
{
return arg1 + arg2;
}
}

---------------------------------------------------
package com.example;

import java.util.Locale;
import org.apache.hivemind.ClassResolver;
import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.DefaultClassResolver;
import org.apache.hivemind.impl.RegistryBuilder;


public class Main {
public static void main(String[] args) {
try
{

Registry registry = RegistryBuilder.constructDefaultRegistry();
Adder service = (Adder) registry.getService(Adder.class);
int sum = service.add(4, 7);
System.out.println("Result: " + sum);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}

---------------------------------------------------

Below is the hivemodule.xml in the META-INF

<?xml version="1.0" encoding="UTF-8"?>
<module id="com.example.Adder" version="1.0.0">

<service-point id="Adder" interface="Adder">
<create-instance class="com.example.impl.AdderImpl"/>
</service-point>

</module>

---------------------------------------------------

Please give some hint where it is going wrong.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic