Everytime I iterate through the list returned by my ejbSelectStudents I get an error, 
see below.   I've been researching this for two days and can't find any referrence 
solutions.  Does anyone know why this is happening?

session remote code:

      public void getStudents(Integer courseCode) 
      throws EJBException, RemoteException {
            try
            {
               . 
               .
              Collection list =  
                    courseLocalHome.queryStudents(courseCode);
              Iterator iter = list.iterator();

// the list is coming back with two students.....but on System.out below I'm getting 
the error.

              while(iter.hasNext())
              {
                 student = (Student)iter.next();
                 System.out.println(student.getName());
              }
            }
            catch (Exception ex)
            {
              e.printStackTrace(out);
            }
      }
   

local ejb code:

.
.
   public Collection ejbHomeQueryStudents()
      throws FinderException
   {
      return ejbSelectStudents();
   }

.
.   


13:42:32,925 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: 
public abstract java.lang.Integer com.school.local.interfaces.Students.getName(), 
causedBy:
javax.ejb.NoSuchObjectLocalException: EJB home methods are not allowed to access CMP 
or CMR fields: methodName=getStudentOID
        at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:142)
        at 
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
        at 
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
........


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3843315#3843315

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3843315


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to