Bug 801172

Summary: RichFaces resources ordering load is broken with misplaced jquery.js
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Karel Piwko <kpiwko>
Component: RichFacesAssignee: Marek Novotny <mnovotny>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 2.0.0.ER2CC: mariusb, mnovotny, rnewton
Target Milestone: ---   
Target Release: 2.0.0.ER3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-05 13:49:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Piwko 2012-03-07 20:35:33 UTC
Description of problem:

Workaround in https://issues.jboss.org/browse/RF-11739, used in Sportsclub is no longer valid.

Uncaught ReferenceError: jQuery is not defined
2:8080/sportsclub/reservations/:29Uncaught TypeError: Cannot read property 'MenuItem' of undefined
chrome-extension://dfdmbpdbpocelpgahddghhkomnefchkl/fittowidth.js:31Uncaught TypeError: Cannot read property 'parentNode' of undefined


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"><head>
        <title>Sports Club Reservations Spring Application Demo</title>
        <link href="images/favicon.png" rel="Shortcut Icon" />

        <link class="component" href="css/basic_classes.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/extended_classes.css" media="rich-extended-skinning" rel="stylesheet" type="text/css" />
        <link class="component" href="css/panel.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/toolBar.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/datascroller.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/dragindicator.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/extendedDataTable.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/inplaceinput.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/inplaceselect.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/menucomponents.css" rel="stylesheet" type="text/css" />
        <link class="component" href="css/custom.css" rel="stylesheet" type="text/css" /><link type="text/css" rel="stylesheet" href="/sportsclub/reservations/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final-redhat-1/PackedCompressed/DEFAULT/skinning.css" /><script type="text/javascript" src="/sportsclub/reservations/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final-redhat-1/PackedCompressed/packed/packed.js"></script><script type="text/javascript" src="/sportsclub/reservations/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final-redhat-1/PackedCompressed/jquery.js"></script><link type="text/css" rel="stylesheet" href="/sportsclub/reservations/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final-redhat-1/PackedCompressed/DEFAULT/packed/packed.css" /></head><body class="main-body">
    <!-- Work around https://issues.jboss.org/browse/RF-11739 --><span id="j_idt7" style="display: none;"><script type="text/javascript">_nothing=function(){RichFaces.ajax("j_idt7",null,{"incId":"1"} )};</script></span>
    <div id="container">
        <div id="snowdropheader">
            <h1><a href="http://www.jboss.org/snowdrop.html">Snowdrop</a></h1>
        </div>
        <div id="contentcontainer">
            <div id="container_grey">
                <div id="main-contentwrapper">


Version-Release number of selected component (if applicable):

RichFaces 4.2.0.Final-redhat-1

How reproducible:

Always

Steps to Reproduce:
1. Deploy Sportsclub EAR
2. Try to click on anything
  
Actual results:

Buttons are not clickable.

Expected results:

It works.

Additional info:

This was working in WFK 2.0.0.ER1 with EAP 2.0.0.ER1. As WFK 2.0.0.ER1 contained  4.2.0.Final-redhat-1, it means that something must have been broken in MEAD build.

Comment 1 Karel Piwko 2012-03-07 20:58:12 UTC
Possible reason why that happens:

While comparing ER1 and ER2 releases:

/tmp/richfaces-components-ui-4.2.0.Final-redhat-1.jar.diffjars.Dfb/META-INF/richfaces/staticResourceMapping/Packed.properties

contains line 117 javax.faces\:jsf.js=org.richfaces.staticResource/4.2.0.Final-redhat-1/Packed/packed/packed.js 

which load packed.js before jquery.js.

Kudos to Lukas Fryc for discovering this issue.

Comment 2 Karel Piwko 2012-03-07 21:02:05 UTC
Likely caused by wrong classpath ordering in file https://github.com/richfaces/components/blob/develop/dist/static-resources/pom.xml

Comment 3 Karel Piwko 2012-03-07 21:05:09 UTC
The classpath ordering is influenced by scope of artifacts.

This concrete issue happened because /home/kpiwko/installations/wfk/2.0.0.ER2/jboss-wfk-2.0.0.ER2-maven-repository/org/richfaces/richfaces-root-parent/4.2.0.Final-redhat-1/richfaces-root-parent-4.2.0.Final-redhat-1.pom

                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
<!--                     <scope>test</scope> -->
                </dependency>

line 846 was switched from test to compile scope.

Comment 4 Marek Novotny 2012-03-09 19:08:00 UTC
I have found where the origin intention for changing the scope was. Showcase hides jboss profile for variable dependency-scope for jsf-impl.

Comment 5 Marek Novotny 2012-03-09 19:52:02 UTC
After rebuild, the line with:

javax.faces\:jsf.js

disappeared, so I consider that  as fixed.

Comment 7 Karel Piwko 2012-03-12 11:46:12 UTC
Verified fix in WFK 2.0.0.ER3.

Comment 8 Karel Piwko 2012-04-05 13:49:22 UTC
Verified in WFK 2.0.0.ER3 (a.k.a. 2.0.0.Beta1).

Comment 9 JBoss JIRA Server 2016-05-18 14:38:29 UTC
Michal Petrov <mpetrov> updated the status of jira RF-11739 to Resolved