• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Java Packages for Dummies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Packages for Dummies


  • Subject: Re: Java Packages for Dummies
  • From: Miguel Arroz <email@hidden>
  • Date: Tue, 4 Dec 2007 23:20:15 +0000

Hi!

Well, you are calling addObjectToBothSidesOfRelationshipWithKey ( aValue, "person" ) inside the setPerson method. Assuming the addObjectToBothSidesOfRelationshipWithKey will set the person using key/value accessors, addObjectToBothSidesOfRelationshipWithKey will call setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson that will call addObjectToBothSidesOfRelationshipWithKey that will set the person using key/value accessors by calling setPerson ...

  Get the ideia? ;)

  Yours

Miguel Arroz

On 2007/12/04, at 23:09, Owen McKerrow wrote:

Hi All,

As part of preparing to move to Eclipse we are going back and updating our projects so they are using packages ( this is the bit where I run and hide in shame as I have to admit we never used them before ) and EOGenerator if they weren't already. Anyways.....


We're having some issues, lots of issues so I think we've done something dumb. The first issue is that addbjectToBothSidesOfRelationship is now causing a StackOverflow error as it keeps calling itself. In the example below its for the AuditLog class. First up is the old code, then the new code ( thanks to EOGenerator ) and then the error message (I haven't included all of the stack trace as its the same thing over and over again ).


So as a newbie to packages I can't see any rules that we're breaking ( although we probably are ). Any advise/suggestions/fixes would be most appreciated.

---Old----

import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import java.math.BigDecimal;
import java.util.*;

/**
	Log trail of each time a page is accessed/viewed on the website.
*/
public class AccessLog extends OMGenericRecord {

    public AccessLog() {
        super();
    }


public Person person() { return (Person)storedValueForKey("person"); }

    public void setPerson(Person value) {
        takeStoredValueForKey(value, "person");
    }



----New-----

package edu.uow.ris.framework.eo;

import edu.uow.ris.framework.*;
import edu.uow.emlab.omframework.*;
import com.webobjects.eoaccess.*;
import com.webobjects.eocontrol.*;
import com.webobjects.foundation.*;
import java.math.BigDecimal;
import java.util.*;
import org.apache.log4j.Logger;

public abstract class _AccessLog extends OMGenericRecord {
	private static Logger log = Logger.getLogger( _AccessLog.class );

    public _AccessLog() {
        super();
    }

public void setPerson(edu.uow.ris.framework.eo.Person aValue) {
if( aValue == null ) {
edu.uow.ris.framework.eo.Person object = person();
if( object != null )
removeObjectFromBothSidesOfRelationshipWithKey ( object, "person" );
} else
addObjectToBothSidesOfRelationshipWithKey( aValue, "person" );
}







Error: com.webobjects.foundation.NSForwardException [java.lang.StackOverflowError] null


InvocationTargetException.java 54 <init> java.lang.reflect
GeneratedMethodAccessor8.java NA invoke sun.reflect
DelegatingMethodAccessorImpl.java 25 invoke sun.reflect
Method.java 585 invoke java.lang.reflect
NSKeyValueCoding.java 688 setMethodValue com.webobjects.foundation
NSKeyValueCoding.java 1175 setValueInObject com.webobjects.foundation
EOCustomObject.java 1601 takeValueForKey com.webobjects.eocontrol
EOCustomObject.java 1078 addObjectToBothSidesOfRelationshipWithKey com.webobjects.eocontrol
_AccessLog.java 83 setPerson edu.uow.ris.framework.eo
GeneratedMethodAccessor8.java NA invoke sun.reflect
DelegatingMethodAccessorImpl.java 25 invoke sun.reflect
Method.java 585 invoke java.lang.reflect
NSKeyValueCoding.java 688 setMethodValue com.webobjects.foundation
NSKeyValueCoding.java 1175 setValueInObject com.webobjects.foundation
EOCustomObject.java 1601 takeValueForKey com.webobjects.eocontrol
EOCustomObject.java 1078 addObjectToBothSidesOfRelationshipWithKey com.webobjects.eocontrol
_AccessLog.java 83 setPerson edu.uow.ris.framework.eo
GeneratedMethodAccessor8.java NA invoke sun.reflect
DelegatingMethodAccessorImpl.java 25 invoke sun.reflect
Method.java 585 invoke java.lang.reflect
NSKeyValueCoding.java 688 setMethodValue com.webobjects.foundation
NSKeyValueCoding.java 1175 setValueInObject com.webobjects.foundation
EOCustomObject.java 1601 takeValueForKey com.webobjects.eocontrol
EOCustomObject.java 1078 addObjectToBothSidesOfRelationshipWithKey com.webobjects.eocontrol
_AccessLog.java 83 setPerson edu.uow.ris.framework.eo




Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

People who prefer typing to pointing then seem to prefer acronyms to save typing :-)
-Denis Stanton, On people using Command Line Interfaces



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40guiamac.com


This email sent to email@hidden

Miguel Arroz http://www.terminalapp.net http://www.ipragma.com



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Java Packages for Dummies (From: Owen McKerrow <email@hidden>)

  • Prev by Date: Re: Java Packages for Dummies
  • Next by Date: Re: Java Packages for Dummies
  • Previous by thread: Re: Java Packages for Dummies
  • Next by thread: Re: Java Packages for Dummies
  • Index(es):
    • Date
    • Thread