Openshift java.net.BindException:使用youtube API

时间:2016-07-07 07:43:23

标签: youtube-api openshift google-oauth passport-google-oauth google-my-business-api

我的应用程序(在Java Servlets和jquery中运行)在我的本地计算机上运行良好但是当我在Openshift上部署它时,它会在youtube API的身份验证步骤中抛出java.net.BindException: Permission denied

下面,我发布了与该例外相关的代码(取自谷歌api网站)。我尝试更改端口号但似乎没有任何效果。

// Build the local server and bind it to port 8080
LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setPort(45205).build();

// Authorize.
return new AuthorizationCodeInstalledApp(flow, localReceiver).authorize("user");

有没有办法解决这个问题?我一直试图解决这一整天没有运气。任何帮助解决这个问题高度赞赏!

完整的异常详情:

2016-07-07 03:35:30.388:WARN::failed SocketConnector@localhost:45205: java.net.BindException: Permission denied
2016-07-07 03:35:30.390:WARN::failed Server@4486db: java.net.BindException: Permission denied
2016-07-07 03:35:30.391:INFO::Stopped SocketConnector@localhost:45205
java.io.IOException: java.net.BindException: Permission denied
        at com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver.getRedirectUri(LocalServerReceiver.java:107)
        at com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp.authorize(AuthorizationCodeInstalledApp.java:76)
        at sam.ut.Auth.authorize(Auth.java:76)
        at sam.ut.CommentThreads.<clinit>(CommentThreads.java:42)
        at youtubeapp.servletes.HomePageServlet.doGet(HomePageServlet.java:70)
        at youtubeapp.servletes.HomePageServlet.doPost(HomePageServlet.java:152)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1042)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.BindException: Permission denied
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
        at java.net.ServerSocket.bind(ServerSocket.java:376)
        at java.net.ServerSocket.<init>(ServerSocket.java:237)
        at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
        at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
        at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
        at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.Server.doStart(Server.java:235)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver.getRedirectUri(LocalServerReceiver.java:104)
        ... 27 mor

0 个答案:

没有答案