-
1. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
lfryc Aug 16, 2012 3:26 PM (in response to ealonso04)Hi Ernesto, since I can see packed.js was loaded correctly to the page,
only issue which cames to my mind is that packed.js is not correctly loaded.
Could you check developer console (Firebug / Chrome Dev Tools / ...) if all resources are correctly loaded?
-
2. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
lfryc Aug 16, 2012 3:28 PM (in response to ealonso04)You might have issues with auto-initialization of Resource Servlet:
but as you said, you already tried all you could on the Troubleshooting page.
-
3. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
ealonso04 Aug 16, 2012 4:33 PM (in response to lfryc)Hi Lukas!
Thanks for your answer. I didn't realized that I have a warning in my web.xml regarding to org.richfaces.webapp.ResourceServlet
The warning says: "Unknown Java type: org.richfaces.webapp.ResourceServlet". Maybe this could be the cause of the error I got in console described in the picture above.
But I have no idea how could I solve this warning and even less why it is appearing.
Any idea Lukas?
-
4. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
ealonso04 Aug 16, 2012 5:00 PM (in response to ealonso04)As the matter of fact, console does not tell me there were some resources unloaded ot not correctly loaded.
And in a more sad way for me, when I enter to my page (getting the error you already know) I do an Ajax call, which it executes, but for the second time I do the same Ajax call it does not work anymore, and any call (speaking about other Ajax calls, not the same).
-
5. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
ealonso04 Aug 21, 2012 12:59 PM (in response to ealonso04)I fixed the problem with the warning by adding an aditional JAR I was missing. But that didn't solve the issue of the title of this question.
Any ideas?
-
6. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
jenskreidler Oct 2, 2012 8:44 AM (in response to ealonso04)Hi Ernesto,
have a look via Firebug / Chrome tools etc. on your included javascript libraries.
Had that issue too, but loaded a jQuery javascript library twice: an own inclusion of jquery-1.7.1.min.js and of jquery.js from RichFaces (1.7.1 in RichFaces 4.2.2.FINAL).
Exclude your own jquery inclusion (hopefully you are compatible with jquery 1.7.1 since Richfaces provides it now solely in your webapp) - the problem described will vanish.
-
7. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
ealonso04 Oct 2, 2012 3:59 PM (in response to ealonso04)Hi Thomas! Thanks for you replay.
I did what you said, I removed my own inclusion of jquery-1.7.2.min.js and the error about jQuery.atmosphere disappeared but, I got the following error when I open a popup dialog. Well, is not exactly when I open it, but when I close the dialog or popup window in the mozilla console I get this:
uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMHTMLFormElement.contains]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://localhost:9081/CIS_Web/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.2.Final/PackedCompressed/jquery.js :: <TOP_LEVEL> :: line 1480" data: no]
And after that the followings ajax calls don't work correctly.
Do you have any idea why am I getting that?
Regards!
-
8. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
jenskreidler Oct 3, 2012 6:53 AM (in response to ealonso04)Perhaps this posts / blogs may help you because the popups are hidden div elements:
http://siderite.blogspot.com/2009/07/jquery-firexof-error-could-not-convert.html
... did you test this issue in Chrome or any other browser?
-
9. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
vernon.singleton Apr 5, 2013 11:31 PM (in response to ealonso04)It has been a while since you posted this issue.
Not sure if you ever solved it.
If you have not, let me know, and I'll update with our work around.
-
10. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
vyme Apr 8, 2013 6:47 AM (in response to vernon.singleton)Hey guys,
I'm having the described issue as a result of integrating PrimeFaces into the project. RF seems to have a problem finding jquery.atmosphere when both RF and PF components are used on the same page. The packed.js is there, also jquery from RF and another one from PF (same version though). The only workaround I found so far is including the jquery.atmosphere lib manually. This doesn't seem a as clean solution to me.
@Vernon: Could you please post your workaround?
-
11. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
ealonso04 Apr 8, 2013 1:01 PM (in response to vernon.singleton)Hi Vernon!
I didn't solve this problem. The workaround I used was to put a <rich:tooltip> tag inside my code in my xhtml page. This way I avoided the resource loading issue.
Which was your workaround? I would like to hear about it!
-
12. Re: "jQuery.atmosphere is undefined" Troubleshooting Resource Optimization issue.
vernon.singleton Apr 9, 2013 4:48 PM (in response to vyme)Hello Martin and Ernesto,
Our workaround is implimented in this file:
This is basically one of our ResourceHandlers, where we detect if packed.js is called for in this section:
else if (resourceName.indexOf(PACKED_JS) >= 0) {
String javaScriptText = fixRichFacesPackedDotJs(facesContext,
byteArrayOutputStream.toString());
responseContentLength = javaScriptText.length();
byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(javaScriptText.getBytes());
}
and in there we call the method 'fixRichFacesPackedDotJs' which does the following:
token = "if (jQuery.atmosphere.requests.length > 0) {";
pos = javaScriptText.indexOf(token);
if (pos > 0) {
logger.debug("fixRichFacesPackedDotJs: found second token in packed.js");
StringBuilder buf = new StringBuilder();
buf.append(javaScriptText.substring(0, pos));
buf.append("if (!jQuery.atmosphere) { return; }; ");
buf.append(javaScriptText.substring(pos));
javaScriptText = buf.toString();
}
// jQuery.atmosphere.unsubscribe();
token = "jQuery.atmosphere.unsubscribe();";
pos = javaScriptText.indexOf(token);
if (pos > 0) {
logger.debug("fixRichFacesPackedDotJs: found third token in packed.js");
StringBuilder buf = new StringBuilder();
buf.append(javaScriptText.substring(0, pos));
buf.append("if (!jQuery.atmosphere) { return; }; ");
buf.append(javaScriptText.substring(pos));
javaScriptText = buf.toString();
}
return javaScriptText;
Notice that there are several things in packed.js that we need fixed now, and
so we are thinking about yanking this kind of code out of our ResourceHandler, and
sticking in our util package for other folks to use who do not use our bridge.
But until then, I hope that helps.