[JBoss Seam] - Re: Seam 2.0.0.BETA1 & Ajax4JSF 1.1.1 problem (bug?)
by p2auljr
I am experiencing a similar problem. I am using the same environment except for facelets. I am testing a JSP page.
This code is causing an exception when the action is fired
<a4j:support event="onclick" action="#{myaction.execute}"
reRender="mylist" />
Caused by: java.lang.NullPointerException
at org.jboss.seam.el.SeamExpressionFactory.createMethodExpression(SeamExpressionFactory.java:76)
at org.jboss.seam.jsf.UnifiedELMethodBinding.getMethodExpression(UnifiedELMethodBinding.java:63)
at org.jboss.seam.jsf.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:50)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at org.ajax4jsf.framework.ajax.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
The exception is occurirng in: SeamExpressionFactory.createMethodExpression(ELContext elContext, String expression, Class returnType, Class[] paramTypes)
{
if ( paramTypes.length==1 && JSF.FACES_EVENT.isAssignableFrom( paramTypes[0] ) )
{
return new OptionalParameterMethodExpression(
expressionFactory.createMethodExpression( decorateELContext(elContext), expression, returnType, paramTypes ),
expressionFactory.createMethodExpression( decorateELContext(elContext), expression, returnType, NO_CLASSES )
);
}
else
{
return expressionFactory.createMethodExpression( decorateELContext(elContext), expression, returnType, paramTypes );
}
}
The exception is caused by if (paramTypes.length==1...) because the
paramTypes is null.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062681#4062681
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062681
18Â years, 11Â months
[JBoss AOP] - Re: Strange problem of aspectizing EJBs
by vola
Ok...I think I know the reason now....
Seems like once my "Duke's Bank" application deployed into JBoss, it will be wrapped up by some proxy class....
I change my jboss-aop.xml to:
| <bind pointcut="execution(* $Proxy74->withdraw(..))">
| <interceptor class="com.sun.ebank.aop.SimpleInterceptor2"/>
| </bind>
|
instead of
| <bind pointcut="execution(* com.sun.ebank.ejb.tx.TxControllerBean->withdraw(..))">
| <interceptor class="com.sun.ebank.aop.SimpleInterceptor2"/>
| </bind>
|
Surprisely, it works...One thing I am really confused is why "injbossaop" example does not have this kind of problem?
In "injbossaop" example's jboss-aop.xml:
| <typedef name="MySessionBeans" expr="class($instanceof{javax.ejb.SessionBean}) AND class(org.jboss.injbossaop.ejb.*)" />
| <bind pointcut="execution(* $typedef{MySessionBeans}->getValue(..))">
| <interceptor class="org.jboss.injbossaop.lib.SimpleInterceptor"/>
| </bind>
|
Could anyone tell me how to avoid the "proxy"?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062675#4062675
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062675
18Â years, 11Â months
[JBoss Seam] - Re: Need help with SeamTest
by francof
I found this post
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010462#4010462
I forgot to add earlier - I'm using Seam 1.2.1
Following the suggestions everything works ok only if I my test class does not extend SeamTest - if it's a pure TestNG test it works fine.
OK
public class CatalogTest {
private Catalog catalog;
private EntityManagerFactory emf;
public EntityManagerFactory getEntityManagerFactory() {
return emf;
}
@Configuration(beforeTestClass = true)
public void init() {
emf = Persistence
.createEntityManagerFactory("cast");
}
}
FAILED
public class CatalogTest extends SeamTest {
private Catalog catalog;
private EntityManagerFactory emf;
public EntityManagerFactory getEntityManagerFactory() {
return emf;
}
@Configuration(beforeTestClass = true)
public void init() {
emf = Persistence
.createEntityManagerFactory("cast");
}
}
Basically, all I'm trying to attempt is test that the entity POJO saves to my database and I was following the steps in the reference guide.
Matt / Clive - hoping you guys have a few minutes to respond.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062667#4062667
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062667
18Â years, 11Â months