[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1023) Looking up a filtered SMPC in non-faces servlet throws NPE
Christian Bauer (JIRA)
jira-events at lists.jboss.org
Mon Apr 16 03:01:58 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1023?page=comments#action_12359372 ]
Christian Bauer commented on JBSEAM-1023:
-----------------------------------------
A new one today:
java.lang.RuntimeException: java.lang.UnsupportedOperationException
at org.jboss.seam.wiki.core.ui.FileServlet.doGet(FileServlet.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:56)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.UnsupportedOperationException
at org.jboss.seam.mock.MockFacesContext.getELContext(MockFacesContext.java:247)
at com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:102)
at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:69)
at org.jboss.seam.persistence.HibernatePersistenceProvider.enableFilter(HibernatePersistenceProvider.java:60)
at org.jboss.seam.core.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:85)
at org.jboss.seam.core.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:105)
at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
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.util.Reflections.invokeAndWrap(Reflections.java:123)
at org.jboss.seam.Component.callComponentMethod(Component.java:1842)
at org.jboss.seam.Component.unwrap(Component.java:1868)
at org.jboss.seam.Component.getInstance(Component.java:1665)
at org.jboss.seam.Component.getInstance(Component.java:1618)
at org.jboss.seam.Component.getInstance(Component.java:1612)
at org.jboss.seam.wiki.core.ui.FileServlet.doGet(FileServlet.java:72)
... 42 more
> Looking up a filtered SMPC in non-faces servlet throws NPE
> ----------------------------------------------------------
>
> Key: JBSEAM-1023
> URL: http://jira.jboss.com/jira/browse/JBSEAM-1023
> Project: JBoss Seam
> Issue Type: Bug
> Components: Core
> Reporter: Christian Bauer
> Assigned To: Gavin King
> Priority: Minor
> Fix For: 1.3.0.BETA1
>
>
> My servlet does:
> EntityManager em = ((EntityManager)org.jboss.seam.Component.getInstance("entityManager"));
> em.joinTransaction();
> file = (!"".equals(id)) ? em.find(File.class, Long.parseLong(id)) : null;
> This worked OK, but after I enabled this filter:
> <core:filter name="accessLevelFilter">
> <core:name>accessLevelFilter</core:name>
> <core:parameters>
> <key>currentAccessLevel</key>
> <value>#{currentAccessLevel}</value>
> </core:parameters>
> </core:filter>
> <core:managed-persistence-context name="entityManager"
> auto-create="true"
> entity-manager-factory="#{wikiEntityManagerFactory}">
> <core:filters><value>#{accessLevelFilter}</value></core:filters>
> </core:managed-persistence-context>
> It fails with:
> Caused by: java.lang.NullPointerException: facesContext
> at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:379)
> at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:57)
> at org.jboss.seam.persistence.HibernatePersistenceProvider.enableFilter(HibernatePersistenceProvider.java:60)
> at org.jboss.seam.core.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:85)
> at org.jboss.seam.core.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:105)
> at sun.reflect.GeneratedMethodAccessor1775.invoke(Unknown Source)
> 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:18)
> at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:121)
> at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
> at org.jboss.seam.Component.unwrap(Component.java:1860)
> at org.jboss.seam.Component.getInstance(Component.java:1657)
> at org.jboss.seam.Component.getInstance(Component.java:1610)
> at org.jboss.seam.Component.getInstance(Component.java:1604)
> at org.jboss.seam.wiki.core.ui.FileServlet.doGet(FileServlet.java:70)
> The expression "#{currentAccessLevel}" can either be resolved to a variable in the SESSION context or to a factory method on one of my components.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list