[jboss-user] [JBoss Seam] - Re: EntityHome validation error (Chapter 14 example)

2007-04-27 Thread cja987
Seam's power is such that you're able to directly expose EntityHome objects in the view and use pages.xml to wire it all together, and even provide security. However, if you prefer to do things in code, just think of EntityHome as an implementation of the "Generic DAO" pattern that plays nice w

[jboss-user] [JBoss Seam] - Re: COMPOUNDs, ATOMs & MOLECULEs - don't try this at home!

2007-03-27 Thread cja987
This is not a good way to get people to write your program for you. Anyway, seam-gen will generate almost all this for you. If you find seam-gen isn't sufficient for the purpose, consider filing a feature request instead of some challenge (which in my inbox looked a whole lot like spam) Vi

[jboss-user] [JBoss Seam] - Re: s:layoutForm

2007-03-15 Thread cja987
I don't typically use a star for required fields, but a distinct background behind the form field and label. Would it be possible to use "(before|after)RequiredField" and "aroundRequiredField", the way it's done for errors? View the original post : http://www.jboss.com/index.html?module=bb

[jboss-user] [JBoss Seam] - Re: Problem looking up EJB session bean (Name not bound)

2007-03-09 Thread cja987
Egads, nevermind ... I'd forgotten about the overloaded forms of @Local/@Remote. At any rate, you still need to ask on an EJB3 forum, or you'll get misinformation like what you just got from me. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026751#40267

[jboss-user] [JBoss Seam] - Re: Problem looking up EJB session bean (Name not bound)

2007-03-09 Thread cja987
You need to read the EJB documentation. The JBoss EJB3 trailblazers are quite nice. @Local and @Remote belong on your interface, not your implementation. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026746#4026746 Reply to the post : http://www.jboss.co

[jboss-user] [JBoss Seam] - Re: Using EntityHome with multiple Entities

2007-03-09 Thread cja987
Both EntityHome instances should use the same conversation-scoped EntityManager (a component named "entityManager" by default), so they'll guaranteed participate in the same JTA transaction. No need to do any extra "synchronizing". View the original post : http://www.jboss.com/index.html?mo

[jboss-user] [JBoss Seam] - Re: Using EntityHome with multiple Entities

2007-03-09 Thread cja987
If they really are unrelated, why not just use two EntityHome instances? If they are actually related somehow, you can express the relation in JPA/Hibernate terms as @OneToOne (or whatever your relation is) and get at one object through the other -- no entityhome required. @EntityHome seems t

[jboss-user] [JBoss Seam] - Re: How to add two entities home in the same page?

2007-03-08 Thread cja987
You could make personHome inject the current phone, then have personHome.persist() call getInstance().phones.add(phone) However, that wires the policy a little too low level for my tastes. I personally recommend an EditPersonAction (or whatever you want to call it) to back your edit page that

[jboss-user] [JBoss Seam] - Re: manual flushing and state from database

2007-03-08 Thread cja987
Versioning and optimistic locking is also immune to the inevitable race condition of checking for changes before a commit. It does throw an exception though, which makes recovery like offering a "merge" screen somewhat complicated. Sometimes you still might want to peek outside the current tra

[jboss-user] [JBoss Seam] - Re: Rollback exceptions without ending the conversation

2007-03-07 Thread cja987
Propagation won't recreate the conversation, and your conversation is still active if you didn't end it yourself. However, your entityManager is toast, so you need a new one, and that's usually done with a new conversation. It should be possible to recreate the entityManager within the current

[jboss-user] [JBoss Seam] - Re: DataModel, Factory and Stale Data

2007-03-07 Thread cja987
Of course you're getting stale data -- you're using SESSION scope and an extended persistence context that never changes during the bean's lifetime. Same PC, same isolated view of the database for the whole session. Seam certainly doesn't discourage using Stateful Session Beans, it discourages

[jboss-user] [JBoss Seam] - Re: Hot redeployment

2007-03-07 Thread cja987
"[EMAIL PROTECTED]" wrote : I've just committed a new feature to CVS that lets code changes made to Seam JavaBean components be visible immediately without a container restart. Mmmm yeah, take that tapestry 5. I think I'm going to have to migrate away from EJB's sooner rather than later to tak

[jboss-user] [JBoss Seam] - Re: static checking of components?

2007-03-07 Thread cja987
Done, JBSEAM-1002. I just got to thinking that it would be neat if ComponentScanner and NamespaceScanner were themselves components that could be overridden. That way it'd be simple for anyone to add their own app-specific validation logic. Does make for a bit of a bootstrap problem, I'll adm

[jboss-user] [JBoss Seam] - static checking of components?

2007-03-06 Thread cja987
It's nice that there's more than one way to create and name components in seam, but it certainly takes some discipline on the part of the programmer to organize them thoughtfully, and minor slips in naming result in null values getting injected. This is easy to catch when not using required=fal

[jboss-user] [JBoss Seam] - Re: I find no answers!

2007-03-05 Thread cja987
A lot of this depends on your specific application: if the set of tasks is a fixed "wizard" workflow, then you can probably get by with conversations alone (using manual flush mode if it involves editing "live" entities). If your tasks themselves are varying or defined by complex business logic

[jboss-user] [JBoss Seam] - Re: system requirements for jboss seam

2007-02-28 Thread cja987
Why not just try it and see? And yes, I would recommend using Tomcat. It's possible to slim down JBoss quite a bit, but it does have a good size out of the box footprint in the profile that's required for Seam. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=

[jboss-user] [JBoss Seam] - Re: Seam in production mode

2007-02-26 Thread cja987
My version of "production" varies quite a bit from that of an e-commerce site, and that itself is quite different than what a bank might expect. At any rate, Seam performs about as well as your JSF and EJB implementations. The overhead of Seam itself is pretty miniscule compared to the (large)

[jboss-user] [JBoss Seam] - Re: How are you handling login / registration redirects?

2007-02-02 Thread cja987
Okay, subtract me from the people using @LoggedIn -- it's simply evil, and it seems to interfere with bijection and @Create methods. Until I devote some time to reading up on Seam Security, I've literally hardcoded the login check into every method that would use it (which is actually not many

[jboss-user] [JBoss Seam] - Re: How are you handling login / registration redirects?

2007-01-26 Thread cja987
I've been using @LoggedIn. It's a hack, but if it's good enough for the booking example, it's good enough for my simple CRUD app. I tweaked it a bit to return a "nologin" result in order to redirect to the login page when users attempt an action that requires a login. I'd love to know how to

[jboss-user] [JBoss Seam] - Re: EntityHome silently discards updates after errors

2006-11-01 Thread cja987
I'm a dunderhead -- not that this is a big surprise to anyone. It had nothing to do with transaction isolation levels, and everything to do with needing to set flushMode=MANUAL when beginning the conversation. Once I did that, everything works as expected, and entities aren't flushed until I a

[jboss-user] [JBoss Seam] - Re: EntityHome silently discards updates after errors

2006-11-01 Thread cja987
I still can't explain the mysterious breakage that started when using another entityManager, but it went away when I switched from a javabean to a SFSB, something I was going to do eventually anyway. I was still seeing dirty data, but I found it was the database I was using -- it looks like HSQ

[jboss-user] [JBoss Seam] - Re: EntityHome silently discards updates after errors

2006-11-01 Thread cja987
Actually it looks like simply using another EntityManager anywhere in my action bean caused a completely _different_ component (ruleTypes) in the action bean to not be injected. Same result whether I injected it with @PersistenceContext or created it by hand with new EntityManagerFactory().crea

[jboss-user] [JBoss Seam] - Re: EntityHome silently discards updates after errors

2006-11-01 Thread cja987
I should probably clarify, the exception gets thrown the first time, but the second update appeared to succeed when in fact it silently dropped. I've done quite a bit of rearranging now, and haven't reproduced the problem. As for checking the unique constraint by hand before possibly violating

[jboss-user] [JBoss Seam] - EntityHome silently discards updates after errors

2006-10-31 Thread cja987
In the framework, I'm trying to enforce optimistic locking and a unique constraint on the "name" attribute. For optimistic locking, there's not a lot I can do except kick them out (they can always open a new window and use their back button to copy their changes and merge them in). For name co

[jboss-user] [JBoss Seam] - Re: conversation timeout

2006-10-26 Thread cja987
The conversation timeout controls how quickly open conversations expire -- it's the direct equivalent of session timeouts, but for conversations. It has nothing to do with server timeouts, which are specific to the webserver. I imagine for JBoss, it would be somewhere in the tomcat configurati

[jboss-user] [JBoss Seam] - Re: Context Questions

2006-10-23 Thread cja987
SFSBs and Entities are bound to the conversation context. SLSBs are, obviously, in the stateless scope. This is all covered in the Seam documentation. http://docs.jboss.com/seam/latest/reference/en/html/index.html View the original post : http://www.jboss.com/index.html?module=bb&op=viewto

[jboss-user] [JBoss Seam] - Re: Step-by-Step Seam Getting Started Guide

2006-10-23 Thread cja987
Calling WTP is a little bit flakey is like calling Ubuntu a little bit brown. I've actually given up on WTP's crummy "publish" mechanism and gone and written a shell script to jar up and deploy the ear by hand. And unlike WTP's mouse-only (afaict) interface for manual publish, I can just make

[jboss-user] [JBoss Seam] - Re: Role enforcement on a RESTful page

2006-10-23 Thread cja987
We do that all the time ;) Seriously, it does make it easier to google solutions for a problem when one talks themself through the solution publicly. chuck View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980168#3980168 Reply to the post : http://www.jboss.c

[jboss-user] [JBoss Seam] - Re: Does anyone use @Rollback?

2006-10-23 Thread cja987
I wasn't aware that it existed. The more control of UserTransaction that's possible, the better -- though I imagine anyone using UserTransaction is probably already controlling it through code and not declaratively, so injection would probably suffice. View the original post : http://www.jb

[jboss-user] [JBoss Seam] - s:commandLink missing from seam.taglib.xml

2006-10-23 Thread cja987
mpleteness. Is this omission intentional? chuck (still no luck getting my login recognized as chuckadams and not cja987) View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980160#3980160 Reply to the post : http://www.jboss.com/index.html?module=bb&

[jboss-user] [JBoss Seam] - Re: adding messages.properties breaks validation

2006-10-20 Thread cja987
I added the "messages" bundle to the bundle names list, and copied an existing messages.properties file from the examples. It's a workaround I can deal with for now, but not one I'm comfortable with -- I doubt I have all the messages available should I add new validators. I'm sort of puzzled

[jboss-user] [JBoss Seam] - adding messages.properties breaks validation

2006-10-20 Thread cja987
I'm working with my optimistic-locking contact manager example, and added a messages.properties to the root of my source file with just one message in it: | staleEditContact=Sorry, someone else has already updated this contact while you were working on it. | And now I get this as soon as

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
I was going by the description of page actions in the seam docs, section 3.1.1 anonymous wrote : | The page action method can return a JSF outcome. If the outcome is non-null, Seam will delegate to the defined JSF navigation rules and a different view may end up being rendered. | I took t

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
Aha, that did it, and I get ... yay, an HTTP 500 .. but the right error on the console. I guess dealing gracefully with the exception means catching it in update() and company. Figuring out how to present a UI to merge changes should be an interesting project. I can't see anything in @Begin's

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
Here you go: | 16:32:06,726 DEBUG [Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} | 16:32:06,726 DEBUG [AbstractSeamPhaseListener] beginning transaction prior to

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
It took much fighting with log4j.xml, but I got a debug log. The whole log is 1340 or so lines long, so I'll see what I can glean from it When I click "Edit Contact", I do see it creating a conversation: | 16:32:06,766 DEBUG [Manager] No stored conversation, or concurrent call to the stored

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
my log4j kung fu is poor, so I just added this to server/default/conf/log4j.xml and restarted, to no avail. | | | | I have tried many other things as well, but I remain defeated. How do I enable debug logging? View the original post : http://www.jboss.com/index.html

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
"[EMAIL PROTECTED]" wrote : I bet you don't have the SeamRedirectFilter installed. It's definitely installed. | | Seam Redirect Filter | | org.jboss.seam.servlet.SeamRedirectFilter | | | | |

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
I had thought there would be some funniness with a conversation-scoped component starting its own conversation, so I moved beginEdit() to its own class (better design anyway) and edited pages.xml accordingly | @Name("contactAction") | public class ContactAction { | | @Logger |

[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
I'm probably doing this completely wrong... I took contactHome out of components.xml and replaced it with this class: | @Name("contactHome") | @Scope(ScopeType.CONVERSATION) | public class ContactHome extends EntityHome { | | @Logger | private Log log; | | publi

[jboss-user] [JBoss Seam] - Re: problem in a simple seam application

2006-10-19 Thread cja987
The "war" target in seam's build.xml used by the examples does some filterset tweaking for the jndiPattern and to turn the embedded ejb off, and so on. So while your sources are the same, if you use a different build process then you won't get the same results. Just tweak your components.prope

[jboss-user] [JBoss Seam] - how can I do optimistic locking with crud framework?

2006-10-19 Thread cja987
Newbie question alert... I'm working with the contactlist sample app (works fine now that I'm back to using myfaces) and I want to prevent lost updates. I added a version field to Contact, gave it a @Version annotation, and a getter/setter pair, and it seems to get updated by Hibernate as expec

[jboss-user] [JBoss Seam] - Re: contactlist example not working on jboss with JSF 1.2 RI

2006-10-18 Thread cja987
PEBKAC again, I forgot to update the views themselves. Still, the problems aren't over: when I edit a contact and click update, it switches immediately to the create screen and offers me "Create Contact" instead (which does actually work). Deleting a contact blanks all the fields, but doesn't

[jboss-user] [JBoss Seam] - Re: contactlist example not working on jboss with JSF 1.2 RI

2006-10-18 Thread cja987
Okay, I switched all the .xhtml extensions in pages.xml to .seam, and now viewContact works, but editContact continues to give me a blank contact. Delete Contact is also nonfunctional, and results in this on the console: WARNING: phase(RENDER_RESPONSE 6,[EMAIL PROTECTED]) threw exception: java

[jboss-user] [JBoss Seam] - Re: contactlist example not working on jboss with JSF 1.2 RI

2006-10-18 Thread cja987
Heh, all that typing and I could have waited a few more minutes instead. I'll try using the .seam view ids and see how that works. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979189#3979189 Reply to the post : http://www.jboss.com/index.html?module=b

[jboss-user] [JBoss Seam] - Re: contactlist example not working on jboss with JSF 1.2 RI

2006-10-18 Thread cja987
Positive. In fact I forgot to set it back to true when I tried it with myFaces, and it still worked. If the contactlist example works out of the box with the 1.2RI, then perhaps I'm configuring it wrong in jboss. Here's what I did to run it: * cvs checkout and build seam * delete myfaces*

[jboss-user] [JBoss Seam] - contactlist example not working on jboss with JSF 1.2 RI

2006-10-18 Thread cja987
I can't get the contactlist example working with the 1.2 RI -- when I try to edit or view a contact, I get a blank contact instead. I wonder whether some of my other hear-tearing experiences getting CRUD working by hand is related to the same problem. I opened up JBSEAM-427 in JIRA on this, bu

[jboss-user] [JBoss Seam] - Re: Seam with Jbpm - Operation not allowed.

2006-10-06 Thread cja987
I am also having the same problem when using the RI with Seam CVS. This occurred with my own app and with the booking example. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976653#3976653 Reply to the post : http://www.jboss.com/index.html?module=bb&op=po

[jboss-user] [JBoss Seam] - Re: Extending page context to the next page, and so on.

2006-10-05 Thread cja987
This sounds to me a lot like the "Flash" scope of RoR and family. Though conversations don't look very heavyweight to me, a flash scope could be nice in order to remove any need to use that "conversationId" (or cid as it is in cvs) parameter. That segues to a minor gripe of mine, namely the co

[jboss-user] [JBoss Seam] - Mac line endings in examples

2006-10-03 Thread cja987
Many of the examples are using bare CR's for line endings, which makes many editors (such as vi and emacs) quite unhappy. I imagine they're checked into CVS as binary, when they should be text. CVS will translate line endings appropriately if they're checked in as text. The list of files th

[jboss-user] [JBoss Seam] - Re: ejb-jar.xml must either obey the right xml schema or def

2006-10-03 Thread cja987
Just out of curiousity, does the JBoss installed with the NetBeans+JBoss bundle have a configuration that's usable with Seam? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975833#3975833 Reply to the post : http://www.jboss.com/index.html?module=bb&op=post