Sounds fair enough.
Contexts.removeFromAllContexts() should do the trick.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4052710#4052710
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4052710
You cannot use a session scoped component from within the @Create method of an
application scoped component that has @Startup. If you think about it your
create method is getting run as soon as the web application starts up. At
this point there will never be an active session scope. The
Questions:
1) hibernate-all.jar should have all the hibernate + JPA classes/annotations.
You'll also need the core Seam jars, jsf jars, facelets jars and any other seam
dependencies. Which of these are required depends on the features of seam you
use. When in doubt include everything in the
| @Name( xxx )
| @Scope( ScopeType.APPLICATION )
| @Startup
| public class MyClass
| {
|@Create
|public void create()
|{
|// init stuff here
|}
| }
|
The key things are:
@Startup is only valid with application and session, in your case you want
There's a general rule (in the docs somewhere I think) that you should never do
component bindings into a scope that lasts longer than a single request. This
has been known to cause all sorts of issues in the past.
The preferred solution is to bind your components into an event scoped
For dynamic components I use a component that builds it's tree in
encodeBegin(). So for your example consult the relevant attributes and create
the corresponding JSF component for list/menu/checkbox/radio/text.
I've used this succesfully to build grids of dynamic properties where the type
of
s:button and s:link do not submit the form.
h:commandButton (I don't believe) accepts parameters like
s:conversationPropogation.
If you want this effect I would suggest annotating createOffer with @Begin.
Cheers.
Mike.
View the original post :
In your example this
| public void MySchedule()
|
Is wrong. That's not a constructor it's a method. Remove the void.
You can use the constructor method but a better way is to use the @Create
annotation instead.
| @Entity
| @Name(mySchedule)
| @Table(name=my_schedule)
|
Hi all,
I have some code like this (pseduo)
| MyConversationComponent comp = MyConversationComponent.instance()
| comp.setValue( xxx )
|
| Redirect redirect = Redirect.instance()
| redirect.setViewId( xxx )
| redirect.setConvProp( true )
| redirect.execute()
|
Now after the
Thanks for the reply.
I solved my problem/mystery (predicatably my fault). The code in question is
being called from outside the phase listeners, in a custom Lifecycle
implementation to be precise so the Seam Lifecycle.endRequest() never gets
called to flush out the conversation context.
Assuming Parent and Child entities where Child has a reference to parent.
| h:selectOneMenu value=#{child.parent}
| s:selectItems value=#{allParents} var=parent
label=#{parent.display}/
| /h:selectOneMenu
|
Tweak names as necessary. You'll need some converter in conjunction with
To me using conversation scope for a stateless bean sounds wrong. If your
component has no state then it may as well be in the Seam stateless scope.
The @Out annotation will outject a component back into the relevant Seam
context. How long that outjected reference survives for is dependent on
Seam 1.1.6
Ajax4Jsf 1.1.0
JSF RI 1.2_02
Hi there,
I am getting an odd problem with Seam and Ajax4jsf. After each phase the
AjaxPhaseListener tries to access it's AjaxContext which it does by getting the
JSF application and trying to resolve a variable name.
In the restore view phase I get
Thanks, it's not causing any noticable problems apart from the warning so I'll
probably wait until the next official release.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4032017#4032017
Reply to the post :
@In can only be used inside declared seam components (ones with @Name or
explicit name in components.xml). You can't inject seam components into any
object, only other seam components.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4032083#4032083
Reply to
Application scope should be fine for the above examples if you do the initial
work in @Create and then just access it. Of course provided the data is the
same for all users.
Be aware of threading issues in application scope tho as multiple threads may
access it at the same time. If you do
The @ManyToMany definition on one of the sides is incorrect. For bidirectional
relationships one side must be the owner. The side using mappedBy is the
inverse side, which means it updating it does NOT update the relationship.
If this was generated it's probably a seam gen bug. To fix your
I can't see a bId property defined anywhere in the B entity? Or is it on BHome?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4031439#4031439
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031439
I've just had a similar problem. I have a value binding on a selectOneMenu to
a hibernate nested object. I use a converter to convert a hibernate entity to
class + id string and back again. During the rendering of the menu item the
JSF renderer tries to match the current selected value to
Hi there,
Does anyone have a method for displaying to the user that their session has
expired. I have a filter that redirects requests to the login page before the
user is logged in. If the session expires then the next request will redirect
to the login page. I would like to display an
Hi there,
I have a situation where I have several different configurations for my
hibernate sessions, mainly revolving around different interceptors and filters.
I also sometimes want the session to be event scoped and other times to be
conversation scoped.
At the moment I have something
I think bullet 6 applies only to long running conversations. Bullet 7 applies
to both (I believe even temporary conversations are propogated across
redirects).
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4024566#4024566
Reply to the post :
If you want to begin a conversation before the end of a method then you can do
it programmatically.
| Conversation.instance().begin()
|
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4022429#4022429
Reply to the post :
Should add in this case you need to remove the @Begin from the method. It's an
either-or thing.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4022430#4022430
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022430
Do you have a form around the commandButton and input field?
Note that s:link does NOT do a form submission so searchString won't be updated
in the model using s:link.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4021548#4021548
Reply to the post :
Fair point, I'm using Conversation.instance() now.
Cheers.
Mike.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4021130#4021130
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4021130
Hi there,
I have a question about the implementation of @Begin. At the moment the @Begin
is only done AFTER a bean method has completed it's invocation. Is there any
reason why it is done like this rather than beginning the conversation before
the method invocation. The only thing I could
To the first question
Seam serialises access to a conversation to stop concurrent requests (usually
AJAX) interfering which each other. The timeout is how long a request will
wait for the conversation to be unlocked by the conversation currently using
it. It the timeout expires the request
Pretty much spot on, as you say, @Out is only required if the object reference
may change and you want it updated in the relevant context after the action
method has completed.
If you just mutate (e.g. use a setter) an injected component you don't need to
outject it.
View the original post :
Raise a feature request against the documentation in JIRA if you think it could
be enhanced. Chances are if you weren't sure about it then a bunch of other
people aren't/weren't either!
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4018757#4018757
Reply to
There are quite a few things that are non-bug related that can cause eventual
OOM with permgen on a web container redeployment.
See more info here...
http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669
I suspect the one that will most likely bite Seam users is
Hi all,
Was going to put this in JIRA (will shortly) but I thought I'd float the idea
here first to kick it around a bit.
At the moment it is quite tricky and/or cumbersome to pass arbitrary values up
and down a nested conversation stack (@Begin(nested = true)) in a generic
manner.
In the
Forgot to add I have a VERY rough implementation of this which I will try out
next week. I can post if it would add some clarity.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4018317#4018317
Reply to the post :
This is because you have a component binding into a conversation scoped
component. The conversation context is only available AFTER the restore view
phase, but control bindings like this are executed in the restore view phase.
To work around this have a event scoped component that hold your ui
Your one should have application precedence (the default), the core one has the
lower built in precedence.
From the source
| @Name(org.jboss.seam.security.identity)
| @Scope(SESSION)
| @Install(precedence = BUILT_IN,
classDependencies=org.drools.WorkingMemory)
|
So if you define a
Writing an internal API. Yes.
When a method is final cglib does not proxy it so the Seam interceptors can't
hook in for that method call (other non-final methods work fine)? Yes.
In my case JSF action method calls a public API method for which there is a
base helper implementation
http://docs.jboss.com/seam/1.1.6.GA/reference/en/html/events.html
See the section on navigation.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4017604#4017604
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4017604
I'm not quite understanding the question.
The view-id in pages.xml does not have to be a real page, it can just be to
bind an action that is executed when that view is requested but then the action
can return an outcome which the page navigation uses to render a different page.
View the
Try..
| page view-id=/*
|
| navigation from-action=#{myBean.commonAction}
| rule
| redirect view-id=/results.xhtml/
| rule/
| /navigation-case
|
| /navigation-rule
|
Haven't tried this myself but I think this should work.
I believe both code samples are above are valid but they do different things.
The first will only do the re-direct if the action method returns not-null.
The second only if the method returns null. I'm not sure which of these the
void case falls into but I suspect the second one.
View the
Sorry I just spotted the closing /navigation-rule in my sample which is of
course wrong. I'd love to take the blame but I copy-pasted from the Seam docs
;)
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4017674#4017674
Reply to the post :
No it's not documented, I've added an item to JIRA for this to be added
somewhere.
ComponentBindings is just a POJO/Java Bean with Event scope. The component
will automatically be created during the Restore View for a postback request or
otherwise Render Response when the first binding is
Case 2 is usally handled by conversations timing out. So if the user navigates
away and doesn't come back (using the Back button) then the conversation will
eventually die and clean up it's state.
If the user navigates back to the page (not using the back button) then they
will not pick up
Check out page actions/parameters in the docs, chap 5.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4018090#4018090
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4018090
___
I don't have to have them protected in this instance but I'm using the
SingleItemScreenAction class here to make life easier for implementors so all
they have to define are some simple getters(). Making them protected means
they are only accessible to subclasses which is what I want.
Perhaps
Currently (1.1.6) it is possible to programmatically build the Page components
that are usually read from pages.xml by doing
| Pages.getPage( viewId )
|
with a viewId that doesn't have a pages.xml entry (it creates an empty page
with the viewId if one is already present from pages.xml
Excellent, thanks. A minor API change I can handle.
A minor followup. Would it be possible to add a way of overriding an existing
pages.xml definition for a view. At the moment the only entry point I could
see was getPage() which always returns the existing metadata. Maybe something
like
Hi there,
I'm trying to get Seam managed transactions working. I've read Chap8 and
looked at the hibernate example. I think I've done most of the configuration
but this last piece is tripping me up. I'm running with Tomcat 6 and Hibernate
3 (no J2EE container).
The stack trace I get is
Should add I'm looking for the simplest and most basic configuration possible
to get @Transactional working. I don't need XA or anything clever so maybe
I've over-configured somewhere and there's a much simpler setup.
Cheers.
View the original post :
The check for duplicate factory names was added in 1.1.6 so this may be showing
up an existing problem in your configuration. Check your app code for
@Factory( actor ) and component.xml for the same.
Cheers.
View the original post :
I found Chapter 19 with the Tomcat packaging structure described. Ignore this
unless I get stuck again :)
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4016493#4016493
Reply to the post :
Hi all,
If I have a protected method in some circumstances on a Seam component I get an
error when the method is called via a cglib proxy.
I get this exception thrown out of the cglib MethodProxy class.
| throw new IllegalArgumentException(Protected method:
+ sig1);
|
Hi there,
I am building a mini-framework using Seam to allow our developers to build
search and detail pages easily. Screen page is basically search parameters +
grid and the detail is just input fields with OK/Cancel. The important thing
is the basis of the Search and Detail components be
I have a search page where I want to isolate two instances of the search screen
from each other so the user can have two tabs open on the same page and be
searching for different things. I store a fair amount of state (pagination,
grid model etc) so the conversation scope made sense for this.
I think you've kinda got it a bit backward. Basically Seam has a big map of
components that are available. These components are defined either in
components.xml with or more usually with the @Name annotation.
For accessing pure components these are the only names that are available for
you
Thanks for looking into this.
Adding @Startup makes the initial
| java.lang.IllegalStateException: SessionFactory not found
|
Error stop happening. Instead I immediatly get the
| java.lang.ClassCastException:
com.azure.spark.web.seam.component.ReferenceSessionFactory
|
on the
OK found the following so far. Think I've got to the bottom of the
ClassCastException tho I'm still not sure whether
The @Startup annotation means that the Component.newInstance() gets called at
the end of the seam initialisation which creates a mapping of
referenceSessionFactory - Component(
Bit of my post got lost there. First line should read...
OK found the following so far. Think I've got to the bottom of the
ClassCastException tho I'm still not sure whether it's a configuration problem
or a bug.
... ctd
View the original post :
That's fixed it thanks! A case of RTFM (more carefully). I saw it commented
out in the Seam faces-config.xml but assumed it was an old piece of code.
Would it break anything else to enable this by default as I'm probably not the
only one who will trip up on this?
Thanks again for your time.
I would like to add an interceptor that will appear in the interception stack
of all of the Seam components in my application without having to configure it
against each component.
Is there a configuration option that will allow me to do this. I've found the
ejb-jar.xml that looks right but
Using Seam 1.1.0.GA
I have a simple Seam component which is just for injecting a singleton session
factory and a ManagedHibernateSession that uses it. (I'm aware of the
HibernateSessionFactory component but I think this problem is more general).
First the session factory wrapper component.
ask4saif wrote :
| how can i restrict users from unauthorized access of pages.
|
Probably use a servlet filter for your web application. The filter intercepts
all requests to the URLs it is mapped to. If you place something in the
session context when a login is succesful the filter can
Probably need to post your code but my best guess is the logged in
information/marker is not available to the second window. If you are using a
conversation scope this is likely. Using the session scope this may be
possible as well depending on if a new window creates a different server side
I think I'm correct in saying that currently you cannot have a conversation
scoped component that has UIComponent bindings.
e.g. of a minimal example
Facelet view
| !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
| html
Thanks for the replies guys.
Pete, I'll look into doing my logic inside a tag handler, I hadn't thought of
doing it that way. I have a template with a grid panel and a ui:define inside.
The define will insert things like input fields and combos. I then use some
convention rules based of the
I think this means you can't have a conversation scoped component with UI
component bindings. At the moment the setters for any binding= get called
during the restore view phase at which point the conversation scope is not
valid.
Is there any way round this or plans to address this in the
I'll check the debug handler exception when I download the 1.1 release shortly.
Cheers.
Mike.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3994228#3994228
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3994228
Missing one or more of the Seam library dependencies in your Tomcat deploy.
Make sure all the jars in the Seam lib directory are getting deployed with your
web applications.
Cheers.
Mike.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3994260#3994260
Reply
You'll probably chase your tail for a while here. If you don't want to put all
the jars into the deploy you'll probably need to deactivate some of the seam
built in components.
For example the one you are having trouble with now is the remoting component
which you can deactivate like this
Found an interesting and vaguely irritating problem when debugging my Seam
application.
My debugger (IDEA) in certain modes will execute toString() on all local/class
variables that are visible at a breakpoint for display information. For a Seam
component that has interception enabled this
I have a search component which is event scoped. Itself it just has four
properties which are bound to four input fields in my JSF page.
It extends a generic search component which has a hibernate session which is
injected by the @In( create = true ) from the ManagedHibernateSession
Done some more investigation into this. I have a minimal test case.
JSF page
| ?xml version=1.0 encoding=UTF-8?
| !DOCTYPE html
| PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
| http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
| html
Found the @Intercept annotation which I can apply to my search bean.
Setting this...
| @Name( elementSearchAction )
| @Scope( ScopeType.EVENT )
| @Intercept( InterceptionType.AFTER_RESTORE_VIEW )
| public class ElementSearchAction
| {
|...
|
Stops all interception during the
In this function in Component
private Object getInstanceToInject(In in, String name, Object bean, boolean
enforceRequired)
The if condition at the bottom evals to true
| if ( result==null enforceRequired in.required() )
| {
| throw new RequiredException(
|
Appreciate all the hard work.
Congrats.
Mike.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3993462#3993462
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3993462
___
jboss-user
http://jira.jboss.com/jira/browse/JBSEAM-581
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3992992#3992992
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3992992
___
jboss-user
Ok thanks. I've played around more and got a bit further but I think I'm in to
work-around territory rather than fixing the problem properly.
Here is my current components.xml
| ?xml version=1.0 encoding=UTF-8?
| components xmlns=http://jboss.com/products/seam/components;
|
I have tracked it down, user error of course.
I was missing the javaassist jar file so it was barfing in the ComponentScanner
when it looks at all the class files in the seam jar for the @name annotation.
At the moment the exception is caught and the error logged at debug level.
Could this be
Config:
Tomcat 6.0.0
JSF RI 1.2
Facelets 1.1.11
Hibernate 3.2.1
Seam 1.1.0 CR2
I have just downloaded CR2 and been trying to get a hibernate session
auto-managed by Seam.
I've got everything starting up ok in the Tomcat server but when I hit my test
page I get the following.
|
Cheers for the quick reply.
My components.xml
| components
|
| component name=referenceSession
| class=org.jboss.seam.core.ManagedHibernateSession/
|
| component name=hibernateSessionFactory
| class=org.jboss.seam.core.HibernateSessionFactory/
|
|
80 matches
Mail list logo