I am using Storm 2.1.0 and would like to use the Resource Aware Scheduler. I followed instructions from the documentation and added the following line to my conf/storm.yaml:
storm.scheduler: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
But when I execute ./bin/storm nimbus it crashes and I can see the following log in logs/nimbus.log:
2020-06-25 16:02:09.962 o.a.s.d.n.Nimbus main [INFO] Using custom scheduler: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
2020-06-25 16:02:09.963 o.a.s.u.Utils main [ERROR] Received error in thread main.. terminating server...
java.lang.Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
at org.apache.storm.utils.Utils.handleUncaughtException(Utils.java:653) ~[storm-client-2.1.0.jar:2.1.0]
at org.apache.storm.utils.Utils.handleUncaughtException(Utils.java:632) ~[storm-client-2.1.0.jar:2.1.0]
at org.apache.storm.utils.Utils.lambda$createDefaultUncaughtExceptionHandler$2(Utils.java:1014) ~[storm-client-2.1.0.jar:2.1.0]
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057) [?:1.8.0_252]
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052) [?:1.8.0_252]
at java.lang.Thread.dispatchUncaughtException(Thread.java:1959) [?:1.8.0_252]
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
at org.apache.storm.utils.ReflectionUtils.newInstance(ReflectionUtils.java:48) ~[storm-client-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.makeScheduler(Nimbus.java:658) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.<init>(Nimbus.java:569) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.<init>(Nimbus.java:474) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.<init>(Nimbus.java:468) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.launchServer(Nimbus.java:1307) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.launch(Nimbus.java:1332) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.main(Nimbus.java:1337) ~[storm-server-2.1.0.jar:2.1.0]
Caused by: java.lang.ClassNotFoundException: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_252]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_252]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[?:1.8.0_252]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_252]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_252]
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_252]
at org.apache.storm.utils.ReflectionUtils.newInstance(ReflectionUtils.java:46) ~[storm-client-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.makeScheduler(Nimbus.java:658) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.<init>(Nimbus.java:569) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.<init>(Nimbus.java:474) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.<init>(Nimbus.java:468) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.launchServer(Nimbus.java:1307) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.launch(Nimbus.java:1332) ~[storm-server-2.1.0.jar:2.1.0]
at org.apache.storm.daemon.nimbus.Nimbus.main(Nimbus.java:1337) ~[storm-server-2.1.0.jar:2.1.0]
I understand that the class is not found but wasn't expecting this. I just downloaded the latest version of Storm from their official website (binary version), I checked on the source code if the class exists (it does), Zookeeper is up and running, and I followed the given instruction to enable this scheduler. I probably forgot something but I totally don't know what.
But anyway, let's continue this investigation. In Nimbus.java it initializes the scheduler:
private static IScheduler makeScheduler(Map<String, Object> conf, INimbus inimbus) {
String schedClass = (String) conf.get(DaemonConfig.STORM_SCHEDULER);
IScheduler scheduler = inimbus == null ? null : inimbus.getForcedScheduler();
if (scheduler != null) {
LOG.info("Using forced scheduler from INimbus {} {}", scheduler.getClass(), scheduler);
} else if (schedClass != null) {
LOG.info("Using custom scheduler: {}", schedClass);
scheduler = ReflectionUtils.newInstance(schedClass);
} else {
LOG.info("Using default scheduler");
scheduler = new DefaultScheduler();
}
return scheduler;
}
The following log tells me that it's trying to get the correct scheduler:
... Nimbus main [INFO] Using custom scheduler: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
An then, it calls ReflectionUtils.newInstance() which is implemented in ReflectionUtils.java:
public static <T> T newInstance(String klass) {
try {
return newInstance((Class<T>) Class.forName(klass));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Exception seems to be raised from here because it is not able to find the class ResourceAwareScheduler. I double checked and the class exist at the given location. At this stage I got to admit that it reaches my knowledge of Java. Am I suppose to manually import this class in ReflectionUtils.java? It has the full path to the class, so I suppose it is not necessary. How should I configure this Maven project to include this class?
Any help with this will be gladly appreciated.
I finally found the problem. There is a difference between:
storm.scheduler: “org.apache.storm.scheduler.resource.ResourceAwareScheduler”
and
storm.scheduler: "org.apache.storm.scheduler.resource.ResourceAwareScheduler"
Even the highlighting for code from StackOverflow should have helped me. I feel stupid. It's a gentle reminder that copy-pasting, even from official documentation, is bad! Hope this will help other bros.
Related
So we haft to use a RMI Server and Client for some exercice in class. Our professor don't want us to use `LocateRegirstry.createRegistry()`, instead we shall start the rmiregistry from within either intellij external tools, or the cmd. I tried several things, nothing seems to work. I opened cmd both as Admin and normal User, started rmiregistry from within the "out" dictionary of the project (professor said it has to be started in the same dictionary where the byte code lies). Made a link to the original rmiregistry and placed it into the "out" dictionary,startet it from intellij terminal, external tools etc. but i cant get it to work.
at the moment i get this Error:
DateServerImpl: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: RMI.DateServer
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: RMI.DateServer
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:391)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:380)
at java.rmi/sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:158)
at java.rmi/java.rmi.Naming.rebind(Naming.java:177)
at RMI.DateServerImpl.main(DateServerImpl.java:20)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: RMI.DateServer
at java.rmi/sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:157)
at java.rmi/sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:468)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:298)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.ClassNotFoundException: RMI.DateServer
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.rmi/sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1207)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:468)
at java.rmi/sun.rmi.server.LoaderHandler.loadClassForName(LoaderHandler.java:1221)
at java.rmi/sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:731)
at java.rmi/sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:674)
at java.rmi/sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:611)
at java.rmi/java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
at java.rmi/java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
at java.rmi/sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:254)
at java.base/java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1950)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1892)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2202)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1712)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:519)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:477)
at java.rmi/sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:154)
... 14 more
I couldn't find the solution on google ( which leads me here anyway most of the time, to similar problems, but couldn't figure anything out with those posts)
here is the code i use:
Server Code
package RMI;
import java.rmi.*;
import java.rmi.server.*;
import java.util.Date;
public class DateServerImpl extends UnicastRemoteObject implements DateServer {
public DateServerImpl () throws RemoteException {
}
public Date getDate () throws RemoteException {
System.out.println("Invocation of getDate()");
return new Date ();
}
public static void main (String[] args) {
try {
DateServerImpl dateServer = new DateServerImpl ();
Naming.rebind ("DateServer", dateServer);
System.out.println("The server is up");
} catch (Exception e) {
System.out.println("DateServerImpl: " + e.getMessage());
e.printStackTrace();
}
}
}
Interface Code
package RMI;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Date;
public interface DateServer extends Remote {
public Date getDate () throws RemoteException;
}
So I hope anybody can help me here. What am I doing wrong?
I hope this is enough information, first time posting here =D
Thank you!
It's funny that this problem has been around for 20+ years. After opening CMD, you need to set the environment variable CLASSPATH and include every JAR/directory needed to properly find your server classes, and then start rmiregistry.
So I just found a workaround. I used the javac command to compile it over cmd, started the rmiregistry and than the server... and it worked. So I assume it is a Problem of intellij, because .class and .java are in different dictionary and therefore the exception "class not found" makes sense. Now i just need to find a way to reorganize intellij... Thanks for the help so far =D
Edit: Intellij on Windows needs the "out" dictionary to be mirrored(On Linux it seems no problem at all, as long as you started rmiregistry in the same dictionary as your byte code aka .class files are). So Go to
File->Project Structure->Modules->Paths
choose Use module compile output path, and just use out as output
after that, got to intellij terminal, change to the out dictionary, start rmiregistry and than start the server.
That's it, works for me =D.
I am trying to attach an agent for a process using bytebuddy .I found that we can use ByteBuddyAgent.attach(file,"18467"); for this. But when i am trying to do this following errors occurring.
This is agent i used
File file = (new File("Agent.jar"));
Error
java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound#e26db604
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:378)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:227)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:202)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:189)
at common.netty.echo.EchoHttpServer.main(EchoHttpServer.java:95)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.bytebuddy.agent.Attacher.install(Attacher.java:77)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:373)
... 4 more
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 10 more
Any idea for this ? and When i try to use this attachment from another agent as follows
public class Agent {
public static void premain(String args, Instrumentation instrumentation) {
System.out.println("Premain");
File file ;
try {
file = (new File("Agent.jar"));
ByteBuddyAgent.attach(file,"18467");
}
catch (Exception e)
{
e.printStackTrace();
}
}
I am getting this error
Error
java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound#423f0955
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:378)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:227)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:202)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:189)
at common.netty.echo.Agent.premain(Agent.java:111)
at common.netty.echo.EchoHttpServer.<clinit>(EchoHttpServer.java:56)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.bytebuddy.agent.Attacher.install(Attacher.java:77)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:373)
... 5 more
Caused by: java.lang.UnsatisfiedLinkError: Native Library /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libattach.so already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1907)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sun.tools.attach.LinuxVirtualMachine.<clinit>(LinuxVirtualMachine.java:342)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 11 more
Any suggestion on this!!
As for the first error message: does the target VM run the attachment listener? You can try to force starting the thread by setting -XX:+StartAttachListener which should be set by default. What JVM version are you running?
The other error message indicates that the attachment library was already loaded by another class loader. See this answer for further details: java.lang.UnsatisfiedLinkError: Native Library XXX.so already loaded in another classloader
I am creating a custom Predicate. It takes an integer and compares it with the value of map.
public class LocationPredicate implements Predicate<Key, Portable> {
private int rssi;
public LocationPredicate() {
}
public LocationPredicate(int rssi) {
this.rssi = rssi;
}
#Override
public boolean apply(Entry<Key, Aortable> arg0) {
return false;
//int val = arg0.getValue().getData().getLocation().getRssiVal();
//return (rssi == val ) ;
}
}
When I run the program, I am getting the following error:
Exception in thread "main" com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: com.snmpapp.main.LocationPredicate
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:224)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:184)
at com.hazelcast.client.impl.protocol.task.map.MapAggregateWithPredicateMessageTask.getPredicate(MapAggregateWithPredicateMessageTask.java:45)
at com.hazelcast.client.impl.protocol.task.map.AbstractMapQueryMessageTask.call(AbstractMapQueryMessageTask.java:87)
at com.hazelcast.client.impl.protocol.task.AbstractCallableMessageTask.processMessage(AbstractCallableMessageTask.java:35)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.initializeAndProcessMessage(AbstractMessageTask.java:123)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.run(AbstractMessageTask.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)
at ------ submitted from ------.(Unknown Source)
at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveAndThrowIfException(ClientInvocationFuture.java:95)
at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveAndThrowIfException(ClientInvocationFuture.java:32)
at com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:155)
at com.hazelcast.client.spi.ClientProxy.invoke(ClientProxy.java:172)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:1356)
at com.snmpapp.main.Main.main(Main.java:370)
Caused by: java.lang.ClassNotFoundException: com.aruba.acp.snmpapp.main.LocationPredicate
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:149)
at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:123)
at com.hazelcast.nio.IOUtil$ClassLoaderAwareObjectInputStream.resolveClass(IOUtil.java:522)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:219)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:184)
at com.hazelcast.client.impl.protocol.task.map.MapAggregateWithPredicateMessageTask.getPredicate(MapAggregateWithPredicateMessageTask.java:45)
at com.hazelcast.client.impl.protocol.task.map.AbstractMapQueryMessageTask.call(AbstractMapQueryMessageTask.java:87)
at com.hazelcast.client.impl.protocol.task.AbstractCallableMessageTask.processMessage(AbstractCallableMessageTask.java:35)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.initializeAndProcessMessage(AbstractMessageTask.java:123)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.run(AbstractMessageTask.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)
I am little bit confused. Do I need to create the Predicate on the server? I am running as Hcast client and the client is creating the predicate.
As far as I know, when you create the predicate, it is sent as a serialized object to the hazelcast server.
Also, I tried to implement Predicate as Serializable, but it didnt help.
Thanks
I am not experienced with Hazelcast but as far as I know during serialisation and deserialisation you can transfer state (in this case the member variable) but not the behaviour (your actual implementation of apply method). Somehow (I am not experienced with this technology) you should provide your class to the Hazelcast's class loader (maybe copying to the classpath). Good luck!
The class needs to be on the classpath of all nodes.
I'm adding a library project(.aar) file into DemoProject where library project internally uses reflection.
But DemoProject shows classNotFoundfor the reflection classes.
Stacktrace.
Suppressed: java.lang.ClassNotFoundException: com.coderconsole.phoneUtils
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Code:
try {
return Class.forName("com.coderconsole.phoneUtils");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
The exception is thrown when using within libraryproject else its working fine.
Any help is highly appreciated.
I'm getting the following error when I run a webservice client I've created using: eclipse, j2sdk1.4.2_13, axis1.0 and a WSDL file.
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
at java.lang.Class.getDeclaredMethod(Class.java:1262)
at org.apache.commons.discovery.tools.ClassUtils.findPublicStaticMethod(ClassUtils.java:116)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:214)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.access$300(EngineConfigurationFactoryFinder.java:92)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:148)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:204)
at org.apache.axis.client.Service.<init>(Service.java:111)
at com.example.xmlns.SOAPEventSourceBindingStub.<init>(SOAPEventSourceBindingStub.java:27)
at com.example.xmlns.SOAPEventSourceBindingStub.<init>(SOAPEventSourceBindingStub.java:17)
at com.example.xmlns.Cliente.main(Cliente.java:16)
Exception in thread "main"
The client is doing this:
SOAPEventSourceBindingStub stub = new SOAPEventSourceBindingStub();
public SOAPEventSourceBindingStub() throws org.apache.axis.AxisFault {
this(null); (this is line 17)
}
public SOAPEventSourceBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public SOAPEventSourceBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
if (service == null) {
super.service = new org.apache.axis.client.Service(); (this is line 27)
} else {
super.service = service;
}
...
You need the servlet Jar in your classpath or use a more recent version of axis.
NOTE: AXIS 1.0 version even on client side needs servlet JAR file or you get this exception:
(upcoming 1.1 version should have this fixed)
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/ServletContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1613)
at java.lang.Class.getMethod0(Class.java:1732)
at java.lang.Class.getDeclaredMethod(Class.java:1219)
...
Resources :
cvs commit : xml-axis-wsif/java/lib/xerces2, xercesImpl_2_2_1.jar, xmlParserAPIs_2_2_1.jar
Had similar problem with desktop application. In Netbeans this appeared suddenly, though I was changing only unrelated sql queries. Problematic packages were still in my main package, though couldn't be found.
Solved renaming problematic classes in my main package (and renaming back, if needed). Also corrected naming standard deviations (some class names first letters were low-case).