AnsweredAssumed Answered

How to specify internet proxy for Alfresco on Windows?

Question asked by rajeshjha9 on Feb 27, 2017

Hello Experts,

 

We have installed Alfresco on Windows machine which is not directly connected to internet. We need to use internet proxy to get internet connection from the Alfresco service. For us to test hybrid sync functionality, Alfresco service needs to connect to internet hence to my.alfresco.com.

 

We have tried to specify internet proxy in java system variable like followings, this is well documented way to specify http proxy for JVM:
-Dhttps.proxyHost=xxx.yyy.com
-Dhttps.proxyPort=8080

 

But for some reason it doesn't work. When I specify above setting then we get following exception in share.log. I suspect this is due to fact that Share is not able to connect to Alfresco. We have not changed any default setting in share-config-custom.xml so default Alfresco host is configured as "http://localhost:8080/alfresco". Though Alfresco application working fine after this setting.

 

-Dhttps.proxyHost=xxx.yyy.com
-Dhttps.proxyPort=8080
-Dhttps.nonProxyHosts=localhost|127.0.0.1

 

Exception in share.log:
2017-02-27 15:02:43,346 ERROR [org.alfresco.web.site] [http-apr-8080-exec-5] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connector.remoteclient' defined in URL [file:/C:/Apps/alfresco-one/tomcat/webapps/share/WEB-INF/classes/alfresco/slingshot-application-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.alfresco.web.scripts.SlingshotRemoteClient

 

Surprisingly when I set following set of variables then even Alfresco web application doesn't work:
-Dhttp.proxyHost=xxx.yyy.com
-Dhttp.proxyPort=8080
-Dhttp.nonProxyHosts=localhost|127.0.0.1

 

Exception in alfresco.log:
2017-02-27 15:41:58,906 ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'twitterDeliveryChannelType' defined in URL [jar:file:/C:/Apps/alfresco-one/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.1.2.jar!/alfresco/twitter-publishing-context.xml]: Cannot create inner bean 'org.springframework.social.twitter.connect.TwitterConnectionFactory#3b71933e' of type [org.springframework.social.twitter.connect.TwitterConnectionFactory] while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.social.twitter.connect.TwitterConnectionFactory#3b71933e' defined in URL [jar:file:/C:/Apps/alfresco-one/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.1.2.jar!/alfresco/twitter-publishing-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.social.twitter.connect.TwitterConnectionFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Host name may not contain blanks

 

We had done similar things in Linux based machine and it is working perfectly fine there. We had made the changes in "setenv.sh" file like followings:
CATALINA_OPTS="-Dhttps.proxyHost=xxx.xxx.xxx.xxx -Dhttps.proxyPort=8080 $CATALINA_OPTS"

 

BR,
Rajesh

Attachments

Outcomes