[ 
https://issues.apache.org/jira/browse/TRINIDAD-1723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862036#action_12862036
 ] 

Jeanne Waldman commented on TRINIDAD-1723:
------------------------------------------

Like Max said on 16/Feb/10, prior to Blake's change we had only one 
faces-bean.properties file and that is in the impl jar. Now we have two 
faces-bean.properties files - one in the impl jar and one in the api. Max talks 
about the workaround.

I filed a bug against JDeveloper, and it was explained to me that this is not a 
bug. It seems like we can fix it by changing the setup of our projects.

The following is from a JDev developer who is an expert in this area:
The relevant rules are:

1. If project A depends on project B "Build Output," then the "Build Output"
of project B is *merged* into project A.  If project A is a web application,
this means project A and project B "Build output" are both copied into the
WEB-INF/classes of the resulting WAR.  Merging implies that you can only have
one copy of any particular URI, because it can only exist once within
WEB-INF/classes.

2. If project A depends on a project B "Deployment Profile" (e.g. a JAR
profile), then the result of that deployment profile is included in the
WEB-INF/lib of the resulting WAR.

You can observe these rules in action by creating a WAR deployment profile in
the demo project.  When you edit the profile
and go to the  File Groups->WEB-INF/classes tab, you will see all the classes
contributed by the APIProject and the ImplProject projects, but only one
faces-bean.properties.  (jmw - I have not confirmed this)

trinidad-api.jar and trinidad-impl.jar are JARs, and JARs are the primary way
to have multiple copies of the same URI in the classpath.  To generate JARs
from a JDeveloper project, rule #2 must be used.  I modified
the test app as follows:

1. Create a JAR deployment profile in the APIProject project, and called it
APIProject
2. Create a JAR deployment profile in the ImplProject project, and called it
ImplProject.
3. Modify the dependencies of all three projects.
  a. Project1 (the demo project) depends on the APIProject deployment profile 
of project
APIProject (instead of on "Build Output")
  b. Project1 depends on the ImplProject deployment profile of project
ImplProject (instead of on "Build Output")
  c. APIProject depends on the ImplProject deployment profile of project
ImplProject (instead of on "Build Output")


> Trinidad 2: ClassCastEXception while running componentDemos.jspx
> ----------------------------------------------------------------
>
>                 Key: TRINIDAD-1723
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1723
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-alpha-2
>            Reporter: Max Starets
>
> Grab the latest trinidad-2.0.x branch and try running componentDemos.jspx. 
> The following exception will be thrown:
> java.lang.ClassCastException: 
> org.apache.myfaces.trinidadinternal.uinode.UIComponentUINode cannot be cast 
> to org.apache.myfaces.trinidadinternal.uinode.UIXComponentUINode
>       at 
> org.apache.myfaces.trinidadinternal.uinode.UIXComponentUINode.__getAdapter(UIXComponentUINode.java:439)
>       at 
> org.apache.myfaces.trinidadinternal.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:65)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:852)
>       at 
> org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:70)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:509)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:531)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:70)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:151)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:153)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:80)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:546)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:82)
> This does not seem to be JSF 2 specific, but I have not had time to try it on 
> the latest MAIN.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to