Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

"argument type mismatch" at polling-cntr startup -- only partitioned

I've verified that I can deploy a simple polling service when running unpartitioned. I set a routingkey, annotated it with @SpaceRouting, and redeployed. The deployment seems to succeed, then it starts up the polling container which dies (the PU keeps running, and GSM thinks it's fine). If there's something wrong with my POJO I wonder why it works in unpartitioned deployment?

Here's the exception, I'll post the POJO data-type and the service code/config after:

SEVERE [org.openspaces.events.polling.SimplePollingEventListenerContainer]: [metricsGatherer] Execution of event listener failed java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.openspaces.events.adapter.AbstractReflectionEventListenerAdapter.onEventWithResult(AbstractReflectionEventListenerAdapter.java:148) at org.openspaces.events.adapter.AbstractResultEventListenerAdapter.onEvent(AbstractResultEventListenerAdapter.java:79) at org.openspaces.events.AbstractEventListenerContainer.invokeListener(AbstractEventListenerContainer.java:136) at org.openspaces.events.polling.AbstractPollingEventListenerContainer.doReceiveAndExecute(AbstractPollingEventListenerContainer.java:369) at org.openspaces.events.polling.AbstractPollingEventListenerContainer.receiveAndExecute(AbstractPollingEventListenerContainer.java:330) at org.openspaces.events.polling.SimplePollingEventListenerContainer$AsyncEventListenerInvoker.invokeListener(SimplePollingEventListenerContainer.java:676) at org.openspaces.events.polling.SimplePollingEventListenerContainer$AsyncEventListenerInvoker.run(SimplePollingEventListenerContainer.java:617) at java.lang.Thread.run(Thread.java:619)

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2508]{quote}

asked 2008-08-01 22:10:09 -0500

kov gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Here's the type being partitioned, a note about the 'long' fields: I tried to annotate them with a SpaceProperty to set nullvalue to 0, but when I did that my PU wouldn't deploy at all complaining that the type was 'unusable'.

import java.io.Serializable; import com.gigaspaces.annotation.pojo.SpaceClass; import com.gigaspaces.annotation.pojo.SpaceId; import com.gigaspaces.annotation.pojo.SpaceRouting;

@SpaceClass(persist=true,fifo=true) public class GsRpcRequestMessage implements Serializable , IRpcRequestMessage {

private static final long serialVersionUID = 1L;
private Long probets;
private Long puts;
private Long svcts;
private Integer dest;
private Integer routingKey;
private String id;
private String xf;
private String method;
private Object arg;

public GsRpcRequestMessage() {
    probets = null;
    puts = null;
    svcts = null;
    dest = null;
    id = null;
    xf = null;
    method = null;
    arg = null;
    routingKey = null;
}

public void setDest(int dest) {
    this.dest = new Integer(dest);
}

public int getDest() {
    return dest == null ? 0 : dest.intValue();
}

public void setProbeTimestamp(long probets) {
    this.probets = new Long(probets);
}

public long getProbeTimestamp() {
    return probets == null ? 0 : probets.longValue();
}

public void setFirstPUTimestamp(long puts) {
    this.puts = new Long(puts);
}

public long getFirstPUTimestamp() {
    return puts == null ? 0 : puts.longValue();
}

public void setFirstServiceTimestamp(long svcts) {
    this.svcts = new Long(svcts);
}

public long getFirstServiceTimestamp() {
    return svcts == null ? 0 : svcts.longValue();
}

public boolean getRequest() {
    return true;
}

public void setId(String id) {
    this.id = id;
}

@SpaceId
public String getId() {
    return id;
}

public void setXf(String xf) {
    this.xf = xf;
}

public String getXf() {
    return xf;
}

public void setMethod(String method) {
    this.method = method;
}

public String getMethod() {
    return method;
}

public void setArg(Object arg) {
    this.arg = arg;
}

public Object getArg() {
    return arg;
}

@SpaceRouting
public Integer getRoutingKey() {
    return routingKey;
}

public void setRoutingKey(Integer routingKey) {
    this.routingKey = routingKey;
}

}

answered 2008-08-01 22:16:12 -0500

kov gravatar image
edit flag offensive delete link more

Comments

And here's the listener code, couldn't be much simpler:

import java.util.concurrent.atomic.AtomicInteger; import org.openspaces.events.EventDriven; import org.openspaces.events.adapter.SpaceDataEvent; import org.openspaces.events.polling.Polling; @EventDriven @Polling public class MetricsGatherer { AtomicInteger count = new AtomicInteger(0); @SpaceDataEvent public void processEvent(GsRpcRequestMessage msg) { System.err.println("count: "+count.incrementAndGet()); } }

and it's config: <os-events:annotation-support/> <os-core:space id="space" url="/./pu1s1"/> <os-core:giga-space id="gigaSpace" space="space"/>

<bean id="metricsGatherer" class="com.kov.gs.MetricsGatherer"/>
<os-events:polling-container id="eventContainer" giga-space="gigaSpace">
    <os-core:template>
        <bean class="com.kov.gs.GsRpcRequestMessage"/>
    </os-core:template>

    <os-events:listener>
        <os-events:annotation-adapter>
            <os-events:delegate ref="metricsGatherer"/>
        </os-events:annotation-adapter>
    </os-events:listener>
</os-events:polling-container>
kov gravatar imagekov ( 2008-08-01 22:19:40 -0500 )edit

ACK! NEVERMIND! It was the separate classloader thing. I was using a class remotely that wasn't in the shared-lib folder.

kov gravatar imagekov ( 2008-08-01 22:39:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-08-01 22:10:09 -0500

Seen: 39 times

Last updated: Aug 01 '08