title: Openshift DIY cartridge : java.net.SocketException: Permission denied on Spring:boot project
body: <p>I am trying to deploy following open source project on my openshift v2 web console: 
  <a href="https://github.com/jivesoftware/jive-sdk-java-springboot" rel="nofollow">https://github.com/jivesoftware/jive-sdk-java-springboot</a></p>
  
  <p><strong>.action_hook</strong>  start file </p>
  
  <pre><code>#!/bin/bash
  # The logic to start up your application should be put in this
  # script. The application will work only if it binds to
  export JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk1.8.0_05"
  export JRE_HOME="$OPENSHIFT_DATA_DIR/jdk1.8.0_05/jre"
  export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH
  export M2_HOME="$OPENSHIFT_DATA_DIR/apache-maven-3.3.9"
  export M2=$M2_HOME/bin
  
  
  PATH=$M2:$PATH
  cd $OPENSHIFT_REPO_DIR/jive-sdk-java-springboot-master
  mvn spring-boot:run -s $OPENSHIFT_DATA_DIR/settings.xml
  </code></pre>
  
  <p>Build failure message: </p>
  
  <pre><code>------------------------------------------------------------------------
  remote: [INFO] BUILD FAILURE
  remote: [INFO] ------------------------------------------------------------------------
  remote: [INFO] Total time: 01:27 min
  remote: [INFO] Finished at: 2016-10-23T12:32:56-04:00
  remote: [INFO] Final Memory: 55M/314M
  remote: [INFO] ------------------------------------------------------------------------
  remote: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli)
   on project jive-sdk-java-springboot: An exception occurred while running. null: InvocationTargetException: Unable to st
  art embedded Tomcat servlet container: Tomcat connector in failed state -&gt; [Help 1]
  </code></pre>
  
  <p>Full details </p>
  
  <pre><code> remote: 2016-10-23 12:32:45.371  INFO 455129 --- [           main] o.s.w.s.v.f.FreeMarkerConfigurer         : ClassTempl
  ateLoader for Spring macros added to FreeMarker configuration
  remote: 2016-10-23 12:32:50.548  INFO 455129 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registerin
  g beans for JMX exposure on startup
  remote: 2016-10-23 12:32:54.348 ERROR 455129 --- [           main] o.a.coyote.http11.Http11NioProtocol      : Failed to
  start end point associated with ProtocolHandler ["http-nio-8080"]
  remote:
  remote: java.net.SocketException: Permission denied
  remote:         at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.Net.bind(Net.java:414) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.Net.bind(Net.java:406) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_05]
  remote:         at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340) ~[tomcat-embed-core-8.0.32.jar:8.0.
  32]
  remote:         at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765) ~[tomcat-embed-core-8.0.
  32.jar:8.0.32]
  remote:         at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473) ~[tomcat-embed-core-8.0.32.jar:8.
  0.32]
  remote:         at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) [tomcat-embed-core-8.0.32.j
  ar:8.0.32]
  remote:         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.
  0.32]
  remote:         at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239) [tomcat-embed-core-8.
  0.32.jar:8.0.32]
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedC
  onnectors(TomcatEmbeddedServletContainer.java:194) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedS
  ervletContainer.java:151) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer
  (EmbeddedWebApplicationContext.java:293) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebAppl
  icationContext.java:141) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.jav
  a:541) [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicatio
  nContext.java:118) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.REL
  EASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [sprin
  g-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE
  .jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEAS
  E.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEAS
  E.jar:1.3.3.RELEASE]
  remote:         at com.jivesoftware.sdk.ExampleJiveAddOnApplication.main(ExampleJiveAddOnApplication.java:16) [classes/:
  na]
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
  remote:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05]
  remote:         at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
  remote:         at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478) [spring-boo
  t-maven-plugin-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  remote:
  remote: 2016-10-23 12:32:54.351 ERROR 455129 --- [           main] o.apache.catalina.core.StandardService   : Failed to
  start connector [Connector[HTTP/1.1-8080]]
  remote:
  remote: org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8080]]
  remote:         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) ~[tomcat-embed-core-8.0.32.jar:8
  .0.32]
  remote:         at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239) ~[tomcat-embed-core-8
  .0.32.jar:8.0.32]
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedC
  onnectors(TomcatEmbeddedServletContainer.java:194) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedS
  ervletContainer.java:151) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer
  (EmbeddedWebApplicationContext.java:293) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebAppl
  icationContext.java:141) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.jav
  a:541) [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicatio
  nContext.java:118) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.REL
  EASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [sprin
  g-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE
  .jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEAS
  E.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEAS
  E.jar:1.3.3.RELEASE]
  remote:         at com.jivesoftware.sdk.ExampleJiveAddOnApplication.main(ExampleJiveAddOnApplication.java:16) [classes/:
  na]
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
  remote:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05]
  remote:         at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
  remote:         at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478) [spring-boo
  t-maven-plugin-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  remote: Caused by: org.apache.catalina.LifecycleException: service.getName(): "Tomcat";  Protocol handler start failed
  remote:         at org.apache.catalina.connector.Connector.startInternal(Connector.java:993) ~[tomcat-embed-core-8.0.32.
  jar:8.0.32]
  remote:         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) ~[tomcat-embed-core-8.0.32.jar:8
  .0.32]
  remote:         ... 19 common frames omitted
  remote: Caused by: java.net.SocketException: Permission denied
  remote:         at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.Net.bind(Net.java:414) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.Net.bind(Net.java:406) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) ~[na:1.8.0_05]
  remote:         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_05]
  remote:         at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340) ~[tomcat-embed-core-8.0.32.jar:8.0.
  32]
  remote:         at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765) ~[tomcat-embed-core-8.0.
  32.jar:8.0.32]
  remote:         at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473) ~[tomcat-embed-core-8.0.32.jar:8.
  0.32]
  remote:         at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) ~[tomcat-embed-core-8.0.32.
  jar:8.0.32]
  remote:         ... 20 common frames omitted
  remote:
  remote: 2016-10-23 12:32:54.750  INFO 455129 --- [           main] o.apache.catalina.core.StandardService   : Stopping s
  ervice Tomcat
  remote: 2016-10-23 12:32:55.256 DEBUG 455129 --- [ost-startStop-2] .j.s.s.f.JiveSignedFetchValidationFilter : JiveSigned
  FetchValidationFilter destroying...
  remote: 2016-10-23 12:32:56.056 ERROR 455129 --- [           main] o.s.boot.SpringApplication               : Applicatio
  n startup failed
  remote:
  remote: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat ser
  vlet container
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedS
  ervletContainer.java:165) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer
  (EmbeddedWebApplicationContext.java:293) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebAppl
  icationContext.java:141) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.jav
  a:541) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicatio
  nContext.java:118) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.REL
  EASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [sprin
  g-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE
  .jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEAS
  E.jar:1.3.3.RELEASE]
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEAS
  E.jar:1.3.3.RELEASE]
  remote:         at com.jivesoftware.sdk.ExampleJiveAddOnApplication.main(ExampleJiveAddOnApplication.java:16) [classes/:
  na]
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
  remote:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05]
  remote:         at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
  remote:         at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478) [spring-boo
  t-maven-plugin-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  remote: Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedS
  ervletContainer.java:159) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
  remote:         ... 16 common frames omitted
  
  remote: [WARNING]
  remote: java.lang.reflect.InvocationTargetException
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  remote:         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  remote:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  remote:         at java.lang.reflect.Method.invoke(Method.java:483)
  remote:         at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
  remote:         at java.lang.Thread.run(Thread.java:745)
  remote: Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded
   Tomcat servlet container
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedS
  ervletContainer.java:165)
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer
  (EmbeddedWebApplicationContext.java:293)
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebAppl
  icationContext.java:141)
  remote:         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.jav
  a:541)
  remote:         at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicatio
  nContext.java:118)
  remote:         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
  remote:         at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
  remote:         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
  remote:         at com.jivesoftware.sdk.ExampleJiveAddOnApplication.main(ExampleJiveAddOnApplication.java:16)
  remote:         ... 6 more
  remote: Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
  remote:         at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedS
  ervletContainer.java:159)
  remote:         ... 16 more
  remote: [INFO] ------------------------------------------------------------------------
  remote: [INFO] BUILD FAILURE
  remote: [INFO] ------------------------------------------------------------------------
  remote: [INFO] Total time: 01:27 min
  remote: [INFO] Finished at: 2016-10-23T12:32:56-04:00
  remote: [INFO] Final Memory: 55M/314M
  remote: [INFO] ------------------------------------------------------------------------
  remote: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli)
   on project jive-sdk-java-springboot: An exception occurred while running. null: InvocationTargetException: Unable to st
  art embedded Tomcat servlet container: Tomcat connector in failed state -&gt; [Help 1]
  remote: [ERROR]
  remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  remote: [ERROR]
  remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
  remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>I have tried various things but I am not able to understand where is the problem? </p>
  
  <p>From error message it looks like openshift is not allowing the application to run on port 8080. But as per this link (<a href="https://developers.openshift.com/managing-your-applications/port-binding-routing.html)it" rel="nofollow">https://developers.openshift.com/managing-your-applications/port-binding-routing.html)it</a> should be port 8080. </p>
  
  <p>I am not sure where the problem is ! Please help</p>