Hi all,
I am successfully integrating Graffito mapping tools into my J2EE CMS
environment. But now Im facing a classloader problem. The following code is
throwing a ClassCastException in (DefaultTipology) resultIter.next() because
DefaultTipology.class.getClassLoader() != resultIter.next
().getClass().getClassLoader()
One is LocalClassLoader and the other is WebAppClassLoader.

          Filter filter = this.queryManager.createFilter(
DefaultTipology.class);
          Query query = this.queryManager.createQuery(filter);
          Collection result = this.persistenceManager.getObjects(query);
          Iterator resultIter = result.iterator();
          while(resultIter.hasNext()){
              DefaultTipology defTipo = (DefaultTipology) resultIter.next();
              this.tipologyIds.put(defTipo.getIdName(),defTipo);
          }

Is there a way to set the classloader in graffito, in order to have only one
instance of a class?

Reply via email to