[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1023) Looking up a filtered SMPC in non-faces servlet throws NPE
Gavin King (JIRA)
jira-events at lists.jboss.org
Tue May 29 21:03:19 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1023?page=all ]
Gavin King closed JBSEAM-1023.
------------------------------
Resolution: Done
This is all out of date now, the USOE should be fixed, and all the code has changed.
If there are still problems, please file a new report with an uptodate description.
> 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.ALPHA
>
>
> 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