Re: jini 2.1 examples
Bulzan Stefan <[email protected]> Tue, 10 Jun 2008 14:04:36 -0600
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hello,
Yes, it is a take operation, not a write one. My fault :P.
I'll give you some more details.
I'm running my client from an IDE, I've imported jini-core.jar, jini-ext.=
jar,=20
jini-lib.jar, mahalo.jar, outrigger.jar, reggie.jar in the project.
I'm starting the class server like this:
private static codebaseBase =3D "http://" + ConfigUtil.getHostName() =
+
=09":" + httpdPort + "/";
private static dlCodebase =3D codebaseBase + "jsk-dl.jar";
private static policy =3D "${java.security.policy}";
private static classpathBase =3D ConfigUtil.concat(new Object[] {
"${jsk.lib}","${/}"});
static serviceDescriptors =3D new ServiceDescriptor[] {
// httpd
new NonActivatableServiceDescriptor(
"",
policy,
ConfigUtil.concat(new Object[] {classpathBase, "tools.jar"}),=
"com.sun.jini.tool.ClassServer",
new String[]{"-port", httpdPort, "-dir", "${jsk.lib}" + "-dl"=
,
"-verbose"}
=09=09),
=09=09
The code that generates this exception is
ClassLoader ld =3D Thread.currentThread().getContextClassLoader()=
;
try {
Thread.currentThread().setContextClassLoader(
getClass().getClassLoader());
Entry taskTmpl =3D null;
try {
taskTmpl =3D space.snapshot(new TaskEntry());
} catch (RemoteException e) {
throw new RuntimeException("Can't obtain a snapshot");
}
int taskNr =3D -1;
while (true) {
taskNr++;
Transaction txn =3D getTransaction();
if (txn =3D=3D null) {
throw new RuntimeException(
"Can't obtain a transaction");
}
System.out.print("getting task " + taskNr + " : ");
//txn =3D null;
try {
TaskEntry task =3D (TaskEntry)
space.take(taskTmpl, txn, Long.MAX_VALUE);
=09=09=09=09=09=09=09
=09=09=09=09=09=09
as you see, I've inserted the code that mr.Gregg Wonderly recommended, bu=
t
still the exception is thrown.
If you have any idea how I can fix this, please tell me asap.
Thank you very much for your help,
Regards,
Bulzan Stefan.=09=09=09=09=09=09
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html