GET 404(未找到) - 角度js链接路由

时间:2016-03-16 16:55:33

标签: javascript html angularjs video http-status-code-404

我正在使用Ionic和Angular来创建一个简单的应用程序。我使用Ionics ionic serve命令在本地运行,以设置一个简单的服务器。

这是我的playlist.html代码,我将在其中显示我的视频:

<video ng-src="{{playlist.video}}" width="560" height="315"></video>

这是我的controller.js,它将url传递给playlist.html:

controller('PlaylistCtrl', function($scope, $stateParams) {
  $scope.playlistSet = [
    [
      { track: 'Iris', artist: 'Sleeping with the Sirens', video: 'www.youtube.com/watch?v=cyOqIKGbYkg'}
     
    ]
  $scope.id = $stateParams.playlistId;});

当我运行播放列表时,视频不会显示。它给了我错误:

Cannot GET /www.youtube.com/watch?v=QBmTGlUmgpg

我已经搜索了这个错误背后的原因,过去几个小时无法解决。希望有人遇到同样的问题,并能够帮助解决问题。

2 个答案:

答案 0 :(得分:0)

我看到一件奇怪的事情

$scope.playlistSet = [
    [
      { track: 'Iris', artist: 'Sleeping with the Sirens', video: 'www.youtube.com/watch?v=cyOqIKGbYkg'}

    ]

我们这里还有额外的[吗?

无论如何,真正的问题是您的浏览器将您的URL解释为本地URL,因此尝试在您的根目录中找到它(请注意错误消息中URL之前的/)。将http://添加到您的视频网址(对象中的video属性)应该可以解决它。

答案 1 :(得分:0)

您必须将其更改为:

[2016-03-17T08:29:21.494+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=35 _ThreadName=Thread-8] [timeMillis: 1458199761494] [levelValue: 800] [[
  Hibernate:
    select
        nextval ('POINT_ANALYSE_ID_SEQ')]]

[2016-03-17T08:29:21.496+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=35 _ThreadName=Thread-8] [timeMillis: 1458199761496] [levelValue: 800] [[
  Hibernate:
    insert
    into
        point_analyse
        (accuracy, bearing, distance, gprs_signal, latitude, longitude, max_signal_sat, min_signal_sat, nb_sat, route_analyse_id, speed, tag, timestamp, id)
    values
        (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]]

[2016-03-17T08:29:21.498+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761498] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [1] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.499+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761499] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [2] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.499+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761499] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [3] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.501+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761501] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [4] as [BIGINT] - [null]]]

[2016-03-17T08:29:21.501+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761501] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [5] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.501+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761501] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [6] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.502+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761502] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [7] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.502+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761502] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [8] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.503+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761503] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [9] as [BIGINT] - [null]]]

[2016-03-17T08:29:21.503+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761503] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [10] as [BIGINT] - [null]]]

[2016-03-17T08:29:21.504+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761504] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [11] as [DOUBLE] - [null]]]

[2016-03-17T08:29:21.504+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761504] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [12] as [VARCHAR] - [null]]]

[2016-03-17T08:29:21.504+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761504] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [13] as [BIGINT] - [null]]]

[2016-03-17T08:29:21.505+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761505] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [14] as [BIGINT] - [1723]]]

[2016-03-17T08:29:21.506+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=35 _ThreadName=Thread-8] [timeMillis: 1458199761506] [levelValue: 800] [[
  Hibernate:
    select
        nextval ('RESSOURCES_ANALYSE_ID_SEQ')]]

[2016-03-17T08:29:21.507+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=35 _ThreadName=Thread-8] [timeMillis: 1458199761507] [levelValue: 800] [[
  Hibernate:
    insert
    into
        ressources_analyse
        (route_id, point_id, uri_ressource, id)
    values
        (?, ?, ?, ?)]]

[2016-03-17T08:29:21.508+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761508] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [1] as [BIGINT] - [null]]]

[2016-03-17T08:29:21.509+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761509] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [2] as [BIGINT] - [1723]]]

[2016-03-17T08:29:21.509+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761509] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [3] as [VARCHAR] - [null]]]

[2016-03-17T08:29:21.510+0100] [glassfish 4.1] [TRACE] [] [org.hibernate.type.descriptor.sql.BasicBinder] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761510] [levelValue: 400] [CLASSNAME: org.hibernate.type.descriptor.sql.BasicBinder] [METHODNAME: bind] [[
  binding parameter [4] as [BIGINT] - [113]]]

[2016-03-17T08:29:21.513+0100] [glassfish 4.1] [INFO] [] [org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761513] [levelValue: 800] [[
  HHH000010: On release of batch it still contained JDBC statements]]

[2016-03-17T08:29:21.514+0100] [glassfish 4.1] [WARN] [] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761514] [levelValue: 900] [[
  SQL Error: 0, SQLState: 23503]]

[2016-03-17T08:29:21.514+0100] [glassfish 4.1] [ERROR] [] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761514] [levelValue: 1000] [[
  L'élément du batch 0 insert into ressources_analyse (route_id, point_id, uri_ressource, id) values (NULL, 1723, NULL, 113) a été annulé. Appeler getNextException pour en connaître la cause.]]

[2016-03-17T08:29:21.514+0100] [glassfish 4.1] [WARN] [] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761514] [levelValue: 900] [[
  SQL Error: 0, SQLState: 23503]]

[2016-03-17T08:29:21.515+0100] [glassfish 4.1] [ERROR] [] [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761515] [levelValue: 1000] [[
  ERREUR: une instruction insert ou update sur la table « ressources_analyse » viole la contrainte de clé
étrangère « fk_ressources_analyse_point_analyse_id »
  Détail : La clé (point_id)=(1723) n'est pas présente dans la table « point_analyse ».]]

[2016-03-17T08:29:21.515+0100] [glassfish 4.1] [ERROR] [] [org.hibernate.engine.jdbc.batch.internal.BatchingBatch] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761515] [levelValue: 1000] [[
  HHH000315: Exception executing batch [could not execute batch]]]

[2016-03-17T08:29:21.517+0100] [glassfish 4.1] [WARNING] [enterprise_distributedtx.before_completion_excep] [javax.enterprise.resource.jta.com.sun.enterprise.transaction] [tid: _ThreadID=35 _ThreadName=http-listener-1(3)] [timeMillis: 1458199761517] [levelValue: 900] [[
  DTX5014: Caught exception in beforeCompletion() callback:
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch
    at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763)
    at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
    at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683)
    at org.hibernate.jpa.spi.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1882)
    at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:115)
    at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:50)
    at com.sun.enterprise.transaction.JavaEETransactionImpl.commit(JavaEETransactionImpl.java:452)
    at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:854)
    at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:719)
    at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4566)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2074)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2044)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    at com.sun.proxy.$Proxy317.testFk(Unknown Source)
    at com.okina.analysis.__EJB31_Generated__RouteBrutAnalyserService__Intf____Bean__.testFk(Unknown Source)
    at com.okina.resources.RoutesWS.testFk(RoutesWS.java:60)
    at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:136)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
    at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute batch
    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
    at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:132)
    at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:111)
    at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:163)
    at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:226)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:482)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:349)
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1222)
    at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:425)
    at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:110)
    ... 65 more
Caused by: java.sql.BatchUpdateException: L'élément du batch 0 insert into ressources_analyse (route_id, point_id, uri_ressource, id) values (NULL, 1723, NULL, 113) a été annulé. Appeler getNextException pour en connaître la cause.
    at