[JBoss Seam] - @EJB annotation support in seam
by berkum
Hello.
I would like to know if it is possible to use the @EJB annotation with seam in order to inject ejbs. I have tried with the examples to replace the @In annotations with @EJB thinking they were quite the same but I am getting the following error when starting the server ( I replaced @In on user attribute in RegistrationAction of registration project). Anyone did it ?
Thanks
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:ear=Registration.ear,jar=RegistrationEJB.jar,name=RegisterAction,service=EJB3
State: FAILED
Reason: java.lang.RuntimeException: could not resolve global JNDI name for @EJB for container RegisterAction: reference class: org.jboss.seam.example.registration.User ejbLink: not used by any EJBs
I Depend On:
persistence.units:ear=Registration.ear,jar=RegistrationEJB.jar,unitName=pocDatabase
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006614#4006614
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006614
19 years, 2 months
[JBoss Seam] - h:commandButton and h:commandLink don't delegate conversatio
by svadu
Hi All,
I have the following problem. I have a conversation scoped bean:
| @Name("regionAction")
| @Scope(ScopeType.CONVERSATION)
| public class RegionAction implements Serializable {
|
| ...
|
| @In(required=false) @Out(required=false)
| private Generalarticle selectedArticle;
|
| /**
| * Current Region bean
| */
| @Out(required=false)
| @In(required=false)
| @DataModelSelection
| private RegionBean region;
|
| @DataModel
| private List<RegionBean> allRegions;
|
| @Factory("allRegions")
| @Begin(join=true)
| public void loadAllRegions() {
| m_logger.trace("Loading all regions");
| this.allRegions = em.createQuery("from RegionBean as r")
| .getResultList();
| }
|
| @Begin(join=true)
| public String selectRegion(RegionBean aRegion) {
| this.region = aRegion;
| m_logger.debug("Current region is set to " + region);
| return RESULT_SHOW_REGION;
| }
|
| public String submitEditGisArticle() {
| if ( null != this.region ) {
| if ( this.region.getGisArticle() == null) {
| this.selectedArticle = createGisArticle(region);
| } else if ( region.getGisArticle() != null ) {
| this.selectedArticle = this.region.getGisArticle();
| }
| } else {
| FacesMessages.instance().add("Region is not selected!");
| }
| m_logger.trace("submitEditGisArticle with #{selectedArticle} = #0", this.selectedArticle);
| return RESULT_EDIT_ARTICLE;
| }
| }
|
>From my understanding conversation begins with the factory method (which also seems to be backed up by logs)
And I have the start page with the following:
<s:link id="editLnk" value="#{message['edit']}"
| action="#{regionAction.submitEditGisArticle}" styleClass="texttoolbar" />
In this case the result of regionAction.submitEditGisArticle leads me to the next page with the following:
| <h:form id="editForm">
| <h:inputText id="title" value="#{selectedArticle.title}" required="true"></h:inputText>
| <h:inputTextarea id="mainTextId" value="#{selectedArticle.text}" />
| <s:button id="submitBtn" value="save" action="success"></s:button>
| </h:form>
| <h:messages />
|
Now, this works fine (I get both region and selectedArticle carried across the conversation). But as soon as I replace s:link on the first page with the h:commandButton (I tried h:commandLInk as well) like this:
<h:form id="edtRgnArt">
| <h:commandButton value="#{message['edit']}" action="#{regionAction.submitEditGisArticle}" />
| </h:form>
|
Then logs, debugging and h:messages show that region is null inside submitEditGisArticle
Can anybody help with an advise what the problem might be?
I use myfaces(tried 1.1.4 and 1.1.5)+facelets(tried 1.1.11 and 1.1.12)+ajax4jsf(tried 1.0.5 and 1.0.6)+seam(tried 1.1.0 and 1.1.0) in all cases with the same result - the region bean is null.
Although the bean is null I still see this bean in a conversation context via debugger.xhtml:
Conversation Context (2)
| allRegions
| em
| org.jboss.seam.core.conversation
| org.jboss.seam.core.facesMessages
| org.jboss.seam.core.persistenceContexts
| region
| regionAction
Any help is appreciated!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006610#4006610
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006610
19 years, 2 months
[JBoss Seam] - Re: OptimisticLockException
by lightbulb432
In the log, the OptimisticLockException (OLE) shows up somewhere between the following two statements:
[SeamPhaseListener] after phase: INVOKE_APPLICATION(5)
| #Several other statements here
| #The exception stack traces followed immediately by the next line:
| [SeamPhaseListener] before phase: RENDER_RESPONSE(6)
Also, the OLE is caused by a org.hibernate.StaleObjectStateException. The OLE causes org.jboss.tm.JBossRollbackException which then causes java.lang.IllegalStateException. I try catching all of them in exceptions.xml, but none of them work!
<exceptions>
| <exception class="org.hibernate.StaleObjectStateException">
| <redirect>optimistic lock exception</redirect>
| </exception>
| </exceptions>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006608#4006608
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006608
19 years, 2 months
[Installation, Configuration & Deployment] - Re: Deploy change to property file
by lightbulb432
That makes sense, thanks.
Does it ever make sense to deploy an exploded archive? I've noticed that in the Ant build, as it copies the folder over, the JBoss console starts to show different parts of the application deploying in bursts and before the Ant build has completed. Is this expected behavior? (Should there be console output before the Ant build completes? This never happens with packaged archives...)
Is the only reliable way to deploy to JBoss through packaged archives? Or can exploded archives work reliably?
What's recommended for production use?
If exploded archives aren't good for production purposes, can they reliably be used in a development environment or will the problem with the Ant builds keep happening? (Btw, the Ant build happens from within Eclipse.)
I'd really like for the exploded archive strategy to work, because am I correct to say that the whole application won't be undeployed/redeployed as in the packaged archive case?
Can anybody please clarify all this for me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006198#4006198
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006198
19 years, 2 months