Topic
14 replies Latest Post - ‏2010-04-06T18:12:59Z by yurykats
JanarthanaSK
JanarthanaSK
13 Posts
ACCEPTED ANSWER

Pinned topic hx_6 is undefined

‏2010-04-05T17:38:45Z |
I am developing a new JSF IBM Enhanced Components application using RSA 7.5.5 with WAS 7.0 as the App server.

In my jsp page, if I add an AJAX call using hx:behavior and hx:ajaxRefreshSubmit, I am getting a "hx_6 is undefined" java script error. I see that all the js file (4 files) are correctly included to html page if i do a "view source".

I also tried replacing "/.ibmjsfres" with "/dotibmjsfres" in web.xml as mentioned in one of the other resolutions. This doesn't work.

Please help me in resolving this problem at the earliest as I am not able to proceed further.

Thanks
Janarthana S K
Updated on 2010-04-06T18:12:59Z at 2010-04-06T18:12:59Z by yurykats
  • yurykats
    yurykats
    2186 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-05T17:54:48Z  in response to JanarthanaSK
    There isn't much I can tell from reading your post.

    When are you getting the error? When the page initially renders or after the ajax call?

    Do you have hx:scriptCollector tag properly wrapping other JSF components?

    What 4 files do you see included in the view source?

    Make sure you are using the latest jsf-ibm.jar (the one that comes with RAD 755).
    If this is a porlet, make sure you are using the latest jsf-portletbridge.jar as well.
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-05T19:42:48Z  in response to JanarthanaSK
    Sorry Yurykats. Here's the information that you have asked for.

    I am getting this error when the screen is initially rendered and the AJAX call is not working. I have the hx:scriptCollector tag enclosing all the jsf components. Please find attached the jsp that I have created to test this problem.

    I am using the jsf-ibm.jar that RSA 7.5.5 copies automatically when I create a project. It is not a portal application.

    Also find attached the another webpage I "saved as" html before.

    I think error occurs in lines "if (hX_6) hX_6.setResourceServer" , "hX_6.addBehavior". Please refer to the attached zip for more details.

    The attachment contains a jsp page and a screen that I saved as HTML.

    Thanks in Advance.

    Attachments

    • yurykats
      yurykats
      2186 Posts
      ACCEPTED ANSWER

      Re: hx_6 is undefined

      ‏2010-04-05T19:48:37Z  in response to JanarthanaSK
      Looking at html source, it seems something is wrong with your web.xml configuration as far as JSResourceServlet goes.
      The references to JS files are emited without the servlet mapping, ie "test_files/hxclient_core_v3_1_4.js",
      while they should be "test_files/.ibmjsfres/hxclient_core_v3_1_4.js" or similar.
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-05T21:24:46Z  in response to JanarthanaSK
    yurykats, please find attached the web.xml that is being used. I haven't made any changes to it.

    Also attached is the html zip for the jsp page that i attached in my previous reply.

    Thanks
    Janarthana S K

    Attachments

    • yurykats
      yurykats
      2186 Posts
      ACCEPTED ANSWER

      Re: hx_6 is undefined

      ‏2010-04-06T01:49:10Z  in response to JanarthanaSK
      This does not match the previous zip file with html source.
      That source had, for example, hX_6.setResourceServer("/SSPNew/aibmjsfres") call which means you replaced servlet mapping and/or set the context parameter.
      Looking at unmatched cases within the same thread is not really productive.
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-05T21:41:57Z  in response to JanarthanaSK
    I just found out that in the "hxclient_core_v3_1_4.js" that is present in the jsf-ibm.jar there are about 10000 lines of code, whereas in the "hxclient_core_v3_1_4.js" that is present in the client side, that came when I saved the screen as HTML, it has only about 1712 lines (Please refer to the zip file that is attached in my previous reply).

    I am not sure why half of the file is not getting downloaded and I am not sure if this is the reason for the error.

    Thanks
    Janarthana S K
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-06T02:47:39Z  in response to JanarthanaSK
    Yurykats,

    Please take into consideration the test1.jsp file in the first attachment and the html files and web.xml from the webXml.zip that I attached later.

    I think the problem occurs because "hxclient_core_v3_1_4.js" is truncated. But I am not sure why it is happening.
    The earlier html was the one I saved earlier with another RSA web project. I attached it to give you an idea about the different js files present. Sorry about the confusion.

    Thanks
    Jana
    • SystemAdmin
      SystemAdmin
      6420 Posts
      ACCEPTED ANSWER

      Re: hx_6 is undefined

      ‏2010-04-06T07:40:10Z  in response to JanarthanaSK
      Hi

      Im also facing the same problem. Did you find any solution to this?

      Thank you
      -Anees
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-06T15:13:07Z  in response to JanarthanaSK
    We still haven't found a solution to this problem. Can someone help us in resolving this?
    • BobG
      BobG
      624 Posts
      ACCEPTED ANSWER

      Re: hx_6 is undefined

      ‏2010-04-06T16:27:35Z  in response to JanarthanaSK
      There is still too much unknown about what you are doing. For example it is still unclear why the url to include js files is not as expected (e.g. src="test_files/hxclient_core_v3_1_4.js" should be src="SSPNew/aibmjsres/hxclient_core_v3_1_4.js". where did those JS files come from that you included in the zip files? It would be more helpful is you attached a complete project (or war) that demonstrates the problem.
      • ManishNarula
        ManishNarula
        1 Post
        ACCEPTED ANSWER

        Re: hx_6 is undefined

        ‏2010-04-06T17:17:37Z  in response to BobG
        Hi Bob

        I am Jana's colleague. When we are saving any webpage as HTML (using save as html feature in browser), the URLs for JS file get changed from "SSPNew/aibmjsres/hxclient_core_v3_1_4.js" to "test_files/hxclient_core_v3_1_4.js" . So if I save the webpage as test.html, the browser creates a directory "test_files" and put all the CSS and JS files in test_files directory. Thats why the URLs in the HTML are getting changed when we save the HTMLs.

        Regards,
        Manish
        • yurykats
          yurykats
          2186 Posts
          ACCEPTED ANSWER

          Re: hx_6 is undefined

          ‏2010-04-06T18:12:59Z  in response to ManishNarula
          > I think the problem occurs because "hxclient_core_v3_1_4.js" is truncated.

          Could very well be the reason. The JS file in the zips files you've attached is indeed truncated.

          > But I am not sure why it is happening.

          Me neither. Something about your network setup, maybe? Do you have any security layers running between the browser and the application server?
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-06T16:51:24Z  in response to JanarthanaSK
    Please ignore the "SSPNew/aibmjsfres". I changed the web.xml to check it is solving the problem.

    But even if I dont change web.xml I am getting this problem. To demonstrate that only, i created a new test project with just the test.jsp. I have attached the test1.jsp and web.xml of that project already.

    When I get the jave script error when the screen renders, I save the whole page as "WebPage, complete(.htm, .html) ". That is how i got these js files that I have attached.

    I am attaching the whole set again. It contains

    1. web.xml
    2. test1.jsp
    3. web Page saved as "WebPage, complete(.htm, .html)"

    All these are from the same project.

    Please let me know if you want me to create a new project that demonstrates this problem and send you the WAR file for that.

    Thanks
    Janarthana S K
  • JanarthanaSK
    JanarthanaSK
    13 Posts
    ACCEPTED ANSWER

    Re: hx_6 is undefined

    ‏2010-04-06T16:52:46Z  in response to JanarthanaSK
    Sorry I forgot the attachment.