2 Replies Latest reply on Mar 6, 2008 5:57 AM by s c

    JSF web app gives javascript error - 'dojo is undefined' and

    s c Newbie


      BACKGROUND: I have created a Netbeans 6 Visual Web Project. I have also integrated my web app with RichFaces 3.1.3. My web application can be viewed properly and correctly when i deploy it on tomcat 6.

      ARCHITECTURE: Our server configuration requires IIS to be our web server and tomcat to be our app server. Both are running on different machines. I have successfully linked up IIS 6 and tomcat 6 using the JK isapi_redirector.

      PROBLEM: However, when i connect to my app via IIS, my starting page opens but the input box components on that page are not displayed and i get several javascript errors that read - 'dojo is undefined' and 'webui is undefined'.

      Any help or advice in this matter will be greatly appreciated.


        • 1. Re: JSF web app gives javascript error - 'dojo is undefined'
          s c Newbie

          I managed to find a workaround. Thought i should share it with those who are faced with a similar issue.

          I found that a bug report had been placed in the past with Apache Dev. However, they had said that they would not modify their logic because the servlet container spec requires it (even though isapi_redirector is only a connector and not a container). They said that there is no way for the isapi_redirector to differentiate between /foo/WEB-INF when foo is a context and when foo is just a sub-directory of the ROOT web application. So, the general consensus was to err on the side of safety and risk blocking a few requests that are valid.

          However, this causes a serious issue for those using NetBeans JSF Visual Web Projects. Hence, I created my own flavour of isapi_redirector by modifying the code such that this check is not performed and leaving the onus of checking on Tomcat.

          For those who are interested, the simplest way to go about this would be to force the function uri_is_web_inf (in jk_isapi_plugin.c) to always returns FALSE.

          • 2. Re: JSF web app gives javascript error - 'dojo is undefined'
            s c Newbie

            Just a little background on the issue for the sake of clarity:

            The javascript errors were caused because the page being served had a lot of files being requested from a META-INF folder.

            The JK isapi_connector in IIS prevented access to the META-INF path and the isapi_director log file showed several errors e.g - "[emerg] HttpFilterProc::jk_isapi_plugin.c (1282): [/BMC/theme/META-INF/json2_0/json.js] points to the web-inf or meta-inf directory. Somebody tries to hack into the site!!!". The same message was repeated for several more javascript files that were being served from under the META-INF path.

            Hence, my solution was to modify the isapi_redirector such that these requests were no longer blocked.