Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Servlet / Jini Lookup pbm

Thread Tools

Servlet / Jini Lookup pbm

Posts: n/a

I'm trying to contact a Jini lookup service (reggie) from a simple
servlet. I'm using Tomcat 5.5.7, Java 1.5.0_01, Jini 1.2.1 and

The problem is that, after the call to LookupDiscoveryManager() (see
source code below), the "discovered()" method is never called back.

Here is what I get in my browser after an exec :
before LookupDiscoveryManager

I have successfully run a similar code in a standalone Java app (i.e.
without Tomcat / servlet), and everything is OK.

In fact, I have no error message nor Exception thrown. I simply
don't have any response from reggie.

Any help would be appreciate,

PS: I'm new to Tomcat and Jini.

== core servlet

protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

PrintWriter out = response.getWriter();

new searchALookup(out).start();
try {
} catch (InterruptedException ie) {
out.println("InterruptedException: " + ie.getMessage());


import net.jini.core.discovery.LookupLocator;
import net.jini.core.lookup.*;
import net.jini.discovery.*;

public class searchALookup extends Thread implements DiscoveryListener

private LookupDiscoveryManager discover;
private PrintWriter sortie;

public chercheLookup(PrintWriter out) {
sortie = out;

public void run() {
try {
} catch (IOException ioe) {
sortie.println("Error while connecting to service");

public synchronized void discovered(DiscoveryEvent dev) {
sortie.println("--> Discovered");
ServiceRegistrar[] lookup = dev.getRegistrars();
// We may have discovered one or more lookup services
sortie.println(lookup.length +" lookups decouverts");

public synchronized void discarded(DiscoveryEvent dev) {

private void startServiceDiscovery()
throws IOException {

String[] groups = null;
LookupLocator[] locators = null;

LookupLocator locator =
new LookupLocator("jini://REGGIE_HOSTNAME");
locators = new LookupLocator[]{locator};
}catch( e){
groups = new String[]{"public"};
sortie.println("Groups ="+groups[0]);

// Initialize for receiving events from the lookup service
sortie.println("before LookupDiscoveryManager");
discover = new LookupDiscoveryManager(groups, locators, this);

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JINI & reggie lookup service configuration. Mr. X. Java 0 07-05-2007 09:22 PM
A strange problem when I start JINI lookup service Zheng Da Java 0 02-26-2006 05:07 AM
Q: reading PBM laniik C++ 3 04-28-2005 08:53 AM
pbm opening a web application project ASP .Net 1 01-05-2005 05:57 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM