gpt4 book ai didi

java - 使用 JavaSpaces 的 Blitz 实现

转载 作者:行者123 更新时间:2023-11-30 05:17:34 27 4
gpt4 key购买 nike

我对这个论坛抱有很大的怀疑,但我愿意感到惊喜;)向那些让我重回正轨的人表示敬意和巨大的业力。

我正在尝试使用 JavaSpaces ( http://www.dancres.org/blitz/blitz_js.html ) 的 blitz 实现来实现 http://today.java.net/pub/a/today/2005/04/21/farm.html 中提供的 ComputeFarm 示例。

内存中的示例工作正常,但每当我尝试使用 blitz 开箱即用的实现时,我都会收到以下错误:

(是的com.sun.jini.mahalo.TxnMgrProxy位于类路径中)

2008-09-24 09:57:37.316 ERROR [Thread-4] JavaSpaceComputeSpace 155     - Exception while taking task.
java.rmi.ServerException: RemoteException in server thread; nested exception is:
java.rmi.UnmarshalException: unmarshalling method/arguments; nested exception is:
java.lang.ClassNotFoundException: com.sun.jini.mahalo.TxnMgrProxy
at net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:644)
at com.sun.jini.jeri.internal.runtime.ObjectTable$6.run(ObjectTable.java:597)
at net.jini.export.ServerContext.doWithServerContext(ServerContext.java:103)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch0(ObjectTable.java:595)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.access$700(ObjectTable.java:212)
at com.sun.jini.jeri.internal.runtime.ObjectTable$5.run(ObjectTable.java:568)
at com.sun.jini.start.AggregatePolicyProvider$6.run(AggregatePolicyProvider.java:527)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:565)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:540)
at com.sun.jini.jeri.internal.runtime.ObjectTable$RD.dispatch(ObjectTable.java:778)
at net.jini.jeri.connection.ServerConnectionManager$Dispatcher.dispatch(ServerConnectionManager.java:148)
at com.sun.jini.jeri.internal.mux.MuxServer$2.run(MuxServer.java:244)
at com.sun.jini.start.AggregatePolicyProvider$5.run(AggregatePolicyProvider.java:513)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.jini.jeri.internal.mux.MuxServer$1.run(MuxServer.java:241)
at com.sun.jini.thread.ThreadPool$Worker.run(ThreadPool.java:136)
at java.lang.Thread.run(Thread.java:595)
at com.sun.jini.jeri.internal.runtime.Util.__________EXCEPTION_RECEIVED_FROM_SERVER__________(Util.java:108)
at com.sun.jini.jeri.internal.runtime.Util.exceptionReceivedFromServer(Util.java:101)
at net.jini.jeri.BasicInvocationHandler.unmarshalThrow(BasicInvocationHandler.java:1303)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:832)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659)
at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at $Proxy0.take(Unknown Source)
at org.dancres.blitz.remote.BlitzProxy.take(BlitzProxy.java:157)
at compute.impl.javaspaces.JavaSpaceComputeSpace.take(JavaSpaceComputeSpace.java:138)
at example.squares.SquaresJob.collectResults(SquaresJob.java:47)
at compute.impl.AbstractJobRunner$CollectThread.run(AbstractJobRunner.java:28)
Caused by: java.rmi.UnmarshalException: unmarshalling method/arguments; nested exception is:
java.lang.ClassNotFoundException: com.sun.jini.mahalo.TxnMgrProxy
at net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:619)
at com.sun.jini.jeri.internal.runtime.ObjectTable$6.run(ObjectTable.java:597)
at net.jini.export.ServerContext.doWithServerContext(ServerContext.java:103)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch0(ObjectTable.java:595)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.access$700(ObjectTable.java:212)
at com.sun.jini.jeri.internal.runtime.ObjectTable$5.run(ObjectTable.java:568)
at com.sun.jini.start.AggregatePolicyProvider$6.run(AggregatePolicyProvider.java:527)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:565)
at com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:540)
at com.sun.jini.jeri.internal.runtime.ObjectTable$RD.dispatch(ObjectTable.java:778)
at net.jini.jeri.connection.ServerConnectionManager$Dispatcher.dispatch(ServerConnectionManager.java:148)
at com.sun.jini.jeri.internal.mux.MuxServer$2.run(MuxServer.java:244)
at com.sun.jini.start.AggregatePolicyProvider$5.run(AggregatePolicyProvider.java:513)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.jini.jeri.internal.mux.MuxServer$1.run(MuxServer.java:241)
at com.sun.jini.thread.ThreadPool$Worker.run(ThreadPool.java:136)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: com.sun.jini.mahalo.TxnMgrProxy
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at net.jini.loader.pref.PreferredClassLoader.loadClass(PreferredClassLoader.java:922)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at net.jini.loader.pref.PreferredClassProvider.loadClass(PreferredClassProvider.java:613)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138)
at net.jini.io.MarshalInputStream.resolveClass(MarshalInputStream.java:296)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at com.sun.jini.jeri.internal.runtime.Util.unmarshalValue(Util.java:221)
at net.jini.jeri.BasicInvocationDispatcher.unmarshalArguments(BasicInvocationDispatcher.java:1049)
at net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:599)
... 17 more

最佳答案

因此 com.sun.jini.mahalo.TxnMgrProxy 包含在某个 jar 中,该 jar 包含在 CLASSPATH 环境变量中。

但是您可能正在使用一些脚本来启动服务器。这很可能通过指定一个“-classpath”命令行开关来启动 java,该开关优先于您的环境 CLASSPATH 变量。

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html

您可以通过执行来模拟这一点:

javap -classpath someUnknownJar.jar com.sun.jini.mahalo.TxnMgrProxy

...突然就找不到这个类了。那么能否请您尝试找出客户端和服务器端的java VM的启动方式并提供完整的命令行。(如果您使用某种脚本,只需在 java 命令前面添加“echo ...”并将输出粘贴到此处)。

关于java - 使用 JavaSpaces 的 Blitz 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/127867/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com