Re: Disable constraint checking under H2
David Avendasora had an improved delegate that I think he mentioned committing to Wonder. Maybe he has not gotten around to it? Logically, you can't have mandatory circular relationships without deferred constraint handling. David? Chuck On 2013-03-19, at 9:05 PM, Paul Hoadley wrote: > Hello, > > In production we use PostgreSQL, but I am investigating the possibility of > running functional tests (using Selenium WebDriver) during continuous > integration, so I'm looking at getting a particular application running with > H2. H2 doesn't support deferred constraints, and it doesn't take very long > for that to become an issue. I've tried using > ERXEntityDependencyOrderingDelegate, but it bailed out because of a circular > reference in a model. As an aside, it's complaining about an optional > circular reference (where every Person has an Organisation, and Organisations > have an optional 'creator' pointing back to Person)—it's certainly _right_, > but I dug up a thread where someone seemed to be suggesting that _optional_ > relationships wouldn't be a problem. Maybe it needs to be optional in both > directions. > > In any case, I'm slightly stuck. Before I start looking at H2's "SET > REFERENTIAL_INTEGRITY FALSE" statement, can anyone suggest a more subtle > workaround for this? > > > -- > Paul Hoadley > http://logicsquad.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: > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > This email sent to ch...@global-village.net -- Chuck Hill Executive Managing Partner, VP Development and Technical Services 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/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Disable constraint checking under H2
Hello, In production we use PostgreSQL, but I am investigating the possibility of running functional tests (using Selenium WebDriver) during continuous integration, so I'm looking at getting a particular application running with H2. H2 doesn't support deferred constraints, and it doesn't take very long for that to become an issue. I've tried using ERXEntityDependencyOrderingDelegate, but it bailed out because of a circular reference in a model. As an aside, it's complaining about an optional circular reference (where every Person has an Organisation, and Organisations have an optional 'creator' pointing back to Person)—it's certainly _right_, but I dug up a thread where someone seemed to be suggesting that _optional_ relationships wouldn't be a problem. Maybe it needs to be optional in both directions. In any case, I'm slightly stuck. Before I start looking at H2's "SET REFERENTIAL_INTEGRITY FALSE" statement, can anyone suggest a more subtle workaround for this? -- Paul Hoadley http://logicsquad.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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Correcting the cgi-bin linkage in a WebObjects/Wonder deploy
I really have no idea what Ken's setup is and so no idea on what advice to give you. Chuck On 2013-03-19, at 5:21 PM, Baiss Eric Magnusson wrote: > Is there some Terminal aliases/variables I can type to see the offending > linkage? > > Do I need to uncomment the WebObjectsConfig file line below with some > pertinent information? > >> Do a grep in /Library/WebObjects/Adaptors and /etc/apache2 and search for >> "cgi-bin". > Just the aforementioned ScriptAliasMatch was found, it matched Chuck's. >> >>> Include /Library/WebObjects/Adaptors/wo_apache.conf... > >> LoadModule WebObjects_module /Library/WebObjects/Adaptors/mod_WebObjects.so >> >> # You can change the 'cgi-bin' part of WebObjectsAlias to whatever you >> # prefer (such as Apps), but the 'WebObjects' part is required. >> WebObjectsAlias /cgi-bin/WebObjects >> ... > >> # For localhost: >> WebObjectsConfig http://localhost:1085 10 >> >> # File Configuration >> # The apache module gets its configuration from one file >> # WebObjectsConfig file:// 10 > >> Note: deployment hierarchy was generated from the click on Ken's WonderBar. > > --- > Baiss Eric Magnusson > cascadewebdesign.com > > > > > ___ > 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: > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > This email sent to ch...@global-village.net -- Chuck Hill Executive Managing Partner, VP Development and Technical Services 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/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Correcting the cgi-bin linkage in a WebObjects/Wonder deploy
Is there some Terminal aliases/variables I can type to see the offending linkage? Do I need to uncomment the WebObjectsConfig file line below with some pertinent information? > Do a grep in /Library/WebObjects/Adaptors and /etc/apache2 and search for > "cgi-bin". Just the aforementioned ScriptAliasMatch was found, it matched Chuck's. > >> Include /Library/WebObjects/Adaptors/wo_apache.conf... > LoadModule WebObjects_module /Library/WebObjects/Adaptors/mod_WebObjects.so > > # You can change the 'cgi-bin' part of WebObjectsAlias to whatever you > # prefer (such as Apps), but the 'WebObjects' part is required. > WebObjectsAlias /cgi-bin/WebObjects > ... > # For localhost: > WebObjectsConfig http://localhost:1085 10 > > # File Configuration > # The apache module gets its configuration from one file > # WebObjectsConfig file:// 10 > Note: deployment hierarchy was generated from the click on Ken's WonderBar. --- Baiss Eric Magnusson cascadewebdesign.com ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Immortal… ehm, frozen instances.
I think the problem is not that it is creating needless sessions, but that a checked-out session is not getting checked back in. Chuck On 2013-03-19, at 5:08 PM, Simon wrote: > if we have this kind of issue the first thing we do is log out session > creation and check the stack traces. stick something like this in your > session constructor then check the output: > > public Session() { > super(); > StringWriter stringWriter = new StringWriter(); > > PrintWriter printWriter = new PrintWriter(stringWriter); > > (new Throwable()).printStackTrace(printWriter); > > String trace = stringWriter.toString(); < log this somewhere that you can > get easy access to > > } > > > > > > > On 19 March 2013 23:15, Altera WO Team wrote: > Wow, good hint! > > In theory I'm not touching a Session but sometimes, when something in an EO > changes I trigger e-mail sending. > I use ERMailDeliveryHTML using a component instantiated with a brand new > wocontext using ERXWOContext.newContext() > the component is not referencing a Session in any part. > > Could it be the cause? > > Matteo > > > On 19/mar/2013, at 21:24, Simon wrote: > >> ...or you are touching the session object outside the RR loop. the classic >> gotcha is rendering a component in a thread that touches the session in some >> way e.g. delivering an email in a thread that uses a component to render >> it's content... been caught by that one s many times! >> >> >> On 19 March 2013 17:51, Chuck Hill wrote: >> Hi Matteo, >> >> You have one or more Zombie (aka Immortal) Sessions, as shown by stack >> traces like this: >> "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() >> [0x7f16f7cfa000] >>java.lang.Thread.State: WAITING (on object monitor) >> at java.lang.Object.wait(Native Method) >> - waiting on <0xd120b328> (a >> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >> at java.lang.Object.wait(Object.java:485) >> at >> com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) >> - locked <0xd120b328> (a >> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >> at >> com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) >> at >> er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) >> at >> er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) >> at >> er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) >> at >> com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) >> at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) >> >> >> This likely has one of two causes: >> 1. The application is getting OutOfMemory errors, which can leave the >> session store in an insane state >> 2. The app is throwing an exception from sleep() in Session. If you >> overrride sleep() it should use a try...finally block >> >> public void sleep() { >> try { >> // Your code here! >> } finally { >> super.sleep(); >> } >> } >> >> >> Chuck >> >> >> >> On 2013-03-19, at 9:38 AM, Altera WO Team wrote: >> >> > Hi all, >> > >> > I'm having a strange issue on a WO installation on EC2 (oracle jvm). >> > Same strange application which had immortal sessions… >> > >> > Sometimes (quite rarely) a bounced application (put in refuse new >> > sessions) never quits and it's not accessible from JavaMonitor. >> > If I look at the logs i see: >> > >> > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >> > : refusing new clients and below min active >> > session threshold >> > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >> > : about to terminate... >> > >> > The only thing left is to kill the instance… Which is not nice. >> > >> > I'm not overriding the terminate() method in Application. >> > >> > I am attaching a stack trace if it helps. >> > >> > >> > Thanks, >> > >> > >> > >> > Matteo Centro >> > ___ >> > 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: >> > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >> > >> > This email sent to ch...@global-village.net >> >> -- >> Chuck Hill >> Executive Managing Partner, VP Development and Technical Services >> >> 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/gvc/practical_webobjects >> >> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest >> Growing Companies in B.C! >> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of
Re: Immortal… ehm, frozen instances.
if we have this kind of issue the first thing we do is log out session creation and check the stack traces. stick something like this in your session constructor then check the output: public Session() { super(); StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); (new Throwable()).printStackTrace(printWriter); String trace = stringWriter.toString(); < log this somewhere that you can get easy access to } On 19 March 2013 23:15, Altera WO Team wrote: > Wow, good hint! > > In theory I'm not touching a Session but sometimes, when something in an > EO changes I trigger e-mail sending. > I use ERMailDeliveryHTML using a component instantiated with a brand new > wocontext using ERXWOContext.newContext() > the component is not referencing a Session in any part. > > Could it be the cause? > > Matteo > > > On 19/mar/2013, at 21:24, Simon wrote: > > ...or you are touching the session object outside the RR loop. the classic > gotcha is rendering a component in a thread that touches the session in > some way e.g. delivering an email in a thread that uses a component to > render it's content... been caught by that one s many times! > > > On 19 March 2013 17:51, Chuck Hill wrote: > >> Hi Matteo, >> >> You have one or more Zombie (aka Immortal) Sessions, as shown by stack >> traces like this: >> "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in >> Object.wait() [0x7f16f7cfa000] >>java.lang.Thread.State: WAITING (on object monitor) >> at java.lang.Object.wait(Native Method) >> - waiting on <0xd120b328> (a >> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >> at java.lang.Object.wait(Object.java:485) >> at >> com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) >> - locked <0xd120b328> (a >> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >> at >> com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) >> at >> er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) >> at >> er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) >> at >> er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) >> at >> com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) >> at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) >> >> >> This likely has one of two causes: >> 1. The application is getting OutOfMemory errors, which can leave the >> session store in an insane state >> 2. The app is throwing an exception from sleep() in Session. If you >> overrride sleep() it should use a try...finally block >> >> public void sleep() { >> try { >> // Your code here! >> } finally { >> super.sleep(); >> } >> } >> >> >> Chuck >> >> >> >> On 2013-03-19, at 9:38 AM, Altera WO Team wrote: >> >> > Hi all, >> > >> > I'm having a strange issue on a WO installation on EC2 (oracle jvm). >> > Same strange application which had immortal sessions… >> > >> > Sometimes (quite rarely) a bounced application (put in refuse new >> sessions) never quits and it's not accessible from JavaMonitor. >> > If I look at the logs i see: >> > >> > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >> : refusing new clients and below min active >> session threshold >> > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >> : about to terminate... >> > >> > The only thing left is to kill the instance… Which is not nice. >> > >> > I'm not overriding the terminate() method in Application. >> > >> > I am attaching a stack trace if it helps. >> > >> > >> > Thanks, >> > >> > >> > >> > Matteo Centro >> > ___ >> > 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: >> > >> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >> > >> > This email sent to ch...@global-village.net >> >> -- >> Chuck Hill >> Executive Managing Partner, VP Development and Technical Services >> >> 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/gvc/practical_webobjects >> >> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest >> Growing Companies in B.C! >> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of >> Canada’s Fastest-Growing Companies by PROFIT Magazine! >> >> >> >> >> >> >> >> >> >> >> >> >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >
Using WebLogic as a servlet container?
Hello List, I wonder if any of you has had experience moving a WebObjects app (5.4.x) to run as a servlet inside a BEA WebLogic container on Linux? There is not much information aside from Chapter 10 in Practical WebObjects about WebObjects and J2EE, and the wiki has some info deploying a WebObjects app with Tomcat, but there is no info with WebLogic. I would appreciate any additional links/ references? Any real-world experience? Any limitations, gotchas to be aware of? Thank you for any insight, -mai ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Immortal… ehm, frozen instances.
Wow, good hint! In theory I'm not touching a Session but sometimes, when something in an EO changes I trigger e-mail sending. I use ERMailDeliveryHTML using a component instantiated with a brand new wocontext using ERXWOContext.newContext() the component is not referencing a Session in any part. Could it be the cause? Matteo On 19/mar/2013, at 21:24, Simon wrote: > ...or you are touching the session object outside the RR loop. the classic > gotcha is rendering a component in a thread that touches the session in some > way e.g. delivering an email in a thread that uses a component to render it's > content... been caught by that one s many times! > > > On 19 March 2013 17:51, Chuck Hill wrote: > Hi Matteo, > > You have one or more Zombie (aka Immortal) Sessions, as shown by stack traces > like this: > "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() > [0x7f16f7cfa000] >java.lang.Thread.State: WAITING (on object monitor) > at java.lang.Object.wait(Native Method) > - waiting on <0xd120b328> (a > com.webobjects.appserver.WOSessionStore$TimeoutEntry) > at java.lang.Object.wait(Object.java:485) > at > com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) > - locked <0xd120b328> (a > com.webobjects.appserver.WOSessionStore$TimeoutEntry) > at > com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) > at > er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) > at > er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) > at > er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) > at > com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) > at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) > > > This likely has one of two causes: > 1. The application is getting OutOfMemory errors, which can leave the session > store in an insane state > 2. The app is throwing an exception from sleep() in Session. If you > overrride sleep() it should use a try...finally block > > public void sleep() { > try { > // Your code here! > } finally { > super.sleep(); > } > } > > > Chuck > > > > On 2013-03-19, at 9:38 AM, Altera WO Team wrote: > > > Hi all, > > > > I'm having a strange issue on a WO installation on EC2 (oracle jvm). > > Same strange application which had immortal sessions… > > > > Sometimes (quite rarely) a bounced application (put in refuse new sessions) > > never quits and it's not accessible from JavaMonitor. > > If I look at the logs i see: > > > > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - > > : refusing new clients and below min active > > session threshold > > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - > > : about to terminate... > > > > The only thing left is to kill the instance… Which is not nice. > > > > I'm not overriding the terminate() method in Application. > > > > I am attaching a stack trace if it helps. > > > > > > Thanks, > > > > > > > > Matteo Centro > > ___ > > 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: > > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > > > This email sent to ch...@global-village.net > > -- > Chuck Hill > Executive Managing Partner, VP Development and Technical Services > > 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/gvc/practical_webobjects > > Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing > Companies in B.C! > Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of > Canada’s Fastest-Growing Companies by PROFIT Magazine! > > > > > > > > > > > > > ___ > 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: > https://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk > > This email sent to si...@potwells.co.uk > ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Immortal… ehm, frozen instances.
...or you are touching the session object outside the RR loop. the classic gotcha is rendering a component in a thread that touches the session in some way e.g. delivering an email in a thread that uses a component to render it's content... been caught by that one s many times! On 19 March 2013 17:51, Chuck Hill wrote: > Hi Matteo, > > You have one or more Zombie (aka Immortal) Sessions, as shown by stack > traces like this: > "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in > Object.wait() [0x7f16f7cfa000] >java.lang.Thread.State: WAITING (on object monitor) > at java.lang.Object.wait(Native Method) > - waiting on <0xd120b328> (a > com.webobjects.appserver.WOSessionStore$TimeoutEntry) > at java.lang.Object.wait(Object.java:485) > at > com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) > - locked <0xd120b328> (a > com.webobjects.appserver.WOSessionStore$TimeoutEntry) > at > com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) > at > er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) > at > er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) > at > er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) > at > com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) > at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) > > > This likely has one of two causes: > 1. The application is getting OutOfMemory errors, which can leave the > session store in an insane state > 2. The app is throwing an exception from sleep() in Session. If you > overrride sleep() it should use a try...finally block > > public void sleep() { > try { > // Your code here! > } finally { > super.sleep(); > } > } > > > Chuck > > > > On 2013-03-19, at 9:38 AM, Altera WO Team wrote: > > > Hi all, > > > > I'm having a strange issue on a WO installation on EC2 (oracle jvm). > > Same strange application which had immortal sessions… > > > > Sometimes (quite rarely) a bounced application (put in refuse new > sessions) never quits and it's not accessible from JavaMonitor. > > If I look at the logs i see: > > > > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - > : refusing new clients and below min active > session threshold > > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - > : about to terminate... > > > > The only thing left is to kill the instance… Which is not nice. > > > > I'm not overriding the terminate() method in Application. > > > > I am attaching a stack trace if it helps. > > > > > > Thanks, > > > > > > > > Matteo Centro > > ___ > > 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: > > > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > > > This email sent to ch...@global-village.net > > -- > Chuck Hill > Executive Managing Partner, VP Development and Technical Services > > 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/gvc/practical_webobjects > > Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest > Growing Companies in B.C! > Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of > Canada’s Fastest-Growing Companies by PROFIT Magazine! > > > > > > > > > > > > > ___ > 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: > > https://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk > > This email sent to si...@potwells.co.uk ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Immortal… ehm, frozen instances.
So that i catch an exception in ec().lock() basically… Will try! Thanks, Matteo On 19/mar/2013, at 19:24, Chuck Hill wrote: > Hi Matteo, > > I would use the same try...finally block in terminate() as well. And a > finally inside of that to unlock the ec. > > Chuck > > > On 2013-03-19, at 11:20 AM, Altera WO Team wrote: > >> Thanks Chuck, >> >> no OutOfMemory errors (at least in the log) >> and no override of sleep() >> >> but we do override terminate() >> >> @Override >> public void terminate() { > try { >> log.info("TERMINATE " + sessionID()); >> >> ec().lock(); >> try { >> if (cart != null && shouldDeleteCart) { >> log.debug("Deleting cart " + sessionID()); >> int saveCounter = 0; >> do { >> if (cart.cleanAll()) { >> ec().deleteObject(cart); >> } >> saveCounter++; >> } while (!save() && saveCounter <= >> Application.SAVE_ATTEMPTS); >> } >> } catch (Exception e) { >> e.printStackTrace(); >> } > finally { >> ec().unlock(); > } >> >> log.info("Terminating session with ID:" + sessionID()); > } finally { >> super.terminate(); > } >> } >> >> >> ec() simply returns defaultEditingContext() (it's an ERXSession subclass) >> >> and save() is this: >> >> public boolean save() { >> boolean hasSaved = false; >> EOEditingContext editingContext = ec(); >> try { >> editingContext.saveChanges(); >> hasSaved = true; >> //Thrown for each eo that fails to save. >> } catch (EOGeneralAdaptorException saveException) { >> log.error("/*** OPTIMISTIC LOCKING FAILURE ***/ >> "+sessionID()); >> log.error(saveException.getMessage()); >> editingContext.revert(); >> } >> return hasSaved; >> } >> >> This method makes me nervous, I don't trust it very much… >> >> Also I'm not sure about the explicit lock and unlock in the terminate method >> but since it's not in a R-R loop it might make sense to explicitly lock the >> ec, or not? >> >> >> Matteo >> >> On 19/mar/2013, at 18:51, Chuck Hill wrote: >> >>> Hi Matteo, >>> >>> You have one or more Zombie (aka Immortal) Sessions, as shown by stack >>> traces like this: >>> "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() >>> [0x7f16f7cfa000] >>> java.lang.Thread.State: WAITING (on object monitor) >>> at java.lang.Object.wait(Native Method) >>> - waiting on <0xd120b328> (a >>> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >>> at java.lang.Object.wait(Object.java:485) >>> at >>> com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) >>> - locked <0xd120b328> (a >>> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >>> at >>> com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) >>> at >>> er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) >>> at >>> er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) >>> at er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) >>> at com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) >>> at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) >>> >>> >>> This likely has one of two causes: >>> 1. The application is getting OutOfMemory errors, which can leave the >>> session store in an insane state >>> 2. The app is throwing an exception from sleep() in Session. If you >>> overrride sleep() it should use a try...finally block >>> >>> public void sleep() { >>> try { >>> // Your code here! >>> } finally { >>> super.sleep(); >>> } >>> } >>> >>> >>> Chuck >>> >>> >>> >>> On 2013-03-19, at 9:38 AM, Altera WO Team wrote: >>> Hi all, I'm having a strange issue on a WO installation on EC2 (oracle jvm). Same strange application which had immortal sessions… Sometimes (quite rarely) a bounced application (put in refuse new sessions) never quits and it's not accessible from JavaMonitor. If I look at the logs i see: Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - : refusing new clients and below min active session threshold Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - : about to terminate... The only thing
Re: Immortal… ehm, frozen instances.
Hi Matteo, I would use the same try...finally block in terminate() as well. And a finally inside of that to unlock the ec. Chuck On 2013-03-19, at 11:20 AM, Altera WO Team wrote: > Thanks Chuck, > > no OutOfMemory errors (at least in the log) > and no override of sleep() > > but we do override terminate() > > @Override > public void terminate() { try { > log.info("TERMINATE " + sessionID()); > > ec().lock(); > try { > if (cart != null && shouldDeleteCart) { > log.debug("Deleting cart " + sessionID()); > int saveCounter = 0; > do { > if (cart.cleanAll()) { > ec().deleteObject(cart); > } > saveCounter++; > } while (!save() && saveCounter <= > Application.SAVE_ATTEMPTS); > } > } catch (Exception e) { > e.printStackTrace(); > } finally { > ec().unlock(); } > > log.info("Terminating session with ID:" + sessionID()); } finally { > super.terminate(); } > } > > > ec() simply returns defaultEditingContext() (it's an ERXSession subclass) > > and save() is this: > > public boolean save() { > boolean hasSaved = false; > EOEditingContext editingContext = ec(); > try { > editingContext.saveChanges(); > hasSaved = true; > //Thrown for each eo that fails to save. > } catch (EOGeneralAdaptorException saveException) { > log.error("/*** OPTIMISTIC LOCKING FAILURE ***/ > "+sessionID()); > log.error(saveException.getMessage()); > editingContext.revert(); > } > return hasSaved; > } > > This method makes me nervous, I don't trust it very much… > > Also I'm not sure about the explicit lock and unlock in the terminate method > but since it's not in a R-R loop it might make sense to explicitly lock the > ec, or not? > > > Matteo > > On 19/mar/2013, at 18:51, Chuck Hill wrote: > >> Hi Matteo, >> >> You have one or more Zombie (aka Immortal) Sessions, as shown by stack >> traces like this: >> "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() >> [0x7f16f7cfa000] >> java.lang.Thread.State: WAITING (on object monitor) >> at java.lang.Object.wait(Native Method) >> - waiting on <0xd120b328> (a >> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >> at java.lang.Object.wait(Object.java:485) >> at >> com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) >> - locked <0xd120b328> (a >> com.webobjects.appserver.WOSessionStore$TimeoutEntry) >> at >> com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) >> at >> er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) >> at >> er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) >> at er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) >> at com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) >> at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) >> >> >> This likely has one of two causes: >> 1. The application is getting OutOfMemory errors, which can leave the >> session store in an insane state >> 2. The app is throwing an exception from sleep() in Session. If you >> overrride sleep() it should use a try...finally block >> >> public void sleep() { >> try { >> // Your code here! >> } finally { >> super.sleep(); >> } >> } >> >> >> Chuck >> >> >> >> On 2013-03-19, at 9:38 AM, Altera WO Team wrote: >> >>> Hi all, >>> >>> I'm having a strange issue on a WO installation on EC2 (oracle jvm). >>> Same strange application which had immortal sessions… >>> >>> Sometimes (quite rarely) a bounced application (put in refuse new sessions) >>> never quits and it's not accessible from JavaMonitor. >>> If I look at the logs i see: >>> >>> Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >>> : refusing new clients and below min active >>> session threshold >>> Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >>> : about to terminate... >>> >>> The only thing left is to kill the instance… Which is not nice. >>> >>> I'm not overriding the terminate() method in Application. >>> >>> I am attaching a stack trace if it helps. >>> >>> >>> Thanks, >>> >>> >>> >>> Matteo Centro >>> __
Re: Immortal… ehm, frozen instances.
Thanks Chuck, no OutOfMemory errors (at least in the log) and no override of sleep() but we do override terminate() @Override public void terminate() { log.info("TERMINATE " + sessionID()); ec().lock(); try { if (cart != null && shouldDeleteCart) { log.debug("Deleting cart " + sessionID()); int saveCounter = 0; do { if (cart.cleanAll()) { ec().deleteObject(cart); } saveCounter++; } while (!save() && saveCounter <= Application.SAVE_ATTEMPTS); } } catch (Exception e) { e.printStackTrace(); } ec().unlock(); log.info("Terminating session with ID:" + sessionID()); super.terminate(); } ec() simply returns defaultEditingContext() (it's an ERXSession subclass) and save() is this: public boolean save() { boolean hasSaved = false; EOEditingContext editingContext = ec(); try { editingContext.saveChanges(); hasSaved = true; //Thrown for each eo that fails to save. } catch (EOGeneralAdaptorException saveException) { log.error("/*** OPTIMISTIC LOCKING FAILURE ***/ "+sessionID()); log.error(saveException.getMessage()); editingContext.revert(); } return hasSaved; } This method makes me nervous, I don't trust it very much… Also I'm not sure about the explicit lock and unlock in the terminate method but since it's not in a R-R loop it might make sense to explicitly lock the ec, or not? Matteo On 19/mar/2013, at 18:51, Chuck Hill wrote: > Hi Matteo, > > You have one or more Zombie (aka Immortal) Sessions, as shown by stack traces > like this: > "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() > [0x7f16f7cfa000] > java.lang.Thread.State: WAITING (on object monitor) > at java.lang.Object.wait(Native Method) > - waiting on <0xd120b328> (a > com.webobjects.appserver.WOSessionStore$TimeoutEntry) > at java.lang.Object.wait(Object.java:485) > at > com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) > - locked <0xd120b328> (a > com.webobjects.appserver.WOSessionStore$TimeoutEntry) > at > com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) > at > er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) > at > er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) > at er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) > at com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) > at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) > > > This likely has one of two causes: > 1. The application is getting OutOfMemory errors, which can leave the session > store in an insane state > 2. The app is throwing an exception from sleep() in Session. If you > overrride sleep() it should use a try...finally block > > public void sleep() { > try { > // Your code here! > } finally { > super.sleep(); > } > } > > > Chuck > > > > On 2013-03-19, at 9:38 AM, Altera WO Team wrote: > >> Hi all, >> >> I'm having a strange issue on a WO installation on EC2 (oracle jvm). >> Same strange application which had immortal sessions… >> >> Sometimes (quite rarely) a bounced application (put in refuse new sessions) >> never quits and it's not accessible from JavaMonitor. >> If I look at the logs i see: >> >> Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >> : refusing new clients and below min active >> session threshold >> Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - >> : about to terminate... >> >> The only thing left is to kill the instance… Which is not nice. >> >> I'm not overriding the terminate() method in Application. >> >> I am attaching a stack trace if it helps. >> >> >> Thanks, >> >> >> >> Matteo Centro >> ___ >> 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: >> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >> >> This email sent t
Re: Immortal… ehm, frozen instances.
Hi Matteo, You have one or more Zombie (aka Immortal) Sessions, as shown by stack traces like this: "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() [0x7f16f7cfa000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0xd120b328> (a com.webobjects.appserver.WOSessionStore$TimeoutEntry) at java.lang.Object.wait(Object.java:485) at com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) - locked <0xd120b328> (a com.webobjects.appserver.WOSessionStore$TimeoutEntry) at com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) at er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) at er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) at com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) This likely has one of two causes: 1. The application is getting OutOfMemory errors, which can leave the session store in an insane state 2. The app is throwing an exception from sleep() in Session. If you overrride sleep() it should use a try...finally block public void sleep() { try { // Your code here! } finally { super.sleep(); } } Chuck On 2013-03-19, at 9:38 AM, Altera WO Team wrote: > Hi all, > > I'm having a strange issue on a WO installation on EC2 (oracle jvm). > Same strange application which had immortal sessions… > > Sometimes (quite rarely) a bounced application (put in refuse new sessions) > never quits and it's not accessible from JavaMonitor. > If I look at the logs i see: > > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - > : refusing new clients and below min active > session threshold > Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - > : about to terminate... > > The only thing left is to kill the instance… Which is not nice. > > I'm not overriding the terminate() method in Application. > > I am attaching a stack trace if it helps. > > > Thanks, > > > > Matteo Centro > ___ > 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: > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > This email sent to ch...@global-village.net -- Chuck Hill Executive Managing Partner, VP Development and Technical Services 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/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Immortal… ehm, frozen instances.
Hi all, I'm having a strange issue on a WO installation on EC2 (oracle jvm). Same strange application which had immortal sessions… Sometimes (quite rarely) a bounced application (put in refuse new sessions) never quits and it's not accessible from JavaMonitor. If I look at the logs i see: Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - : refusing new clients and below min active session threshold Mar 19 12:38:52 B2C[2002] (ERXNSLogLog4jBridge.java:44) WARN NSLog - : about to terminate... The only thing left is to kill the instance… Which is not nice. I'm not overriding the terminate() method in Application. I am attaching a stack trace if it helps. Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.7-b02 mixed mode): "Attach Listener" daemon prio=10 tid=0x41543800 nid=0x17fd runnable [0x] java.lang.Thread.State: RUNNABLE "Thread-21" prio=10 tid=0x7f16f8784000 nid=0x1151 waiting on condition [0x7f16f75f4000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at com.webobjects.appserver._private.WOClassicAdaptor.unregisterForEvents(WOClassicAdaptor.java:290) - locked <0xd043a8e0> (a com.webobjects.appserver._private.WODefaultAdaptor) at com.webobjects.appserver.WOApplication$1.run(WOApplication.java:1258) at java.lang.Thread.run(Thread.java:662) "Timer-0" daemon prio=10 tid=0x41e93800 nid=0x1150 in Object.wait() [0x7f16f77f6000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0xc5c898b0> (a java.util.TaskQueue) at java.lang.Object.wait(Object.java:485) at java.util.TimerThread.mainLoop(Timer.java:483) - locked <0xc5c898b0> (a java.util.TaskQueue) at java.util.TimerThread.run(Timer.java:462) "ERMailSender" prio=10 tid=0x41b41000 nid=0x1032 in Object.wait() [0x7f16f76f5000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0xd2ea49d0> (a er.javamail.ERQueue) at er.javamail.ERMailSender.run(ERMailSender.java:356) - locked <0xd2ea49d0> (a er.javamail.ERQueue) at java.lang.Thread.run(Thread.java:662) "WorkerThread11" prio=10 tid=0x41848800 nid=0x1010 in Object.wait() [0x7f16f7cfa000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0xd120b328> (a com.webobjects.appserver.WOSessionStore$TimeoutEntry) at java.lang.Object.wait(Object.java:485) at com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:191) - locked <0xd120b328> (a com.webobjects.appserver.WOSessionStore$TimeoutEntry) at com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1913) at er.extensions.appserver.ERXApplication.restoreSessionWithID(ERXApplication.java:2403) at er.extensions.appserver.ERXWOContext.existingSession(ERXWOContext.java:57) at er.extensions.appserver.ERXWOContext.hasSession(ERXWOContext.java:69) at com.webobjects.appserver.WOAction.existingSession(WOAction.java:190) at com.tla.calendar.DirectAction.goToAction(DirectAction.java:454) at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.webobjects.appserver.WODirectAction.performActionNamed(WODirectAction.java:144) at er.extensions.appserver.ERXDirectAction.performActionNamed(ERXDirectAction.java:418) at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:259) at com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:161) at er.extensions.appserver.ERXDirectActionRequestHandler.handleRequest(ERXDirectActionRequestHandler.java:128) at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687) at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2109) at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:2074) at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144) at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226) at java.lang.Thread.run(Thread.java:662) "WorkerThread9" prio=10 tid=0x41c22000 nid=0x100e in Object.wait() [0x7f16f7efc000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0xd120b328> (a com.webobjects.a
Re: Conditional around opening part of another component only?
Ok, you are right, push towards code when the html gets convoluted, thanks. On 19 Mar 2013, at 11:59, Johann Werner wrote: > Hi John, > > a good phrase someone wrote on this list long ago was: if something is > complicated to do in WO you are doing it wrong > > So to your problem: your hyperlinks are differing in one or more attributes > so why not moving those attributes to your code and returning the appropriate > value there instead of making complicated HTML spaghetti ;-) > > > ... bunch of html that applies to both the above conditions > > > > in code: > > public String myConditionalHref() { > return condition ? value1 : value2; > } > > > Am 19.03.2013 um 12:35 schrieb John Pollard : > >> Is there any way to conditionally determine the opening html for a component >> only, not the whole thing?: >> >> >> >> >> >> >> >> ... bunch of html that applies to both the above conditions >> >> >> Trying it, I can't, I am told that the at the top >> is missing its closing tag, so presumably it has to be complete within the >> if clause. >> >> My only solution seems to be to take the " ... bunch of html that applies >> to both the above conditions" and put it into a different component, but >> that is a pain because that html invokes many methods from this component. >> >> It feels like it would be nice to turn chunks of html into local >> html-only-components, that are part of the same WOComponent, but can be >> referenced more than once. >> >> Thanks >> John > > ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Conditional around opening part of another component only?
Hi John, a good phrase someone wrote on this list long ago was: if something is complicated to do in WO you are doing it wrong So to your problem: your hyperlinks are differing in one or more attributes so why not moving those attributes to your code and returning the appropriate value there instead of making complicated HTML spaghetti ;-) ... bunch of html that applies to both the above conditions in code: public String myConditionalHref() { return condition ? value1 : value2; } Am 19.03.2013 um 12:35 schrieb John Pollard : > Is there any way to conditionally determine the opening html for a component > only, not the whole thing?: > > > > > > > > ... bunch of html that applies to both the above conditions > > > Trying it, I can't, I am told that the at the top > is missing its closing tag, so presumably it has to be complete within the if > clause. > > My only solution seems to be to take the " ... bunch of html that applies to > both the above conditions" and put it into a different component, but that is > a pain because that html invokes many methods from this component. > > It feels like it would be nice to turn chunks of html into local > html-only-components, that are part of the same WOComponent, but can be > referenced more than once. > > Thanks > John ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Conditional around opening part of another component only?
Is there any way to conditionally determine the opening html for a component only, not the whole thing?: ... bunch of html that applies to both the above conditions Trying it, I can't, I am told that the at the top is missing its closing tag, so presumably it has to be complete within the if clause. My only solution seems to be to take the " ... bunch of html that applies to both the above conditions" and put it into a different component, but that is a pain because that html invokes many methods from this component. It feels like it would be nice to turn chunks of html into local html-only-components, that are part of the same WOComponent, but can be referenced more than once. Thanks John ___ 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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com