Order cannot be cast to com.tangosol.util.MapEvent

This code is causing an exception. How should I be writing this filter? I want to listen for events when the status changes for one specific Order object. That Order has an integer key property which is the same integer key value used to store it in the cache. The code causing the exception is:
    public void addStatusChangeListener() {
            Filter f1 = new ValueChangeEventFilter("OrderStatus");
            Filter f2 = new EqualsFilter("Key", this.getKey());
            Filter f3 = new AndFilter(f1,f2);
            Filter statusChangeFilter = new MapEventFilter(MapEventFilter.E_UPDATED, f3);
            System.out.println("ADD STATUS CHANGE LISTENER "+this.symbol+" "+this.getKey());
            this.getCache().addMapListener(this , statusChangeFilter, false);
2009-09-18 10:52:54.796/238.692 Oracle Coherence GE 3.5/459 <Error> (thread=DistributedCache, member=1):
Exception occured during filter evaluation: MapEventFilter(mask=UPDATED, filter=
AndFilter(ValueChangeEventFilter(extractor=.OrderStatus()), EqualsFilter(.Key(), 189000006))); removing the filter...
2009-09-18 10:52:54.796/238.692 Oracle Coherence GE 3.5/459 <Error> (thread=DistributedCache, member=1):
java.lang.ClassCastException: oms.Order cannot be cast to com.tangosol.util.MapEvent
        at com.tangosol.util.filter.ValueChangeEventFilter.evaluate(ValueChangeEventFilter.java:69)
        at com.tangosol.util.filter.AllFilter.evaluate(AllFilter.java:56)
        at com.tangosol.util.filter.MapEventFilter.evaluate(MapEventFilter.java:178)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.prepareDispatch(DistributedCache.CDB:82)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.postInvoke(DistributedCache.CDB:10)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.invoke(DistributedCache.CDB:117)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onInvokeRequest(DistributedCache.CDB:50)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$InvokeRequest.run(DistributedCache.CDB:1)
        at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheKeyRequest.onReceived(DistributedCacheKeyRequest.CDB:12)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:136)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
        at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
        at java.lang.Thread.run(Thread.java:619)Thanks,
Andrew

Ok, but isn't it just something wrong with how I wrote/used that filter?
-Andrew
public class Order implements Cloneable, Comparable, java.io.Serializable, MapListener {
    private String symbol = null;
    private OrderStatus orderStatus = OrderStatus.PENDING_NEW;
    private int id = 0; // java int max = 2,147,483,647
    private transient ArrayList<OrderStatusChangeListener> statusChangeListeners = new ArrayList<OrderStatusChangeListener>();
    public static NamedCache getCache() {
        if (cache == null) {
            System.out.println("Order...CacheFactory.getCache(\"orders\")");
            cache = CacheFactory.getCache("orders");
        return cache;
    public void send() {
        getCache().put(this.id, this);
    public static int sendMultiple(Iterable<Order> orders){
        int counter=0;
        HashMap m = new HashMap();
        for (Order o:orders){
            m.put(o.getKey(),o);
            counter++;
        getCache().putAll(m);
        return counter;
    public static class CancelProcessor extends AbstractProcessor {
        public Object process(InvocableMap.Entry entry) {
            Order o = (Order)entry.getValue();
            if (o.cancelCount == 0) {
                o.cancelCount = 1;
            } else {
                logger.info("ignoring dup. cancel req on " + o.symbol + " id=" + o.id);
            return o.cancelCount;
    public void cancel() {
        Filter f = new EqualsFilter("getCancelCount", 0);
        UpdaterProcessor up1 = new UpdaterProcessor("setCancelCount", new Integer(1));
        UpdaterProcessor up2 = new UpdaterProcessor("setCancelSubmittedTime", Base.getSafeTimeMillis() );
        CompositeProcessor cp = new CompositeProcessor(new InvocableMap.EntryProcessor[] {up1,up2});
        ConditionalProcessor x = new ConditionalProcessor(f, cp);
        getCache().invoke(key, x);
    private static NumberIncrementor ni1 = new NumberIncrementor("CancelCount", 1, false);
    public static void cancelMultiple(Collection<Integer> orderIds){
        getCache().invokeAll(orderIds, ni1);
    public static void cancelAllByAccount(String account){
        getCache().invokeAll( new EqualsFilter("getAccount", account), ni1);
    public void cancelAllowingMultipleCancelsOfThisOrder() {
        System.out.println("cancelAllowingMultipleCancelsOfThisOrder symbol=" + symbol + " key="+key+ " id=" + this.id);
        getCache().invoke(key, ni1);
        UpdaterProcessor up = new UpdaterProcessor("setCancelSubmittedTime", Base.getSafeTimeMillis() );
        getCache().invoke(key, up);
    public void entryInserted(MapEvent mapEvent) {
    public void entryUpdated(MapEvent mapEvent) {
        Order o = (Order)mapEvent.getNewValue();
        fireStatusChange(o);
    public void entryDeleted(MapEvent mapEvent) {
    public void removeStatusChangeListener(OrderStatusChangeListener listener) {
        synchronized (statusChangeListeners) {
            statusChangeListeners.remove(listener);
            if (statusChangeListeners.size()==0) {
                this.getCache().removeMapListener(this, statusChangeFilter);
    private transient Filter statusChangeFilter=null;
    public void addStatusChangeListener(OrderStatusChangeListener listener) {
        if (statusChangeFilter==null) {
            Filter f1 = new ValueChangeEventFilter("OrderStatus");
            Filter f2 = new EqualsFilter("Key", this.getKey());
            Filter f3 = new AndFilter(f1,f2);
            statusChangeFilter = new MapEventFilter(MapEventFilter.E_UPDATED, f3);
        System.out.println("ADD STATUS CHANGE LISTENER "+this.symbol+" "+this.getKey());
        synchronized (statusChangeListeners) {
            if (statusChangeListeners.size()==0) {
                this.getCache().addMapListener(this , statusChangeFilter, false);
            statusChangeListeners.add(listener);
    private void fireStatusChange(Order o ) {
        System.out.println("FIRE STATUS CHANGE: starting...");
        // do not depend on the firing of a status change to mean that the
        // status did certainly change.  Use the firing of status change as a
        // trigger to examine the order's status w/getStatus().
        System.out.println("1");
        synchronized (statusChangeListeners) {
            System.out.println("2");
            List<OrderStatusChangeListener> asdf = new LinkedList<OrderStatusChangeListener>(statusChangeListeners);
            System.out.println("3");
            for (OrderStatusChangeListener x : asdf) {
                System.out.println("4");
                try {
                    System.out.println("FIRE STATUS CHANGE: "+x);
                    x.dispatchOrderStatusChange(o);
                } catch (java.util.ConcurrentModificationException e) {
                    logger.error("** fireStatusChange: ConcurrentModificationException " + e.getMessage());
                    logger.error(e.getStackTrace());
                    e.printStackTrace();
        System.out.println("FIRE STATUS CHANGE: done...");
    public int compareTo(Object o) { //assumes ID allways int.
        return this.key - ((Order)o).key;
    public boolean equals(Object o) {
        return (this.key == ((Order)o).key);
    public void setStatus(OrderStatus orderStatus) {
        this.orderStatus = orderStatus;
    public OrderStatus getStatus() {
        return orderStatus;
    public Integer getKey(){
        return key;
    private Integer key;
    public Order() {
        id = generateId();
        key=new Integer(id);
    public Object clone() {
        try {
            Order order = (Order)super.clone();
            order.setId(order.generateId());
            return order;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        return null;
    public static int generateId() {
        idwLock.lock();
        try {
            if (nextId == flipOverId) {
                // redo this w/a number incrementor passing in null for the member variable
//                ValueManipulator vm=null;
//                NumberIncrementor ni = new NumberIncrementor(vm, 1, false);
                NamedCache omsCache = CacheFactory.getCache("oms");
                omsCache.lock("high_order_id");
                Integer i = (Integer)omsCache.get("high_order_id");
                if (i==null) i=188; // change to 1 once legacy is gone
                omsCache.put("high_order_id", ++i);
                omsCache.unlock("high_order_id");
                flipOverId = (i+1) * MAX_ORDERS_PER_TRADER_ID;
                nextId = (MAX_ORDERS_PER_TRADER_ID * i)+1;
                return nextId;
            } else {
                return ++nextId;
        } finally {
            idwLock.unlock();
    public boolean isCancelRequestedOrIsCanceled() {
        // change to cancelrequested lock, not ack lock
        if (orderStatus==OrderStatus.CANCELED)
            return true;
        //  ValueExtractor extractor = new ReflectionExtractor("getCancelCount");
        //  int cc = (Integer)cache.invoke( this.ID , extractor );
        Order o = (Order)getCache().get(this.id);
        int cc = o.getCancelCount();
        return cc > 0 || o.orderStatus == OrderStatus.CANCELED;
    public void setId(int Id) {
        this.id = Id;
    public int getId() {
        return id;
}

Similar Messages

  • Com.tangosol.util.AssertionException

    Getting this exception intermittently in my storage nodes (total of 4):
    23:54:16,092 ERROR [Logger@9260286 3.6.0.2] cluster (log:3) - 2012-05-01 23:54:16.087/2394.969 Oracle Coherence GE 3.6.0.2 <Error> (thread=DistributedCache:MessageDistributedCacheService,
                   member=7): Terminating PartitionedCache due to unhandled exception: com.tangosol.util.AssertionException
    23:54:16,126 ERROR [Logger@9260286 3.6.0.2] cluster (log:3) - 2012-05-01 23:54:16.087/2394.969 Oracle Coherence GE 3.6.0.2 <Error> (thread=DistributedCache:MessageDistributedCacheService,
                   member=7):
    com.tangosol.util.AssertionException:
         at com.tangosol.coherence.Component._assertFailed(Component.CDB:12)
         at com.tangosol.coherence.Component._assert(Component.CDB:3)
         at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheRequest$Poll.onCompletion(DistributedCacheRequest.CDB:15)
         at com.tangosol.coherence.component.net.Poll.close(Poll.CDB:13)
         at com.tangosol.coherence.component.net.Poll.onResponded(Poll.CDB:32)
         at com.tangosol.coherence.component.net.Poll.onResponse(Poll.CDB:3)
         at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheRequest$Poll.onResponse(DistributedCacheRequest.CDB:16)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    Version from the the manifest:
    Specification-Version: 3.6.0.2
    Implementation-Build: 18470
    This happens under the following scenario:
    I have 4 other nodes that are concurrently writing to the same cache using individual put() operations, about 200k objects in total
    Anybody have any ideas?
    Thanks

    Hi Carl,
    I guess the issue when the limit is exceeding.
    Probably you can try increasing the packet Size and run the test
    For more info:
    http://wiki.tangosol.com/display/COH33UG/Production+Checklist#ProductionChecklist-LargeClusterConfiguration
    Let me know the results.
    Thanks,
    Ashish

  • JAX RI:javax.activation.DataHandler cannot be cast to com.sun.xml.ws.....

    I'm newbie in web services, and I would like to create web service for upload files.
    Axis2 is installed, and I tried to implement some solutions I found on the web, but i got an error:
    javax.activation.DataHandler cannot be cast to com.sun.xml.ws.developer.StreaminDataHandler
    on server side code looks like:
    @WebMethod(operationName = "getHeight")
    public int getHeight(String name, @XmlMimeType("application/octet-stream") DataHandler data) {
    StreamingDataHandler dh = (StreamingDataHandler) data; //this is where error occurs..
    on client side:
    tt=new javax.activation.FileDataSource("c:\\myImage.jpg");
    dhh=new javax.activation.DataHandler(tt);
    int r=port.getHeight("name", dhh);
    tnx :)

    Hi dKohlert,
    I have now changed my code completely and got it working this way !
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.ws.Provider;
    import javax.xml.ws.Service;
    import javax.xml.ws.ServiceMode;
    import javax.xml.ws.WebServiceProvider;
    * @author Footman
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider( targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    //@WebService(name="GlobalLogoutService", targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    public class GlobalLogoutServiceImpl implements Provider<SOAPMessage> {
    @WebMethod(operationName ="globalLogout", action="urn:liberty:soap-action")
        public SOAPMessage invoke(@WebParam(name = "logoutRequest") SOAPMessage logoutRequest ){
            return logoutRequest;
        }Thanks anyway for your reply. If I find some time I will try to use the apt-tool.

  • Java.io.NotSerializableException: com.tangosol.util.internal.ConcurrentCoun

    Hi,
    I am working on a small prototyep project trying to understand how coherence works.
    I have a object that creates an instance of entry processor and invokes the cache. I get following error. Entry processor is serializable - the app can write an instance of EP into a file.
    Using same setup if I merely call put() it works fine for me.
    Any idea what coherence is doing here ?
    Thanks
    ~s
    ===
    (Wrapped) com.tangosol.util.internal.ConcurrentCounter) java.io.NotSerializableException: com.tangosol.util.internal.ConcurrentCounter
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at com.tangosol.coherence.Component.writeObject(Component.CDB:1)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at com.tangosol.coherence.Component.writeObject(Component.CDB:1)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at com.tangosol.coherence.Component.writeObject(Component.CDB:1)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at com.tangosol.coherence.Component.writeObject(Component.CDB:1)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)

    The problem is fixed.
    In my EP, process() was returning "entry" instead of modified object. Comparing my code with some other samples helped me.
    So it is all down to my mistake.
    Thanks
    ~s

  • Usage of com.tangosol.util.ServiceListener

    Hi All,
    I am struggling to figure out how to register a com.tangosol.util.ServiceListener with a service in cache-configuration file?? My intention here is to perform some operation intimidate after the distributed self-service is started.
    Any info on this highly appreciated.
    Regards,
    Avinash

    user9170308 wrote:
    Hi All,
    I am struggling to figure out how to register a com.tangosol.util.ServiceListener with a service in cache-configuration file?? My intention here is to perform some operation intimidate after the distributed self-service is started.
    Any info on this highly appreciated.
    Regards,
    AvinashHi Avinash,
    I think you meant immediately... :)
    I am not sure if you can register a service listener in the configuration file, as the listener tag on the service registers a map listener.
    You can however define a partition-listener, which is invoked with a PARTITION_ASSIGNED when partitions are assigned to the senior node (starting with Coherence 3.6) upon starting up the distributed cache service on a storage-enabled node, and PARTITION_RECEIVE_BEGIN callbacks when non-senior nodes start getting their partitions so it is almost as good.
    On a storage-disabled node instantiation of a cache listener could be your clue, although that happens during configuring the service, so the service is not available at that point yet, but having a service listener for a distributed cache service on a node which is storage-disabled for the service is not typical anyway.
    You can also look at quorum policies starting with 3.6 which are invoked fairly early, too, but not necessarily on each node.
    Best regards,
    Robert

  • What is com.tangosol.util.Dequeue used for?

    Can I use a com.tangosol.util.Dequeue to allow one producer to be placing objects in a coherence backed dequeue while other consumers are atomically dequeueing from it?
    Thanks,
    Andrew

    snidely_whiplash wrote:
    Can I use a com.tangosol.util.Dequeue to allow one producer to be placing objects in a coherence backed dequeue while other consumers are atomically dequeueing from it?
    Thanks,
    AndrewHi Andrew,
    that class is not a queue backed by Coherence caches. It is simply a double ended queue similar to java.util.Dequeue introduced in Java 6.
    Best regards,
    Robert

  • Thread STUCK for more than 10minutes at  com.tangosol.util.SegmentedHashMap

    <[STUCK] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "707" seconds working on the request "weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl@11ddce1", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    java.lang.Object.wait(Native Method)
    com.tangosol.util.SegmentedHashMap.contendForSegment(SegmentedHashMap.java:1391)
    com.tangosol.util.SegmentedHashMap.lockSegment(SegmentedHashMap.java:1301)
    com.tangosol.util.SegmentedHashMap.lockBucket(SegmentedHashMap.java:1266)
    com.tangosol.util.SegmentedHashMap.invokeOnKey(SegmentedHashMap.java:1058)
    com.tangosol.util.SegmentedConcurrentMap.lock(SegmentedConcurrentMap.java:197)
    com.tangosol.net.cache.CachingMap.get(CachingMap.java:462)

    Hi,
    A 2019 ms delay could be caused by a number of things. It could be network related or more likely as the message says the WebLogic node could have been doing a GC. As your WebLogic node is a Cluster member you need to make sure that its GC is properly tuned to avoid long GC pauses as this can destabelize the whole cluster. I see you are using 3.5.3/465p8 which is an older version of Coherence and lacks the newer node death detection algorithms. I know from the project I work on that also uses 3.5.3/465p8 that long GCs on cluster members can cause other nodes in the cluster to die if you get GC pauses that are too long or too frequent.
    I doubt that this message is related to the stuck thread issue in your original post, though it is hard to tell for certain.
    JK

  • When is prune() called on com.tangosol.util.Cache?

    I'm trying to extend Cache as it very closely fits what I need to do with my application data expiration model. My question is: is prune() called BEFORE the cache fills up (that is, did the call that triggered the prune() succeed)?
    I have to be able to signal to the upper application layers that a prune was forced and some data may no longer be valid. If prune was called AS the cache became full (rather than just after), I can signal the application that data was removed, and there is no threat to the correctness of the app.

    Hi Kris
    A further question along these lines: is prune() the
    mechanism that is called to remove values that have
    timed out, rather than when the Cache is full? No, <tt>prune()</tt> is not what is called for timed out entries. We have a separate method that is called to remove the specific entry that has expired. This is because within the Cache you can set expiry on an entry by entry basis.
    I would also like to do periodic, timeout-based
    expirations from my cache to avoid the full hit of
    letting the cache fill all the way up before removing
    any data.The Cache currently supports timeout-based expirations. You can either have a global cache-entry-timeout set (see constructors) or set it on an entry by entry basis. If an entry has a timeout set on it and it has expired the entry will be removed during the <tt>iterator()</tt> or <tt>toArray()</tt> calls.
    Regards,
    Rob

  • ComponentBean cannot be cast to ComponentBean

    I am receiving the following error message when trying to deploy my application on jboss:
    javax.faces.FacesException: Can't parse configuration file: jar:file:/C:/jboss-4.2.2-1-jsf/server/default/deploy/pims.ear/lib/jsf-facelets.jar!/META-INF/faces-config.xml: Error at line 8 column 16: Error at (8, 16: com.sun.faces.config.beans.ComponentBean cannot be cast to com.sun.faces.config.beans.ComponentBean
    After much reading about JBoss classloading I suspect that its because the class is being loaded by two classloaders and is then causing problems.. I believe this class is located in jsf-impl.jar. Looking at the loader repository for the ear for my jsf web app, there are two references to jsf-impl.jar. The unexpected on being in the tmp folder.
    file:/C:/jboss-4.2.2-1-jsf/server/default/deploy/pims.ear/lib/jsf-impl.jar
    file:/C:/jboss-4.2.2-1-jsf/server/default/tmp/deploy/tmp25412jsf-impl.jar
    Any ideas how I can solve this problem? It´s driving me nuts...
    Thanks,
    David

    JBoss ships with a JSF implementation (under deploy/jboss-web.deployer/jsf-libs in my version, YMMV). [The JBoss wiki page on MyFaces|http://www.jboss.org/community/docs/DOC-10182] has some techniques for packaging JSF with a WAR.

  • ClassCastException: SplitIndexWriter cannot be cast to ClassWriterImpl

    Javadoc (version 1.6.0_17 on MS Windows) is crashing with a ClassCastException when I try to run it on a large, complex project. I haven't been able to figure out what triggers the failure yet so I was wondering if anyone has seen a similar problem? Here is the command line I am trying to run.
    javadoc.exe -d "C:\temp\hl7v3" -sourcepath "J:\Eclipse\Workspace\hl7v3\src\main\java" -subpackages com.axolotl.hl7.v3 -splitindex -use -version -author -link http://java.sun.com/javase/6/docs/api/It runs through and generates most of the HTML files, but finally throws this error.
    Generating C:\temp\hl7v3\index-files\index-7.html...
    java.lang.ClassCastException: com.sun.tools.doclets.formats.html.SplitIndexWriter cannot be cast to com.sun.tools.doclets.formats.html.ClassWriterImpl
            at com.sun.tools.doclets.formats.html.HtmlDocletWriter.seeTagToString(HtmlDocletWriter.java:1353)
            at com.sun.tools.doclets.formats.html.HtmlDocletWriter.commentTagsToString(HtmlDocletWriter.java:1443)
            at com.sun.tools.doclets.formats.html.HtmlDocletWriter.printCommentTags(HtmlDocletWriter.java:1412)
            at com.sun.tools.doclets.formats.html.HtmlDocletWriter.printInlineDeprecatedComment(HtmlDocletWriter.java:1377)
            at com.sun.tools.doclets.formats.html.AbstractIndexWriter.printComment(AbstractIndexWriter.java:182)
            at com.sun.tools.doclets.formats.html.AbstractIndexWriter.printDescription(AbstractIndexWriter.java:164)
            at com.sun.tools.doclets.formats.html.AbstractIndexWriter.generateContents(AbstractIndexWriter.java:89)
            at com.sun.tools.doclets.formats.html.SplitIndexWriter.generateIndexFile(SplitIndexWriter.java:102)
            at com.sun.tools.doclets.formats.html.SplitIndexWriter.generate(SplitIndexWriter.java:74)
            at com.sun.tools.doclets.formats.html.HtmlDoclet.generateOtherFiles(HtmlDoclet.java:101)
            at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:122)
            at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
            at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
            at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
            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 com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
            at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
            at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
            at com.sun.tools.javadoc.Start.begin(Start.java:128)
            at com.sun.tools.javadoc.Main.execute(Main.java:41)
            at com.sun.tools.javadoc.Main.main(Main.java:31)Here is a source link to what I think is the class throwing the exception: HtmlDocletWriter. Line 1353 seems to be related to processing an @see tag.
    Edited by: Nick_Radov on Nov 17, 2009 5:05 PM

    I meet the same issue in eclipse exporting Javadoc. Maybe "splitindex" prevent the build to an end. I cancel the choise of "Generate index" in basic option of "Configure Javadoc arguments for standard doclet." Then the build is normally over. Or a custom doclet may also can avoid this problem.

  • Java.util.HashMap cannot be cast to org.apache.struts.action.ActionForm

    Hi!
    anybody could help me?
    i am getting java.util.HashMap cannot be cast to org.apache.struts.action.ActionForm error when I run my jsp...
    heres my code :
    CommentAction.java
    package com.provintl.rmis.actions;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Map;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.sql.DataSource;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.provintl.rmis.forms.CommentForm;
    public class CommentAction extends Action {
         Statement stmt = null;
         Connection con = null;
         javax.sql.DataSource dataSource;
         PreparedStatement ps = null;
         ResultSet rs=null;
         byte updFlg = 0;
         Map commentlist = new HashMap();
         /* (non-Javadoc)
         * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         @Override
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
         throws Exception {
              CommentForm commentForm = new CommentForm();
              Date date = commentForm.getDaterecord();
              String comment = commentForm.getComment();
              //TODO : temporary 1 == rose
              int userID =1;
              int appID =1;
              String SelectQry = "SELECT "+
                                       "APPLICANT_TBL.CHFNAME, "+
                                       "APPLICANT_TBL.CHLNAME, "+
                                       "APPLICANT_TBL.INTAPPID, "+
                                       "USERHST_TBL.CHCOMMENT, "+
                                       "USERHST_TBL.DTDATECREATED, "+
                                       " USERHST_TBL.INTHSTID "+
                                       "FROM "+
                                       "APPLICANT_TBL "+
                                       "INNER JOIN USERHST_TBL ON (APPLICANT_TBL.INTAPPID = USERHST_TBL.INTAPPID) " +
                                       "WHERE APPLICANT_TBL.CHFNAME ='"+request.getParameter("first")+"' " +
                                                 "AND APPLICANT_TBL.CHLNAME ='"+request.getParameter("last")+"'";
              try {
                   dataSource = (DataSource)getDataSource(request, "RMIS");
                   con = dataSource.getConnection();
                   con.setAutoCommit(false);
                   stmt = con.createStatement();
                   System.out.println("database connected");
                   rs = stmt.executeQuery(SelectQry);
                   System.out.println("database connected");
                   int ctr = 1;
                   while(rs.next()){
                        commentlist.put(ctr,new CommentForm(rs.getString("CHFNAME"),rs.getDate("DTDATECREATED")));
                        ctr++;
                   if(updFlg !=0){
                        String insQry = "INSERT INTO RECRUIT.USERHST_TBL (CHCOMMENT, INTUSERID, INTAPPID)" +
                        "VALUES ('"+comment+"',"+userID+","+appID+")";
                        stmt.executeUpdate(insQry);
                        con.commit();
                        updFlg = 0;
                   HttpSession session = request.getSession();
                   session.setAttribute("commentlist", commentlist);
                   //con.setAutoCommit(true);
              } catch (SQLException se) {
                   System.out.println("We got an exception while preparing a statement:" +
                   "Probably bad SQL.");
                   System.out.println(SelectQry);
                   se.printStackTrace();
                   //System.exit(1);
              finally {
                   try {
                        rs.close();
                        stmt.close();
                        con.close();
                   } catch (SQLException e) {
                        e.printStackTrace();
              return mapping.findForward("comment");
    commentform.jsp
    =============
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html"     prefix="html"%>
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
    <%@ taglib uri="http://java.sun.com/jstl/sql_rt" prefix="sql"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script>
    function putLabel(lbl, formName){
    if (opener && !opener.closed){
    opener.document.addapp.jobposition.value=lbl;
    window.close();
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>List of open positions</title>
    </head>
    <body>
    <h2>Job Positions Available</h2>
    <%
    int ctr = 1; %>
    <logic:iterate id="myString" name="commentlist" scope="session">
    <table width="100%" border="0">
    <%
    String bakcolor;
    if((ctr % 2) == 0){
         bakcolor = "WHITE";
         ctr++;
    else{
         bakcolor = "SILVER";
         ctr++;
    %>
    <tr><td bgcolor="<%= bakcolor %>">
    <bean:write name="myString" property="value" />
    </td></tr>
    ${commentlist}
    </table>
    </logic:iterate>
    </body>
    </html>
    thank you in advance!

    Shilnag wrote:
    Hello guys,
    I am new to java... I am trying to develop a web application using
    1.Struts1.2
    2.tomcat 5.5
    3.eclipse 3.2.2Big mistake. Nobody new to Java should jump straight into webapps, let alone using a framework like Struts. Debatably, even Eclipse should be left alone.
    It's precisely because of this that you're having problems. Presumably you're following a tutorial or something, but - as demonstrated - as soon as it goes wrong, you're stuck. Learn some core Java first, trust me

  • Java 7 update 51 cause the following error: java.util.HashMap cannot be cast to java.awt.RenderingHints

    Since I installed Java 7 update 51 accessing the EMC VNX Unisphere Console cause the following error: java.util.HashMap cannot be cast to java.awt.RenderingHints.
    I rolled back to Apple Java 1.6 -005 now I am getting the following error: plug-in failure.
    I think this is cused by the fact that the EMC console application has been written for java 7 and not java 6. Has anybody faced and solved the "java.util.HashMap cannot be cast to java.awt.RenderingHints." error ?

    Hi Yaakov,
    The error is thrown from the  eclipselink.jar:2.5.1 which is a JPA provider .
    Is the above jar bundled in the Oracle Product you are working upon or was this downloaded from external site ?
    If the jar is bundled with the Oracle Product, go ahead a log a SR with Oracle Support with Toplink product group to drill down on the issue, as the issue is happening internally or thrown by the Eclipselink implementation and we've no control....
    Hope it helps!!
    Thanks,
    Vijaya

  • How to resolve oracle.jbo.Key cannot be cast to java.util.List?

    Hi experts,
    I am getting this error (oracle.jbo.Key cannot be cast to java.util.List) PPR# . . . . . while filtering in grid..
    give some idea to solve this please...
    Note: (This error is occurs only in JDev ver 11.1.1.3.0 and its working fine in 11.1.1.2.0)
    Regards,
    Gops

    I guess information is too less, could you provide some more info ?
    Amit

  • Com.waveset.util.ConfigurationError: Cannot find columns for table 'object'

    I am trying to install IDM on my own laptop and use MS SQL Server 2000 as the repository. I run the create table scripts, copy all the jar files to C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Idm\WEB-INF\lib. But I still got the following error message:
    com.waveset.util.ConfigurationError: Cannot find columns for table 'object' ==>com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'object'
    Does anyone have any idea of what may cause this problem?
    THANKS!

    I found the solution to this issue.. is that the Database user ID must be set to the schema .. this is the statment that probably did not work:
    CREATE USER <username> FOR LOGIN <login name> with DEFAULT_SCHEMA = <database name>
    In sql 2005 expand the database... open security .. find the user.. right click and select properties.. in the default schema box.. select the SunSync database .. in the schemas owned by this user select the sunsync schema database..
    good luck

  • Weblogic 10.3 error apache ListOrderedMap cannot be cast to java HashMap.

    Hi All,
    I'm having following code which is using spring(version: 2.0) dao
    public Map<String, String> getEmplyeeMap() throws Exception {     
              StringBuffer query = new StringBuffer("");
              query.append("select emp_name,dept_name from EMPLOYEE order by emp_no");
              logger.info("Inside getEmplyeeMap...Query to be executed :"+query.toString());     
              Map<String, String> EmpMap = new LinkedHashMap<String, String>();
              List<Map<String,String>> l_lstQueryRes = (ArrayList<Map<String,String>>)getJdbcTemplate().queryForList(query.toString());
              logger.info("l_lstQueryRes:"+l_lstQueryRes);
              if (l_lstQueryRes != null)
                   for (int l_iLoop = 0; l_iLoop < l_lstQueryRes.size(); l_iLoop++)
                        Map<String,String> l_mapRowData = new HashMap<String,String>();
                        l_mapRowData = (HashMap<String,String>)l_lstQueryRes.get(l_iLoop);                    
                        EmpMap.put(l_mapRowData.get("emp_name"), l_mapRowData.get("dept_name"));
                   }//End of for loop
              }//End of if loop          
              logger.info("EmpMap list size is.." + EmpMap.size());
              return EmpMap;
         } //End of getEmplyeeMap
    getting below error
    org.apache.commons.collections.map.ListOrderedMap cannot be cast to java.util.HashMap
    I'm thinking this problem is occurring because of jdk1.6 version, is anyone come across this problem?? This same working good in weblogic9.2 version.
    Thanks advance.
    Regards,
    Sharath.

    user9222505 wrote:
    Ok, thanks. So how do i determine where we are at since I have this "465"? How does that relate to a particular patch?
    Logger@9214443 3.5.3/465I believe, you are on 3.5.3 unpatched, and if I correctly remember, after applying the 3.5.3 patch 4 it should like like 3.5.3p4/... or 3.5.3.4/... (don't remember which one)... You would have to download that patch from your Oracle Support website (whichever you use), and apply the patch to a pristine extracted directory of 3.5.3 according to instructions in the patch zip.
    Starting with a recent version no more manual patching is necessary and you can download full distributions of patched versions from Oracle Support, but I don't think that applies to 3.5.3, yet (although it is possible that they recreated patch artifacts like that for earlir versions).
    If you do not have a support contract then you cannot download a patch or patched versions. You can only download a new full release which always has any previously released patches incorporated, though 3.5.3 is the last 3.5 full release if I correctly remember... and 3.6 comes with code incompatibilities at a few places so it is not a drop-in replacement...
    Best regards,
    Robert

Maybe you are looking for