Forums de discussion

Exceptions during startup - Liferay cannot load javascript from internet

thumbnail
Sebastian Sommerfeld, modifié il y a 9 années.

Exceptions during startup - Liferay cannot load javascript from internet

Junior Member Publications: 40 Date d'inscription: 06/12/10 Publications récentes
Hi Guys

I'm running Liferay 6.2 bundled with tomcat. So far everything works fine, just one unpleasant thing during startup. My Liferay tries to load three Javascript files from the internet but fails due to ConnectTimeoutException. Is there a way I can tell Liferay not to load these files at all? Since everything is running fine I assume those files are nice to have but not necessary at all.

INFO: Got Exception fetching http://www.google-analytics.com/urchin.js - 5002ms
org.apache.http.conn.ConnectTimeoutException: Connect to www.google-analytics.com/173.194.112.78:80 timed out
	[... Stacktrace ...]

INFO: Got Exception fetching http://www.google.com/ig/lib/libanalytics.js - 5003ms
org.apache.http.conn.ConnectTimeoutException: Connect to www.google.com/173.194.112.81:80 timed out
	[... Stacktrace ...]

INFO: Got Exception fetching http://www.google.com/ig/lib/libga.js - 5001ms
org.apache.http.conn.ConnectTimeoutException: Connect to www.google.com/173.194.112.81:80 timed out
	[... Stacktrace ...]


Thanks and regards
Sebastian
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
Sure, disable google analytics and it will stop trying to pull the scripts.
thumbnail
Sebastian Sommerfeld, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Junior Member Publications: 40 Date d'inscription: 06/12/10 Publications récentes
Could you give me a hint on how I can disable it?
thumbnail
Tina Agrawal, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Expert Publications: 297 Date d'inscription: 03/01/08 Publications récentes
Make sure there is no analytics id set. Check this link -

https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/liferay-monitoring-using-google-analyti-liferay-portal-6-2-user-guide-18-en

Tina
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
David H Nebinger:
Sure, disable google analytics and it will stop trying to pull the scripts.


Hi David - in my case, I believe it is due to setting up Liferay on 10.10... address (internal) and need to allow Liferay out to fetch the content. How might this be accomplished?
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
Hi, Daniel!

Usually you want to locally host the JS files from your own environment. Can you pull them and host them locally? Also, is the Liferay server trying to get the files or are the URLs just being handed back to the browser to fetch from Google?
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
Thank you, David. I was quite used to working in a different setup with a public IP for the Liferay server until recently. I had not seen these errors for past 5 years. First thought was to try these properties:
http.proxyHost=
http.proxyPort=

hoping that would let things like Google Analytics do its thing (in our case we do want the analytic data to go back 'n forth), but our normal proxy address (the same one that works for yum and a few other utilities on the same server) did not work...

I like the suggestion of including the scripts locally - will explore that further and recall there is info on accomplishing that out there.

Just feel like I am still missing something in this setup... i don't want to see necessary communications be cut off...

Do you see any holes i may have missed transitioning from public IP Liferay > 10.10 Liferay installation?

These are basically the only errors I am seeing (so far...) in the new setup. SSL is working and I can can browse / login to my Liferay instance.

Here is an example output in catalina.out:
INFO: Got Exception fetching http://www.google.com/ig/lib/libanalytics.js - 1002ms
java.net.NoRouteToHostException: No route to host...

Jan 26, 2015 10:07:12 PM org.apache.shindig.gadgets.http.BasicHttpFetcher fetch
INFO: Got Exception fetching http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js - 7161ms
org.apache.http.conn.ConnectTimeoutException: Connect to ajax.googleapis.com/64.233.171.95:80 timed out...

Jan 26, 2015 10:07:21 PM org.apache.shindig.gadgets.http.BasicHttpFetcher fetch
INFO: Got Exception fetching http://www.google.com/ig/lib/libga.js - 5006ms
org.apache.http.conn.ConnectTimeoutException: Connect to www.google.com/74.125.228.113:80 timed out...
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
So these errors indicate the server is trying to connect out to those addresses. Are you running an internal firewall that may be blocking outbound http connections?

You can test whether it is a firewall issue by doing a command line on the Liferay server such as "wget http://www.google.com/ig/lib/libanalytics.js"; if it fails, then it's more of a firewall issue than a Liferay issue...
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
I think it is FW issues. I appreciate your inputs and time. The wget command works but i think only because I put the proxy info into its (wget /etc/wgetrc) config... :-)

I figured between these issues, your input here, plus once I realized I definitely have the ldaps cert in place (by getting it with a CertInstall + proxy option java app) but ldap is not communicating, either... New territory for me... thanks again! I will make some requests to our network team to open things up a bit... -daniel
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
You'll also want to look at using the proxy options in portal-ext.properties; they are there to help you navigate out to the net using the same proxy you're using for wget...
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
To be sure - do you mean like these?:
http.proxyHost=
and
http.proxyPort=
thumbnail
Olaf Kock, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Funny - and sorry for stepping in. I'm wondering why the server is interested in the GA JS code at all. Typically it would just render tags to the HTML to include that Javascript browser side and the browser would go out to google to request them. AFAIK there's no GA javascript that is running server side and I'd be very surprised if Liferay would proxy that code. The beauty of that kind of analytics is exactly that the analyzed server itself doesn't have anything to do with it - apart from rendering a few additional bytes of HTML more than without analytics. The analyzed server can operate read-only (very quick) while the analytics server is keeping the statistics and writes data per request.

Granted, this doesn't help you at all solving your problem - but the whole story puzzled me quite well so that I was tempted to add this story. Maybe/hopefully it helps triggering another solution path.
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
Daniel Tyger:
To be sure - do you mean like these?:
http.proxyHost=
and
http.proxyPort=


Yep, those are the ones.

Olaf Kock:
Funny - and sorry for stepping in. I'm wondering why the server is interested in the GA JS code at all.


I'm not sure if it is native Liferay code, Olaf. Getting the messages in the log makes it clear that the server is doing something to reach out itself...

But that does bring up another point for Daniel - If this is not native Liferay code, it may or may not honor the proxy settings.
Ricardo Franco, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

New Member Publications: 4 Date d'inscription: 10/04/14 Publications récentes
Hi,

I'm also trying to run Liferay CE 6.2 from a network without access to the internet.

And I'm also curious why Liferay needs to get these js files on startup, when I have no Google Analytics stuff set up on my installation:

GET http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
GET http://www.google-analytics.com/urchin.js
GET http://www.google.com/ig/lib/libanalytics.js
GET http://www.google.com/ig/lib/libga.js

In my case Liferay doesn't start up properly and gets into a HTTP 500 mode...

Cheers,
Ricardo
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
Sorry, but Liferay doesn't use jquery, so that's coming from your own code.

There's also no direct reference to urchin.js in the Liferay source, but that could be an artifact of a third party jar.
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
Ricardo Franco:
...And I'm also curious why Liferay needs to get these js files on startup, when I have no Google Analytics stuff set up on my installation...


Ricardo - I think some of these are from shindig / Open Social plugin... you may want to remove it and cleanly start tomcat... Does that help w/ some...? -daniel
Ricardo Franco, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

New Member Publications: 4 Date d'inscription: 10/04/14 Publications récentes
Daniel Tyger:

Ricardo - I think some of these are from shindig / Open Social plugin... you may want to remove it and cleanly start tomcat... Does that help w/ some...? -daniel


Hi Daniel,

Thanks a lot for the tip.
I'm also convinced it's coming from the Open Social plugin - although I'm not 100% sure as we implemented a workaround solution to quickly overcome this problem.

As we're not actually using anything from google or analytics, we just hosted those js files locally to allow the startup of the server.

About the references not coming from Liferay source code, that may be true.
But we installed the Liferay 6.2 CE from scratch, which came with Open Social plugin, which is delivered by Liferay...
Disabling the Open social plugin did not stop the server from trying to get the js files.

Cheers!
Ricardo
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
Ricardo Franco:
... we just hosted those js files locally to allow the startup of the server....
Ricardo


Can you tell us the steps you took to achieve this?
thumbnail
Daniel Tyger, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

Regular Member Publications: 105 Date d'inscription: 06/02/13 Publications récentes
David H Nebinger:
Daniel Tyger:
To be sure - do you mean like these?:
http.proxyHost=
and
http.proxyPort=

Yep, those are the ones.


I just wanted to follow up with my results, here... I tried the httpProxy Liferay properties only and that did not clear up the fetch {external script} errors.

However, once I added the same properties to {tomcat}/conf/catalina.properties then the script errors ceased during start up.

Does that sound normal / expected in configuring an http proxy host?
Ricardo Franco, modifié il y a 9 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

New Member Publications: 4 Date d'inscription: 10/04/14 Publications récentes
Hi David,

http.proxyHost and http.proxyPort were not an option for me because my firewall does not allow http access to outside my network.

But, AFAIK, to use these properties they should e put in a system-ext.properties in tomcat-7.0.42/webapps/ROOT/WEB-INF/classes

For me, because I'm really not allowed to have http access to the outside, it was a very quick and dirty solution,
hosting the files on a local webserver listening on localhost:80;
creating on the server hosting liferay a simple directory structure (/ig/lib/ , /ajax/libs/jquery/1.4.2/ ) with copies of the files
pointing the required google sites to localhost on /etc/hosts
asma Maalej, modifié il y a 8 années.

RE: Exceptions during startup - Liferay cannot load javascript from interne

New Member Envoyer: 1 Date d'inscription: 27/01/16 Publications récentes
Hi everybody,

I'm newbie in Liferay, and I'd like to follow up with this discussion as I got this same exception at tomcat server's startup. I tried to fix this issue with solutions listed above by adding http.proxyHost and htto.proxyPort properties to catalina.properties file once and/or to portel-ext.properties in other one but without success.

So, since it didn't disable the liveray launching, I've ignored it, but I got the same error when I tried to add openSocial Gadget by adding its URL as is described here.

org.apache.http.conn.ConnectTimeoutException: Connect to www.labpixies.com/74.125.133.121:80 timed out
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:125)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:597)
at org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch(BasicHttpFetcher.java:354)
at org.apache.shindig.gadgets.http.DefaultRequestPipeline.execute(DefaultRequestPipeline.java:92)
at org.apache.shindig.gadgets.AbstractSpecFactory.fetchFromNetwork(AbstractSpecFactory.java:129)
at org.apache.shindig.gadgets.AbstractSpecFactory.getSpec(AbstractSpecFactory.java:90)
at org.apache.shindig.gadgets.DefaultGadgetSpecFactory.getGadgetSpec(DefaultGadgetSpecFactory.java:81)
at org.apache.shindig.gadgets.process.Processor.process(Processor.java:90)
at com.liferay.opensocial.shindig.util.ShindigUtil.getGadgetSpec(ShindigUtil.java:278)
at com.liferay.opensocial.shindig.util.ShindigUtil.getGadgetSpec(ShindigUtil.java:245)
at com.liferay.opensocial.service.impl.GadgetLocalServiceImpl.addGadget(GadgetLocalServiceImpl.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
........
Can anyone helps me fix this issue ??
regards .