Re: NSKeyValueCoding$UnknownKeyException error that is beyond me
Re: NSKeyValueCoding$UnknownKeyException error that is beyond me
- Subject: Re: NSKeyValueCoding$UnknownKeyException error that is beyond me
- From: Chuck Hill <email@hidden>
- Date: Fri, 14 Feb 2003 20:44:19 -0800
Hi Ray,
I'm not too clear from your description exactly what you are doing but here
are two things to look at:
1. WOBuilder uses a rather simplistic method of renaming keys. I often
find that I need to go in manually and search and replace the cases in the
.java file that it missed.
2. WOBuilder does not seem to use the most advanced Java parser in the
world. This construct:
public String name1, name2, name4;
might confuse it. When it generates keys it does so one per line, like so:
public String name1;
public String name2;
public String name4;
It might be happier if you did the same.
Hope that helps,
Chuck
At 04:55 PM 15/02/2003 +1300, Ray Ackland wrote:
>I am new to Web Objects, but I have done my best to figure out this
>problem, but assume it is just one of those bits of knowledge you pick
>up from other people.
>
>I have created a basic Web Application, with only the standard
>structure - with the exception of adding JDBC and one EOModel.
>
>I then use WO Builder to create a couple of keys (just test strings)
>and add the necessary code to give the strings a value.
>
>I link the values in WO Builder and run the app. Everything goes ok.
>However, when I add more variables, or even just change the name of one
>(relinking in WO B) and run, I get an error message:
>com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: [
>valueForKey()]: lookup of unknown key: 'name4'. This WOComponent does
>not have an instance variable of the name name4 or _name4, nor a method
>of the name name4, _name4, getName4, or _getName4
>
>If I change the name of the variable back, it works again.
>
>To complicate things, sometimes it works and others not. The new
>variable always shows up in WO Builder, available to be linked. I have
>also tried with accessor methods without any effect.
>
>I am really stuck with this, and would help any suggestions. Here is my
>main.java file if that would help.
>//
>// Main.java: Class file for WO Component 'Main'
>// Project test
>//
>// Created by raya on Sat Feb 15 2003
>//
>
>import com.webobjects.foundation.*;
>import com.webobjects.appserver.*;
>import com.webobjects.eocontrol.*;
>import com.webobjects.eoaccess.*;
>
>public class Main extends WOComponent
>{
> public String name1, name2, name4;
> public int aNumber;
>
>
> public Main(WOContext context)
> {
> super(context);
> name1 = "a";
> name2 = "b";
> name4 = "c";
> aNumber = 3;
> }
>
>}
>Thanks,
>
>Ray.
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.