0 Replies Latest reply on Nov 24, 2009 7:39 PM by maltaweel

    Bytecode error loading class

    maltaweel

      Hi,

      I am loading classes via javassist and everything works fine when i run processes on one node.

      However, I am now running my javassist code using a distributed process.

      I have this code:

      ________________________________________________________
      ClassPool pool = ClassPool.getDefault();
      CtClass clazz = pool.makeClass("repast.simphony.util.bytecode.__DataSource" + counter++);
      clazz.addInterface(pool.get("repast.simphony.util.bytecode.DataSource"));
      StringBuilder methodStr = new StringBuilder("public Object getData(Object obj) {return ");

      _____________________________________________________________

      In the distributed mode I get an error stating:

      javassist.NotFoundException: repast.simphony.util.bytecode.__DataSource0
      at javassist.ClassPool.get(ClassPool.java:436)
      at repast.simphony.util.bytecode.ByteCodeUtilities.createMethodCall(ByteCodeUtilities.java:74)
      at repast.simphony.data.logging.gather.MethodMapping.initDataSource(MethodMapping.java:48)
      at repast.simphony.data.logging.gather.MethodMapping.getColumnValue(MethodMapping.java:71)
      at repast.simphony.data.logging.gather.aggregate.AbstractStatsAggregateMapping.getStats(AbstractStatsAggregateMapping.java:44)
      ________________________________________________________

      So it seems that the DataSource class that I can make in one node is not able to be made in the other (remote) node. Is there something I should do to enable the class to be distributed and loaded across nodes?

      Thanks for your help.