The Artima Developer Community
Sponsored Link

Jini Forum
Writing entries into a JavaSpace and transactions

1 reply on 1 page. Most recent reply: May 30, 2002 2:14 AM by Rohit

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Cristi

Posts: 9
Nickname: cristiand
Registered: Feb, 2002

Writing entries into a JavaSpace and transactions Posted: May 29, 2002 12:36 PM
Reply to this message Reply
Advertisement
Hi, everybody,

I've run into the following problem:

I have a machine running the JINI services and help tools (the web server serving requests from the lib dir in the JINI installation directory, rmid, reggie, mahalo) and a JavaSpace. They all start OK, but running the following peace of code that writes a simple Entry into the JavaSpace under a (non-null) transaction results in a request to the web server for
com/sun/jini/mahalo/TxnManagerImpl_Stub.class 
which the web server cannot satisfy, since the file is into a jar. If I add manually the file into the lib directory, the requester finds it, but asks for
/com/sun/jini/mahalo/TxnManager.class
.
The important parts of the code I am trying to run are:
    TransactionManager mgr = null;
    entries = new Entry[]{ new Name("TransactionManager") };
    mgr = (TransactionManager)registrar.lookup(new ServiceTemplate(null,null,entries));
    System.out.println("Manager: "+mgr);
    Entry exemplu1 = new ExempluEntry("Message1");
    ExempluEntry template = new ExempluEntry();
    Entry result = null;
 
    Transaction.Created trc = null;
    Transaction txn = null;
		
    try {
        trc = TransactionFactory.create(mgr, 300000);
	System.out.println("Transaction created " + trc);
	txn = trc.transaction;
	System.out.println("Transaction " + txn);
    } catch (Exception e) {
    System.err.println("Could not create transaction " + e);
    }	
 
    try{
 	System.out.println("Writing the first Entry");
	space.write(exemplu1, txn, Lease.FOREVER);
	System.out.println("Writing the second Entry")
        ...
    }
    catch (Exception ex) {
        System.out.println("Exception: "+ex);
    }

The output is:

Manager: com.sun.jini.mahalo.TxnManagerImpl_Stub[RemoteStub [ref: sun.rmi.server.UnicastRef2@2c7568]]
Transaction created net.jini.core.transaction.Transaction$Created@849bc
Transaction net.jini.core.transaction.server.ServerTransaction@2751fc8c
Writing the first Entry.
Exception: java.rmi.ServerException: RemoteException occured in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.sun.jini.mahalo.TxnManagerImpl_Stub


Everything is OK if I use null as the transaction parameter for the write method. Plus, it seems that the client sees the TxnManagerImpl_Stub.class after retreiving it from the ServiceRegistrar.

When I start the JINI services and tools I think they have all the necessary classes and packages they need...

Any help is appreciated.

Thank you!
Cristian.


Rohit

Posts: 38
Nickname: rohit
Registered: May, 2002

Re: Writing entries into a JavaSpace and transactions Posted: May 30, 2002 2:14 AM
Reply to this message Reply
Make sure you have mahalo.jar in code base when u have started services for Javaspace

Flat View: This topic has 1 reply on 1 page
Topic: please help Running javaspaces Previous Topic   Next Topic Topic: Running Jini on 2 Machines

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use