[seam-issues] [JBoss JIRA] (JBSEAM-4893) Seam Mail does not work in JSF 2.0

Marek Novotny (JIRA) jira-events at lists.jboss.org
Wed Feb 1 07:35:48 EST 2012


    [ https://issues.jboss.org/browse/JBSEAM-4893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663340#comment-12663340 ] 

Marek Novotny commented on JBSEAM-4893:
---------------------------------------

I have fixed the "com.sun.facelets.Facelet" instead of "com.sun.faces.facelets.Facelet" and bridge to JBoss logging from JUL.

But the test is still failing due missing correct initialization of mock test environment for JSF2. I will try to migrate Mail example first and then look at proper mocking the testsuite.
                
> Seam Mail does not work in JSF 2.0
> ----------------------------------
>
>                 Key: JBSEAM-4893
>                 URL: https://issues.jboss.org/browse/JBSEAM-4893
>             Project: Seam 2
>          Issue Type: Bug
>          Components: Mail
>    Affects Versions: 2.3.0.ALPHA
>            Reporter: John Gilbert
>            Assignee: Pete Muir
>             Fix For: 2.3.0.BETA1
>
>         Attachments: seam-mail-test.zip
>
>
> The attached maven project has a test case. The jsf12 profile works, but the jsf2 profile does not work.
> The first problem is simple. The FaceletsRenderer in seam-ui-jsf2 still has a dependency on "com.sun.facelets.Facelet" instead of "com.sun.faces.facelets.Facelet". So you have to include the old com.sun.facelets:jsf-facelets jar or the FaceletsRenderer will not be initialized and you get a NPE:
> {code}
> 	Caused by: java.lang.NullPointerException
> 		at org.jboss.seam.mock.AbstractSeamTest$Request.getRenderedMailMessage(AbstractSeamTest.java:810)
> {code}
> Once past the first issue, the next issue is that the ApplicationAssociate.getCurrentInstance() is not initialized in the AbstractSeamTest container, so another NPE is thrown.				
> 						
> {code}
> 	Caused by: java.lang.NullPointerException
> 		at org.jboss.seam.ui.facelet.FaceletCompiler.initializeCompiler(FaceletCompiler.java:46)
> 		at org.jboss.seam.ui.facelet.FaceletCompiler.create(FaceletCompiler.java:38)
> {code}
> I'm not sure how to resolve this issue. I tried the following code, but no luck.
> {code}
> 	   protected void initializeCompiler(com.sun.faces.facelets.compiler.Compiler c) 
> 	   {
> 		   if (ApplicationAssociate.getCurrentInstance() != null) {
> 			      this.compiler = ApplicationAssociate.getCurrentInstance().getCompiler();
> 			   
> 		   } else {
> 		        // load decorators
> //		        String decParam = webConfig
> //		              .getOptionValue(FaceletsDecorators);
> //		        if (decParam != null) {
> //		            decParam = decParam.trim();
> //		            String[] decs = Util.split(decParam, ";");
> //		            TagDecorator decObj;
> //		            for (String decorator : decs) {
> //		                try {
> //		                    decObj = (TagDecorator) ReflectionUtil.forName(decorator)
> //		                          .newInstance();
> //		                    c.addTagDecorator(decObj);
> //
> //		                } catch (Exception e) {
> //		                }
> //		            }
> //		        }
> 		        c.addTagLibrary(new CoreLibrary());
> 		        c.addTagLibrary(new HtmlLibrary());
> 		        c.addTagLibrary(new UILibrary());
> 		        c.addTagLibrary(new JstlCoreLibrary());
> 		        c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
> 		        c.addTagLibrary(new CompositeLibrary());
> 		   }
> 	   }
> {code}
> More info is available in the pom.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list