jboss seam, calling seam component from servlet filter
by rishi
I am very new to jboss Seam and hence a simple query.
I want to call up a seam component from inside a servlet filter as below:
AuthorizerActionLocal authLocal =
(AuthorizerActionLocal)Seam.componentForName("packageCreationAction")
.getInstance(
AuthorizerActionImpl.class);
UserVO userVO = authLocal.login(userName);
I get an error saying:
java.lang.IllegalStateException: No application context active at
org.jboss.seam.Component.forName(Component.java:1603)
What is going wrong? Is it possible to call a seam component from inside a
servlet filter as above? If not then is there any other way
Thanks,
Rishi
18 years, 11 months
[JBoss Seam] - DataSource injection in entity
by purplehaze
Hello.
I must get some data in entity from a stored proc.
this data belons to this entity.
It is very old, legacy DB.
For this I need a DataSource.getConnection()
like this
Connection conn = ds.getConnection();
CallableStatement cs = conn.prepareCall(sql);
How can I inject DataSource, or maybe StatelesBean with this DataSource
in my Entity.
I have tried it with @EJB and @In
but it didn't work. I get:
| ...
| Caused by: java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
| ... 61 more
| Caused by: java.lang.NullPointerException
| at de.arvatoservices.web_france.entity.CatalogItem.callSP(CatalogItem.java:168)
| at de.arvatoservices.web_france.entity.CatalogItem.getPysits(CatalogItem.java:141)
| at de.arvatoservices.web_france.entity.CatalogItemHome.getPysits(CatalogItemHome.java:72)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:37)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:32)
| at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
| at org.jboss.seam.interceptors.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aro
| 13:32:15,028 ERROR [STDERR] undInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| at de.arvatoservices.web_france.entity.CatalogItemHome_$$_javassist_152.getPysits(CatalogItemHome_$$_javassist_152.java)
| ... 66 more
Any Ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048225#4048225
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048225
18 years, 11 months