1 Reply Latest reply on Sep 25, 2004 8:10 PM by hubaghdadi

    Odd exception

    hubaghdadi

      Hola all.
      I have the following problem.
      I have bidirectional, one to many relation (Team and Players)
      I have a session facade bean contains the following methods :

      public Collection getTeamPlayers(String name) {
       Collection players = null;
       try {
       LocalTeam team = teamHome.findByPrimaryKey(name);
       players = team.getPlayers();
       this.convertCollection(players);
       } catch (FinderException e) {
       System.err.println("Error in getTeamPlayers(): " + e.toString( ));
       }
       return players;
       }
      
       private Collection convertCollection(Collection col) {
       Iterator it = col.iterator();
       Vector vec = new Vector(1);
       while (it.hasNext()) {
       PlayerDTO dto = this.extract((LocalPlayer)it.next());
       vec.addElement(dto);
       }
       return vec;
       }
      
       private PlayerDTO extract(LocalPlayer player) {
       PlayerDTO dto = null;
       try {
       dto = new PlayerDTO(player.getNum(), player.getName());
       } catch (Exception e) {
       System.err.println("Error in extract( ): " + e.toString( ));
       }
       return dto;
       }
      

      I have create a team with some players and set the CMR field (correctly, coz
      I didn't get any exception, and the database contains the right values).
      when invoking :
      Collection col = manager.getTeamPlayers("FC Barcelona");
      I got :
      java.lang.reflect.UndeclaredThrowableException
      caused by :
      java.io.NotSerializableException : org.jboss.ejb.plugins.cmp.jdbc.bridge.Relationset
      any help will be great.