Re: ERXMutableArray fields in Entity Modeler
Hi, I had a similar problem with MySQL (mysql-connector-java-5.0.4-bin.jar is the latest one I've tried) and mutableDictionary. There were two solutions that worked for me: 1. Change externalType to TEXT in model while leaving BLOB in the database (i.e. generate sql with TEXT and change type to BLOB after that). 2. Modify generator templates to have something like: public er.extensions.ERXMutableDictionary uploadsFileNames() { try { return (er.extensions.ERXMutableDictionary) storedValueForKey("uploadsFileNames"); } catch (ClassCastException e) { return (ERXMutableDictionary) ERXMutableDictionary.fromBlob((NSData) storedValueForKey("uploadsFileNames")); } } Both solutions are really dirty and can lead to unwanted side effects, so I've decided that it really doesn't worth the effort and refactored my model not to use these prototypes at all. You might also want to check this thread: http://www.wodeveloper.com/omniLists/webobjects-dev/2004/March/msg00340.html On Thu, Apr 17, 2008 at 3:20 PM, Jeff Schmitz <[EMAIL PROTECTED]> wrote: > Hello, > > I've taken Dave's SooperSeekrit Screencast project as a starting point to > start playing with EO objects using the Wonder Framework. > > Using Entity Modeler (with Frontbase prototypes), I've added an > ERXMutableArray to one of my classes that I want to use as an array of > Boolean's in my code. In this case, what do I need to put as the Value > Type? Also, for the width, will it be 4 bytes X the max number of Booleans > to be stored? > > > > I have tried just leaving these fields blank. > > > Then using the following code, I'm able to create a User object ok, and it > shows up in my database with the Boolean array as a Blob: > > > Group group = Group.fetchRequiredGroup(ec, "name", "user"); > Boolean [] bools = {true, false, true}; > ERXMutableArray boolArray = new ERXMutableArray(bools); > User.createUser(ec, boolArray, first, last, password, newuser, group); > ec.saveChanges(); > > However, when I try to a fetch from the DirectAction class as follows: > > > EOQualifier qual = > User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); > User user = User.fetchRequiredUser(ERXEC.newEditingContext(), qual); > > > I get the following exception on the User.fetchRequiredUser line: > > > Apr 16 22:31:32 SooperSeekrit[49595] (ERXDatabaseContextDelegate.java:105) > INFO er.transaction.adaptor.Exceptions - Database Exception occured: > java.lang.ClassCastException: er.extensions.ERXMutableArray > > I'm guessing it has to do with the missing fields? > > Thanks, > Jeff > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/dfrolov%40demax.ru > > This email sent to [EMAIL PROTECTED] > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: ERXMutableArray fields in Entity Modeler
On 17.04.2008, at 18:06, Jeff Schmitz wrote: So, would the recommended method (i.e simplest method, you know us Americans, always looking to take shortcuts) be to create a new table and a one to many relationship? My array really doesn't need to be mutable (the size is static and known), it's just that that was the only "array" choice given me in Entity Modeler. I use the array type in my application, and it's written and read just fine (with PostgreSQL). I never modify the array though. Just write and display (change tracking). cug -- http://www.event-s.net ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Problem with bindings to application class variables using WOLips in 5.4.1
On Apr 17, 2008, at 6:30 PM, Chuck Hill wrote: I'd guess that you have something messed up in the launcher: no main class selected, the wrong default directory, your application is in a package but this is not sent in build.properties of your application. When WO can find your Application, it defaults to com.webobjects.appserver.WOApplication. This is almost never what you want. Chuck I thought the XCode converter program had taken care of that stuff, but it looks like it didn't. I've seen some tutorial's that go over some of the basics of setting up a new project and that has helped me sort out some of the problems, but now I've run into some others. Is there a document that describes how all the various pieces tie together in Eclipse/WOLips? I've never had to worry about the build scripts and launching code with the old tools, but it looks like it's time to delve into it. Thanks, Kevin ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: MS SQL and NSTimestamp.DistantFuture
On 18/04/2008, at 1:45 AM, David Avendasora wrote: Apparently MS SQL Server does not like the value NSTimestamp.DistantFuture tries to send to the database. After capturing the exact SQL and trying it out using Aqua Data Studio, I get the following error: "Syntax error converting datetime from character string." The value it is trying to use is: '292278994-08-17 02:12:55' MS SQL doesn't like anything more than a 4-digit year. Don't tell me we learnt nothing from the y2k bug... and it's now a y10k bug ;-) I suppose I could just not use NSTimestamp.DistantFuture, and pass a date like '-12-31 23:59:59' or something. Any better suggestions for a work-around? Perhaps you could override your setters (via velocity) to call some transformFunction that'll round down a few years for mysql? with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Project Wonder : Database Migration : Downgrade
How do I downgrade my database using database migrations in project wonder? ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: I wonder if you have seen this before: exec: -X: invalid option
I think I had raised this issue on one of my failed deployment attempts. my MacOSXClassPath.txt had jvm=${jvm} I just fixed it there now just rsync around the working file. I could never get that file correct in my deployment straight from eclipse. Granted I haven't tried in a few years. -j- On Apr 17, 2008, at 4:45 PM, Chuck Hill wrote: I don't recall either, but I do recall seeing this. I think it was something simple, wrong version of the JVM marked as default, no default. something. For a quick hack, you should be able to edit ~/Library/ wobuild.properties and add jvm=java Before you do that, try running the build with ant -verbose -debug and see if you see anything that looks like a problem. Chuck On Apr 17, 2008, at 2:35 PM, Mike Schrag wrote: Please keep questions on the list ... I'm assuming ${jvm} is not set. This same question came up just a few weeks ago, but I don't recall what caused it. ms On Apr 17, 2008, at 5:07 PM, Klaus Berkling wrote: Sorry, forgot to mention. This only happens with ant builds. Thanks again. On Apr 17, 2008, at 2:00 PM, Klaus Berkling wrote: Hi Mike, Sorry to bother you. I wonder if you have seen this before: I'm executing the launch script for my WOApp. This is the output: ${jvm} -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory="/System" -DWOLocalRootDirectory="" -DWOUserDirectory="/Users/kiberkli/ Documents/Development/rsWorkspace/RecordServerApp/dist/ RecordServerApp.woa" -DWOEnvClassPath="" - DWOApplicationClass=Application -DWOPlatform=MacOS - Dcom.webobjects.pid=8317 -classpath WOBootstrap.jar com.webobjects._bootstrap.WOBootstrap ./RecordServerApp: line 301: exec: -X: invalid option I have another plain HelloWorld app and I don't see this error. Where in Eclipse are the flags passed into java? It's not in the script, it's not in the WO tab of the run configuration. Any thoughts? Thanks, much obliged. kib "Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli kib "Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/james%40jimijon.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: ERXMutableArray fields in Entity Modeler
On Apr 17, 2008, at 4:58 PM, Chuck Hill wrote: On Apr 17, 2008, at 2:42 PM, Mike Schrag wrote: Thanks for your response, and yes, I think you understand. I was hoping to not have to create a new table with just a boolean column along with a relationship and that I could somehow just store an array in one of the attribute fields directly for the same effect. I assumed that's what ERXMutableArray class was for. If not that, then what is it usually used for? I think it IS designed for that actually ... I would need to see the full stack trace of that exception to be able to diagnose further why you're getting a ClassCast, though. I believe you also have to replace the entire array when it changes (meaning setArrayOfBooleans(arrayOfChangedBooleans)) -- I don't think EOF likes mutable values, It really does not. but maybe there's some trickery inside of Wonder specifically for ERXMutableArray, I'm not sure. I've never used this class though ... Maybe Anjo knows, but his weekend apparently starts on Thursday (something about Americans being #1, and Germans not ... I don't recall precisely ;) ). Europeans, always so willing to trade not being #1 for having an actual life! They should learn to emulate Canadians. We are not #1 and we don't have lives either. I recall badgering Anjo about use of mutable attributes once. I think the eventually conceded that you did need to replace the array when it changed. The comments say an * be used as a EOF custom value class because it can automatically en- and * decode an NSMutableArray as blob into a database. So it can be used as an attribute without needing other cover methods in your EO (e.g. serializing plists to and from a String attribute), but is it not as trivial to use it as Jeff seems to be planning. So, would the recommended method (i.e simplest method, you know us Americans, always looking to take shortcuts) be to create a new table and a one to many relationship? My array really doesn't need to be mutable (the size is static and known), it's just that that was the only "array" choice given me in Entity Modeler. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/jeffandmonica%40mac.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Problem with bindings to application class variables using WOLips in 5.4.1
On Apr 17, 2008, at 4:16 PM, Kevin Windham wrote: I have moved an app to Eclipse/WOLips and WO 5.4.1 under Leopard. I think everything is working except for this last issue. Any component page that has a binding to an application class variable is throwing an unknown key exception. : Exception occurred while handling request: message ' valueForKey(): lookup of unknown key: 'stateList'. That seems quite true to me, com.webobjects.appserver.WOApplication does not, in fact, have stateList. :-) This class does not have an instance variable of the name stateList or _stateList, nor a method of the name stateList, _stateList, getStateList, or _getStateList I have in my application class a number of lists setup for various popup menus that I reuse in several components. One of these is just a list of state abbreviations. In my component wod file it is bound as application.stateList. In Application.java I have. public class Application extends ERXApplication { public NSArray stateList; Anyone seen this before and know what causes it? I have cleaned the project and all my bindings to the session class seem to work fine and I don't really know what would make this different. Is there some kind of project setting that would cause this. I must admit to being thoroughly lost in the Eclipse/WOLips environment. I'd guess that you have something messed up in the launcher: no main class selected, the wrong default directory, your application is in a package but this is not sent in build.properties of your application. When WO can find your Application, it defaults to com.webobjects.appserver.WOApplication. This is almost never what you want. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Problem with bindings to application class variables using WOLips in 5.4.1
I have moved an app to Eclipse/WOLips and WO 5.4.1 under Leopard. I think everything is working except for this last issue. Any component page that has a binding to an application class variable is throwing an unknown key exception. : Exception occurred while handling request: message ' valueForKey(): lookup of unknown key: 'stateList'. This class does not have an instance variable of the name stateList or _stateList, nor a method of the name stateList, _stateList, getStateList, or _getStateList I have in my application class a number of lists setup for various popup menus that I reuse in several components. One of these is just a list of state abbreviations. In my component wod file it is bound as application.stateList. In Application.java I have. public class Application extends ERXApplication { public NSArray stateList; Anyone seen this before and know what causes it? I have cleaned the project and all my bindings to the session class seem to work fine and I don't really know what would make this different. Is there some kind of project setting that would cause this. I must admit to being thoroughly lost in the Eclipse/WOLips environment. Thanks, Kevin ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: ERXMutableArray fields in Entity Modeler
Uhm, where was the part that I traded anything? Am 17.04.2008 um 23:58 schrieb Chuck Hill: Europeans, always so willing to trade not being #1 for having an actual life! ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: ERXMutableArray fields in Entity Modeler
On Apr 17, 2008, at 2:42 PM, Mike Schrag wrote: Thanks for your response, and yes, I think you understand. I was hoping to not have to create a new table with just a boolean column along with a relationship and that I could somehow just store an array in one of the attribute fields directly for the same effect. I assumed that's what ERXMutableArray class was for. If not that, then what is it usually used for? I think it IS designed for that actually ... I would need to see the full stack trace of that exception to be able to diagnose further why you're getting a ClassCast, though. I believe you also have to replace the entire array when it changes (meaning setArrayOfBooleans(arrayOfChangedBooleans)) -- I don't think EOF likes mutable values, It really does not. but maybe there's some trickery inside of Wonder specifically for ERXMutableArray, I'm not sure. I've never used this class though ... Maybe Anjo knows, but his weekend apparently starts on Thursday (something about Americans being #1, and Germans not ... I don't recall precisely ;) ). Europeans, always so willing to trade not being #1 for having an actual life! They should learn to emulate Canadians. We are not #1 and we don't have lives either. I recall badgering Anjo about use of mutable attributes once. I think the eventually conceded that you did need to replace the array when it changed. The comments say an * be used as a EOF custom value class because it can automatically en- and * decode an NSMutableArray as blob into a database. So it can be used as an attribute without needing other cover methods in your EO (e.g. serializing plists to and from a String attribute), but is it not as trivial to use it as Jeff seems to be planning. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
RE: ERXMutableArray fields in Entity Modeler
Original Message Subject: Re: ERXMutableArray fields in Entity Modeler From: Jeff Schmitz <[EMAIL PROTECTED]> Date: Thu, April 17, 2008 2:34 pm To: [EMAIL PROTECTED] Cc: webobjects-dev@lists.apple.com Hi Ray, Thanks for your response, and yes, I think you understand. I was hoping to not have to create a new table with just a boolean column along with a relationship and that I could somehow just store an array in one of the attribute fields directly for the same effect. I assumed that's what ERXMutableArray class was for. If not that, then what is it usually used for?Thanks,JeffThis might not be the most sophisticated solution, but you might consider storing your booleans in the database as a bit field. Store a 32 bit integer and you have 32 booleans and you can provide accessor methods in your business logic that returns the info however you want. You can even use KVC so that some arbitrary labels match up with specific bit positions. You can write all the accessors (for better documentation) or use objectForUnboundKey (check the doc for exact) to respond to an arbitrary KVC to your object.There are lots of ways to do it. Some might be less workable in the future, but it depends on what you need to do.- rayOn Apr 17, 2008, at 3:35 PM, [EMAIL PROTECTED] wrote: Original Message Subject: ERXMutableArray fields in Entity Modeler From: Jeff Schmitz <[EMAIL PROTECTED]> Date: Thu, April 17, 2008 4:20 am To: WebObjects Mailing List <[EMAIL PROTECTED].com> Hello, I've taken Dave's SooperSeekrit Screencast project as a starting point to start playing with EO objects using the Wonder Framework. Using Entity Modeler (with Frontbase prototypes), I've added an ERXMutableArray to one of my classes that I want to use as an array of Boolean's in my code. In this case, what do I need to put as the Value Type? Also, for the width, will it be 4 bytes X the max number of Booleans to be stored? I have tried just leaving these fields blank.Then using the following code, I'm able to create a User object ok, and it shows up in my database with the Boolean array as a Blob: Group group = Group.fetchRequiredGroup(ec, "name", "user"); Boolean [] bools = {true, false, true}; ERXMutableArray boolArray = new ERXMutableArray(bools); User.createUser(ec, boolArray, first, last, password, newuser, group); ec.saveChang es();However, when I try to a fetch from the DirectAction class as follows: EOQualifier qual = User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); User user = User.fetchRequiredUser(ERXEC.newEditingContext(), qual);I get the following exception on the User.fetchRequiredUser line:Apr 16 22:31:32 SooperSeekrit[49595] (ERXDatabaseContextDelegate.java:105) INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.ClassCastException: er.extensions.ERXMutableArrayI'm guessing it has to do with the missing fields?Thanks,JeffI might be misunderstanding your question or what you are trying to do. But I think that you are not going to be able to do this as you describe.The picture you show is for the Properties of an attribute value. In other words, if you are returning an array of booleans, then you somehow have a to-many relationship that is returning some number of value attributes. Those value attributes are of t ype boolean. The relationship is, in an object-oriented sense, an attribute also. But it is not a value attribute.If you look at a relationship in a model, and look at its Properties, you will see what can be done with a relationship.Does this make sense?- ray ___Do not post admin requests to the list. They will be ignored.Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)Help/Unsubscribe/Update your Subscription:http://lists.apple.com/mailman/options/webobjects-dev/jeffandmonica%40mac.comThis email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: I wonder if you have seen this before: exec: -X: invalid option
I don't recall either, but I do recall seeing this. I think it was something simple, wrong version of the JVM marked as default, no default. something. For a quick hack, you should be able to edit ~/Library/ wobuild.properties and add jvm=java Before you do that, try running the build with ant -verbose -debug and see if you see anything that looks like a problem. Chuck On Apr 17, 2008, at 2:35 PM, Mike Schrag wrote: Please keep questions on the list ... I'm assuming ${jvm} is not set. This same question came up just a few weeks ago, but I don't recall what caused it. ms On Apr 17, 2008, at 5:07 PM, Klaus Berkling wrote: Sorry, forgot to mention. This only happens with ant builds. Thanks again. On Apr 17, 2008, at 2:00 PM, Klaus Berkling wrote: Hi Mike, Sorry to bother you. I wonder if you have seen this before: I'm executing the launch script for my WOApp. This is the output: ${jvm} -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory="/System" - DWOLocalRootDirectory="" -DWOUserDirectory="/Users/kiberkli/ Documents/Development/rsWorkspace/RecordServerApp/dist/ RecordServerApp.woa" -DWOEnvClassPath="" - DWOApplicationClass=Application -DWOPlatform=MacOS - Dcom.webobjects.pid=8317 -classpath WOBootstrap.jar com.webobjects._bootstrap.WOBootstrap ./RecordServerApp: line 301: exec: -X: invalid option I have another plain HelloWorld app and I don't see this error. Where in Eclipse are the flags passed into java? It's not in the script, it's not in the WO tab of the run configuration. Any thoughts? Thanks, much obliged. kib "Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli kib "Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: ERXMutableArray fields in Entity Modeler
Thanks for your response, and yes, I think you understand. I was hoping to not have to create a new table with just a boolean column along with a relationship and that I could somehow just store an array in one of the attribute fields directly for the same effect. I assumed that's what ERXMutableArray class was for. If not that, then what is it usually used for? I think it IS designed for that actually ... I would need to see the full stack trace of that exception to be able to diagnose further why you're getting a ClassCast, though. I believe you also have to replace the entire array when it changes (meaning setArrayOfBooleans(arrayOfChangedBooleans)) -- I don't think EOF likes mutable values, but maybe there's some trickery inside of Wonder specifically for ERXMutableArray, I'm not sure. I've never used this class though ... Maybe Anjo knows, but his weekend apparently starts on Thursday (something about Americans being #1, and Germans not ... I don't recall precisely ;) ). ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: I wonder if you have seen this before: exec: -X: invalid option
Please keep questions on the list ... I'm assuming ${jvm} is not set. This same question came up just a few weeks ago, but I don't recall what caused it. ms On Apr 17, 2008, at 5:07 PM, Klaus Berkling wrote: Sorry, forgot to mention. This only happens with ant builds. Thanks again. On Apr 17, 2008, at 2:00 PM, Klaus Berkling wrote: Hi Mike, Sorry to bother you. I wonder if you have seen this before: I'm executing the launch script for my WOApp. This is the output: ${jvm} -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory="/System" - DWOLocalRootDirectory="" -DWOUserDirectory="/Users/kiberkli/ Documents/Development/rsWorkspace/RecordServerApp/dist/ RecordServerApp.woa" -DWOEnvClassPath="" - DWOApplicationClass=Application -DWOPlatform=MacOS - Dcom.webobjects.pid=8317 -classpath WOBootstrap.jar com.webobjects._bootstrap.WOBootstrap ./RecordServerApp: line 301: exec: -X: invalid option I have another plain HelloWorld app and I don't see this error. Where in Eclipse are the flags passed into java? It's not in the script, it's not in the WO tab of the run configuration. Any thoughts? Thanks, much obliged. kib "Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli kib "Success is not final, failure is not fatal: it is the courage to continue that counts.” - Winston Churchill Klaus Berkling Systems Administrator DynEd International, Inc. www.dyned.com | www.eskimo.com/~kiberkli ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: ERXMutableArray fields in Entity Modeler
Hi Ray, Thanks for your response, and yes, I think you understand. I was hoping to not have to create a new table with just a boolean column along with a relationship and that I could somehow just store an array in one of the attribute fields directly for the same effect. I assumed that's what ERXMutableArray class was for. If not that, then what is it usually used for? Thanks, Jeff On Apr 17, 2008, at 3:35 PM, [EMAIL PROTECTED] wrote: Original Message Subject: ERXMutableArray fields in Entity Modeler From: Jeff Schmitz <[EMAIL PROTECTED]> Date: Thu, April 17, 2008 4:20 am To: WebObjects Mailing List Hello, I've taken Dave's SooperSeekrit Screencast project as a starting point to start playing with EO objects using the Wonder Framework. Using Entity Modeler (with Frontbase prototypes), I've added an ERXMutableArray to one of my classes that I want to use as an array of Boolean's in my code. In this case, what do I need to put as the Value Type? Also, for the width, will it be 4 bytes X the max number of Booleans to be stored? I have tried just leaving these fields blank. Then using the following code, I'm able to create a User object ok, and it shows up in my database with the Boolean array as a Blob: Group group = Group.fetchRequiredGroup(ec, "name", "user"); Boolean [] bools = {true, false, true}; ERXMutableArray boolArray = new ERXMutableArray(bools); User.createUser(ec, boolArray, first, last, password, newuser, group); ec.saveChang es(); However, when I try to a fetch from the DirectAction class as follows: EOQualifier qual = User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); User user = User.fetchRequiredUser(ERXEC.newEditingContext(), qual); I get the following exception on the User.fetchRequiredUser line: Apr 16 22:31:32 SooperSeekrit[49595] (ERXDatabaseContextDelegate.java:105) INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.ClassCastException: er.extensions.ERXMutableArray I'm guessing it has to do with the missing fields? Thanks, Jeff I might be misunderstanding your question or what you are trying to do. But I think that you are not going to be able to do this as you describe. The picture you show is for the Properties of an attribute value. In other words, if you are returning an array of booleans, then you somehow have a to-many relationship that is returning some number of value attributes. Those value attributes are of t ype boolean. The relationship is, in an object-oriented sense, an attribute also. But it is not a value attribute. If you look at a relationship in a model, and look at its Properties, you will see what can be done with a relationship. Does this make sense? - ray ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/jeffandmonica%40mac.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: webobjects and oracle
Theodore Petrosky wrote: I am accustomed to using webobjects and postgresql. I do have an oracle database running that I need to communicate to. Every time go to the Oracle website to try to download the drivers, I get so confused. What do I need to download? This is for the free oracle express version 10g... Hi, Go to: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_111060.html Click Accept and download the following files: ojdbc5.jar - actual driver, it requires Java 1.5 orai18n.jar - put it into classpath, it enables NLS features and localized messages Wiktor Moskwa -- Power Media S.A. Wroclaw, Poland http://www.power.com.pl ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
webobjects and oracle
I am accustomed to using webobjects and postgresql. I do have an oracle database running that I need to communicate to. Every time go to the Oracle website to try to download the drivers, I get so confused. What do I need to download? This is for the free oracle express version 10g... Thanks. Ted Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Creating and Editing EO's
Hi all, I think it's a rather basic question, however after searching the web for sometime, I haven't found the answer yet. I have made a D2W application, in which I want to have a few differences between creating a new EO and editing an existing EO. Particularly, when creating, I want the user to be able to provide a value for the database primary key through a D2WEditString, and when editing, I want the user not to be able to edit them at all, through a D2WDisplayString. I thought doing this adding a few rules with the assistant for such cases. However, it seems that there is no way in D2W to distinguish between editing an existent object, and creating a new one, as it uses the same page and the same task. Is this really true? I can't believe, there's no way to make this small differences. Any suggestions of how I can make this work? -- Atentamente, Cuauhtemoc Hohman ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: "First request in session" problem and a bug in WOComponentRequestHandler
Please report both problems to bugreport.apple.com. Thank you, Chuck On Apr 17, 2008, at 6:30 AM, Wiktor Moskwa wrote: Hello wo-dev, Maybe the following problems are known to you or maybe they're even fixed in 5.4. I hope that someone much more experienced in WebObjects can comment on this. Our environment is WebObjects 5.3.3 with Wonder 4.0 deployed on Gentoo Linux. The problem: 1. An application recevies the first request in session, by which I mean a request without "wosid" cookie or SID in URL (request.isSessionIDInRequest() == false) For example an URL bookmarked by a user in her browser. 2. The request's handler key is "wo", so this is a component action i.e.: .../cgi-bin/WebObjects/ifirma.woa/wo/2.0.0.15.1.11.3.1 or direct component access i.e.: .../cgi-bin/WebObjects/ifirma.woa/wo/FakturaBrowse.wo Second one little or no sense in production because it would be a nice backdoor so we reject it of course. But first one is handled by WO in a weird way. 3. Before WOApplication.dispatchRequest calls a proper request handler - in this case WOComponentRequestHandler it creates a new session completely ignoring the fact that it makes no sense :) If by a coincidence elementID in the request is equal to one of elementIDs on a default (Main.wo) page in the application, invokeAction is called on this element usually resulting in a weird exception being thrown. Strange for me is that contextID is ignored in this case, in my opinion a new session should expect contextID==0. In our case, the following URL bookmarked by one of our users https://www.ifirma.pl/cgi-bin/WebObjects/ifirma.woa/wo/7.0.0.15.5 caused an application to throw the following exception: java.lang.IllegalStateException: : Missing page name. at invokeAction(WOHyperlink.java:78) at invokeAction(ERXHyperlink.java:56) ... (there was no improper WOHyperlink on this page, I can assure you) Our solution: The following code is put into Application class, (descriptionForRequest method is not important here). == private boolean isRequestForRedirect(WORequest request) { // Only component requests are filtered if (componentRequestHandlerKey().equals(request.requestHandlerKey())) { // First direct component access attempts are blocked // i.e.: /wo/FirmaBrowse.wo or /wo/oWHEMIojtbvC0evhGU1Dt0/ FirmaBrowse.wo if (request.requestHandlerPathArray() != null) { String senderID = (String) request.requestHandlerPathArray().lastObject(); if (senderID.endsWith(".wo")) { pmLog.info("Redirecting request with direct component access attempt: " + descriptionForRequest(request, false)); return true; } } // Then requests with too many elements in requestHandlerPath are blocked // i.e.: /wo/SomethingElse/ oWHEMIojtbvC0evhGU1Dt0/0.0.21.1.1.4.2.0.0 if ((request.requestHandlerPathArray() != null) && (request.requestHandlerPathArray().count() > 2)) { pmLog.warn("Redirecting request with handler path array too long: " + descriptionForRequest(request, true)); return true; } // Finally block all component action requests without session information // i.e.: bookmarked URLs like /wo/7.0.0.15.5 if (request.isSessionIDInRequest() == false) { pmLog.info("Redirecting request without session information: " + descriptionForRequest(request, true)); return true; } } return false; } @Override public WOResponse dispatchRequest(WORequest request) { boolean requestForRedirect = isRequestForRedirect(request); // Redirect broken requests to default direct action if (requestForRedirect) { WOContext context = createContextForRequest(request); WORedirect redirect = new WORedirect(context); String redirectUrl = context.directActionURLForActionNamed("default", null); redirect.setUrl(redirectUrl); return redirect.generateResponse(); } else { return super.dispatchRequest(request); } } === During research on this topic I encountered a bug in com.webobjects.appserver._private.WOComponentRequestHandler If the above handler receives a request with requestHandlerPath longer then 2 elements and this is a direct component access, it throws ArrayIndexOutOfBoundsException from line 108 in the above class. And the user will see: "An Internal Server Error Has Occurred." Just try following URLs on your applications: .../cgi-bin/WebObjects/APP.woa/wo/xxx/yyy/Something.wo for example: http://www.dyned.com/cgi-bin/WebObjects/WOShowcase.woa/wo/xxx/yyy/Error.wo (xxx, yyy and Error can be of
MS SQL and NSTimestamp.DistantFuture
Hi all, Apparently MS SQL Server does not like the value NSTimestamp.DistantFuture tries to send to the database. After capturing the exact SQL and trying it out using Aqua Data Studio, I get the following error: "Syntax error converting datetime from character string." The value it is trying to use is: '292278994-08-17 02:12:55' MS SQL doesn't like anything more than a 4-digit year. I suppose I could just not use NSTimestamp.DistantFuture, and pass a date like '-12-31 23:59:59' or something. Any better suggestions for a work-around? Dave ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: specify port
Monitor runs on port 56789 by default. Try edit/add WOPort= in its Properties file inside the monitor.woa itself. The system property WOPort determines the port usually of a WO app. It can be set in Properties (common during development), assigned automatically by Monitor, IIRC configured specifically in Monitor (check Monitor instance screen), or as a launch argument. On Apr 17, 2008, at 11:35 AM, Anthony B Arthur wrote: Can anyone tell me how to specify the port that monitor runs on? I have searched the dev list, but not finding it. I suspect I can specify a port for any WO app the same way. I need to do both. Thanks, --Brian ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%40mac.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: specify port
server admin, select WO service, it's in there. Simon On 17 Apr 2008, at 16:35, Anthony B Arthur wrote: Can anyone tell me how to specify the port that monitor runs on? I have searched the dev list, but not finding it. I suspect I can specify a port for any WO app the same way. I need to do both. Thanks, --Brian ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/simon_mclean%40mac.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
specify port
Can anyone tell me how to specify the port that monitor runs on? I have searched the dev list, but not finding it. I suspect I can specify a port for any WO app the same way. I need to do both. Thanks, --Brian ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
"First request in session" problem and a bug in WOComponentRequestHandler
Hello wo-dev, Maybe the following problems are known to you or maybe they're even fixed in 5.4. I hope that someone much more experienced in WebObjects can comment on this. Our environment is WebObjects 5.3.3 with Wonder 4.0 deployed on Gentoo Linux. The problem: 1. An application recevies the first request in session, by which I mean a request without "wosid" cookie or SID in URL (request.isSessionIDInRequest() == false) For example an URL bookmarked by a user in her browser. 2. The request's handler key is "wo", so this is a component action i.e.: .../cgi-bin/WebObjects/ifirma.woa/wo/2.0.0.15.1.11.3.1 or direct component access i.e.: .../cgi-bin/WebObjects/ifirma.woa/wo/FakturaBrowse.wo Second one little or no sense in production because it would be a nice backdoor so we reject it of course. But first one is handled by WO in a weird way. 3. Before WOApplication.dispatchRequest calls a proper request handler - in this case WOComponentRequestHandler it creates a new session completely ignoring the fact that it makes no sense :) If by a coincidence elementID in the request is equal to one of elementIDs on a default (Main.wo) page in the application, invokeAction is called on this element usually resulting in a weird exception being thrown. Strange for me is that contextID is ignored in this case, in my opinion a new session should expect contextID==0. In our case, the following URL bookmarked by one of our users https://www.ifirma.pl/cgi-bin/WebObjects/ifirma.woa/wo/7.0.0.15.5 caused an application to throw the following exception: java.lang.IllegalStateException: : Missing page name. at invokeAction(WOHyperlink.java:78) at invokeAction(ERXHyperlink.java:56) ... (there was no improper WOHyperlink on this page, I can assure you) Our solution: The following code is put into Application class, (descriptionForRequest method is not important here). == private boolean isRequestForRedirect(WORequest request) { // Only component requests are filtered if (componentRequestHandlerKey().equals(request.requestHandlerKey())) { // First direct component access attempts are blocked // i.e.: /wo/FirmaBrowse.wo or /wo/oWHEMIojtbvC0evhGU1Dt0/FirmaBrowse.wo if (request.requestHandlerPathArray() != null) { String senderID = (String) request.requestHandlerPathArray().lastObject(); if (senderID.endsWith(".wo")) { pmLog.info("Redirecting request with direct component access attempt: " + descriptionForRequest(request, false)); return true; } } // Then requests with too many elements in requestHandlerPath are blocked // i.e.: /wo/SomethingElse/oWHEMIojtbvC0evhGU1Dt0/0.0.21.1.1.4.2.0.0 if ((request.requestHandlerPathArray() != null) && (request.requestHandlerPathArray().count() > 2)) { pmLog.warn("Redirecting request with handler path array too long: " + descriptionForRequest(request, true)); return true; } // Finally block all component action requests without session information // i.e.: bookmarked URLs like /wo/7.0.0.15.5 if (request.isSessionIDInRequest() == false) { pmLog.info("Redirecting request without session information: " + descriptionForRequest(request, true)); return true; } } return false; } @Override public WOResponse dispatchRequest(WORequest request) { boolean requestForRedirect = isRequestForRedirect(request); // Redirect broken requests to default direct action if (requestForRedirect) { WOContext context = createContextForRequest(request); WORedirect redirect = new WORedirect(context); String redirectUrl = context.directActionURLForActionNamed("default", null); redirect.setUrl(redirectUrl); return redirect.generateResponse(); } else { return super.dispatchRequest(request); } } === During research on this topic I encountered a bug in com.webobjects.appserver._private.WOComponentRequestHandler If the above handler receives a request with requestHandlerPath longer then 2 elements and this is a direct component access, it throws ArrayIndexOutOfBoundsException from line 108 in the above class. And the user will see: "An Internal Server Error Has Occurred." Just try following URLs on your applications: .../cgi-bin/WebObjects/APP.woa/wo/xxx/yyy/Something.wo for example: http://www.dyned.com/cgi-bin/WebObjects/WOShowcase.woa/wo/xxx/yyy/Error.wo (xxx, yyy and Error can be of course any strings) My code above does not solve this bug because invoking createContextForRequest(request) trig