[JBoss Seam] - Raising an event in Seam without violating EJB's concurrent
by tonylmai
Hello,
I am trying to raise an event inside an action which is modeled as a stateful session bean. This resulted in violation for concurrent call in EJB.
anonymous wrote : 16:40:41,859 ERROR [SeamPhaseListener] uncaught exception
| javax.faces.el.EvaluationException: javax.ejb.ConcurrentAccessException: no concurrent calls on stateful bean 'jboss.j2ee:service=EJB3,name=OrderManagerBean' (EJB3 4.3.13)
| at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
| at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
| at org.jboss.seam.core.Pages.callAction(Pages.java:499)
| at org.jboss.seam.core.Pages.enterPage(Pages.java:282)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:276)
| ...
| Caused by: javax.ejb.ConcurrentAccessException: no concurrent calls on stateful bean 'jboss.j2ee:service=EJB3,name=OrderManagerBean' (EJB3 4.3.13)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:73)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
Is there a way that I could raise an event in Seam without violating this EJB rule?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045158#4045158
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045158
19 years, 1 month
[JBoss Seam] - Re: s:fileUpload throw
by cchee
edit.xhtml:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| template="layout/template.xhtml">
|
| <ui:define name="body">
|
| <div id="taskmenu">
| <table cellpadding="0" cellspacing="0">
| <tr>
| <td><img alt="Go Back" src="img/mini-arrow-blue.gif"/><a href="javascript:history.go(-1)" onMouseOver="self.status=document.referrer;return true">Go Back</a></td>
| </tr>
| </table>
| </div>
|
| <div id="content">
| <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
|
| <h:form id="assetType" styleClass="edit" enctype="multipart/form-data">
|
| <rich:panel>
| <f:facet name="header" rendered="#{assetTypeHome.instance.new}">New Asset Type</f:facet>
| <f:facet name="header" rendered="#{!assetTypeHome.instance.new}">Edit Asset Type</f:facet>
|
| <s:decorate id="nameDecoration" template="layout/edit.xhtml">
| <ui:define name="label">Name</ui:define>
| <h:inputText id="name"
| required="true"
| size="64"
| maxlength="64"
| value="#{assetTypeHome.instance.name}">
| <a:support event="onblur" reRender="nameDecoration"/>
| </h:inputText>
| </s:decorate>
|
| <s:decorate id="assetRequestFormDecoration" template="layout/edit.xhtml">
| <ui:define name="label">Asset Request Form</ui:define>
| <s:fileUpload id="assetRequestForm"
| data="#{assetTypeHome.instance.assetRequestForm}"
| required="true"
| contentType="application/vnd.ms-excel"/>
| </s:decorate>
|
| <s:decorate id="assetReportFormDecoration" template="layout/edit.xhtml">
| <ui:define name="label">Asset Report Form</ui:define>
| <s:fileUpload id="assetReportForm"
| data="#{assetTypeHome.instance.assetReportForm}"
| required="true"
| contentType="application/vnd.ms-excel"/>
| </s:decorate>
|
| <div style="clear:both">
| <span class="required">*</span>
| required fields
| </div>
|
| </rich:panel>
|
| <div class="actionButtons">
|
| <h:commandButton id="save"
| value="Save"
| action="#{assetTypeHome.persist}"
| disabled="#{!assetTypeHome.wired}"
| rendered="#{!assetTypeHome.managed}"/>
|
| <h:commandButton id="update"
| value="Save"
| action="#{assetTypeHome.update}"
| rendered="#{assetTypeHome.managed}"/>
|
| <h:commandButton id="delete"
| value="Delete"
| action="#{assetTypeHome.remove}"
| rendered="#{assetTypeHome.managed}"/>
|
| <s:button id="done"
| value="Done"
| propagation="end"
| view="/AssetType.xhtml"
| rendered="#{assetTypeHome.managed}"/>
|
| <s:button id="cancel"
| value="Cancel"
| propagation="end"
| view="/#{empty assetTypeFrom ? 'AssetTypeList' : assetTypeFrom}.xhtml"
| rendered="#{!assetTypeHome.managed}"/>
|
| </div>
| </h:form>
| </div>
| </ui:define>
| </ui:composition>
|
I didn't create an action bean to do the file upload, thinking i can use "Home" bean:
import java.util.HashSet;
| import java.util.Set;
| import javax.persistence.Basic;
| import javax.persistence.CascadeType;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.FetchType;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.Lob;
| import javax.persistence.OneToMany;
| import javax.persistence.Table;
| import javax.persistence.UniqueConstraint;
|
| import org.hibernate.annotations.Cache;
| import org.hibernate.annotations.CacheConcurrencyStrategy;
|
| import org.hibernate.validator.Length;
| import org.hibernate.validator.NotNull;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.security.Restrict;
|
| /**
| * AssetType generated by hbm2java
| */
| @Entity
| @Restrict
| @Name("assetType")
| @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
| @Table(name = "asset_type", catalog = "fbis", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
| public class AssetType implements java.io.Serializable {
|
| /**
| *
| */
| private static final long serialVersionUID = -1604122679008790458L;
| private int id;
| private String name;
| private byte[] assetRequestForm;
| private byte[] assetReportForm;
| private Set<Asset> assets = new HashSet<Asset>(0);
|
| public AssetType() {
| }
|
| public AssetType(int id, String name, byte[] assetRequestForm,
| byte[] assetReportForm) {
| this.id = id;
| this.name = name;
| this.assetRequestForm = assetRequestForm;
| this.assetReportForm = assetReportForm;
| }
| public AssetType(int id, String name, byte[] assetRequestForm,
| byte[] assetReportForm, Set<Asset> assets) {
| this.id = id;
| this.name = name;
| this.assetRequestForm = assetRequestForm;
| this.assetReportForm = assetReportForm;
| this.assets = assets;
| }
|
| @Id
| @GeneratedValue
| @Column(name = "id", unique = true, nullable = false)
| @NotNull
| public int getId() {
| return this.id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
|
| @Column(name = "name", unique = true, nullable = false, length = 64)
| @NotNull
| @Length(max = 64)
| public String getName() {
| return this.name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| @Lob
| @Basic(fetch = FetchType.LAZY)
| @Column(name = "asset_request_form", nullable = false)
| @NotNull
| public byte[] getAssetRequestForm() {
| return this.assetRequestForm;
| }
|
| public void setAssetRequestForm(byte[] assetRequestForm) {
| this.assetRequestForm = assetRequestForm;
| }
|
| @Lob
| @Basic(fetch = FetchType.LAZY)
| @Column(name = "asset_report_form", nullable = false)
| @NotNull
| public byte[] getAssetReportForm() {
| return this.assetReportForm;
| }
|
| public void setAssetReportForm(byte[] assetReportForm) {
| this.assetReportForm = assetReportForm;
| }
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "assetType")
| public Set<Asset> getAssets() {
| return this.assets;
| }
|
| public void setAssets(Set<Asset> assets) {
| this.assets = assets;
| }
|
| }
|
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045156#4045156
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045156
19 years, 1 month
[JBoss AOP] - Intercepting EJB3 EntityBeans
by wtaylor
I am trying to intercept EJB3 EntityBean methods, but I'm getting a javassist.CannotCompileException.
The jboss-aop.xml file I'm using is:
<aop>
| <typedef
| name="logclasses"
| expr="class(test.*) AND
| !class(test.aop.*)"/>
| <bind pointcut="execution(* $typedef{logclasses}->*(..))">
| <interceptor
| class="aop.LoggingInterceptor"/>
| </bind>
| </aop>
And the exception I get is:
2007-05-11 18:34:02,032 ERROR [STDERR] [warn] AOP Instrumentor failed to transform
test.entity.GroupEntity_$$_javassist_263
2007-05-11 18:34:02,032 ERROR [STDERR] javassist.CannotCompileException: duplicate method: _getAdvisor
2007-05-11 18:34:02,048 ERROR [STDERR] at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:548)
2007-05-11 18:34:02,048 ERROR [STDERR] at javassist.bytecode.ClassFile.addMethod(ClassFile.java:528)
2007-05-11 18:34:02,048 ERROR [STDERR] at javassist.CtClassType.addMethod(CtClassType.java:1170)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.instrument.ClassicInstrumentor.addHelperClass(ClassicInstrumentor.java:194)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.instrument.ClassicInstrumentor.doSetupBasics(ClassicInstrumentor.java:164)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.instrument.Instrumentor.setupBasics(Instrumentor.java:842)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.instrument.MethodExecutionTransformer.instrument(MethodExecutionTransformer.java:143)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:658)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.AspectManager.translate(AspectManager.java:908)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.AspectManager.transform(AspectManager.java:820)
2007-05-11 18:34:02,048 ERROR [STDERR] at org.jboss.aop.standalone.AOPTransformer.aspectTransform(AOPTransformer.java:88)
2007-05-11 18:34:02,063 ERROR [STDERR] at org.jboss.aop.standalone.AOPTransformer.transform(AOPTransformer.java:75)
2007-05-11 18:34:02,063 ERROR [STDERR] at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
2007-05-11 18:34:02,063 ERROR [STDERR] at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
2007-05-11 18:34:02,063 ERROR [STDERR] at java.lang.ClassLoader.defineClass1(Native Method)
2007-05-11 18:34:02,063 ERROR [STDERR] at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
2007-05-11 18:34:02,063 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
2007-05-11 18:34:02,063 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2007-05-11 18:34:02,063 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
2007-05-11 18:34:02,063 ERROR [STDERR] at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:159)
2007-05-11 18:34:02,063 ERROR [STDERR] at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:170)
etc...
The weird thing is that the pointcut is properly bound to non-EntityBeans in the same package. How can I get the pointcut to bind to EntityBeans too?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045151#4045151
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045151
19 years, 1 month