segator/proxylive

proxylive.jar failure

Closed this issue · 3 comments

Hey segator
I wanted to try your proxy live tool, used the docker repository - but the program doesn't start.
Could you please help?

Thank you very much!
ericdx

`root@77a0de0ca02a:/app# java -jar proxyLive.jar
( ( ) ) ) ( (
)\ ) )\ ) ( /( ( /( ( /( )\ ) )\ )
(()/( (()/( )()) )()) )()) (()/( (()/( ( ( (
___ ___ /()) /()) (()\ (()\ (()\ /()) /()) )\ )\ )\ ___ ___
|
| || ()) ()) (() (() __ (() ()) ()) (()(() (() || ||
| _ \ | _ \ / _ \ \ / / \ \ / / | | |
| \ \ / / | |
| / | / | () | > < \ V / | |
| | \ V / | |
|
| |
|
\ _
/ //_\ || || || _/ |_|

        (         )              (                         (                     (
   (    )\ )   ( /(      (       )\ )      (       (       )\ )    *   )         )\ )
 ( )\  (()/(   )\())     )\     (()/(      )\      )\     (()/(  ` )  /(   (    (()/(
 )((_)  /(_)) ((_)\   ((((_)(    /(_))   (((_)  ((((_)(    /(_))  ( )(_))  )\    /(_))
((_)_  (_))     ((_)   )\ _ )\  (_))_    )\___   )\ _ )\  (_))   (_(_())  ((_)  (_))
 | _ ) | _ \   / _ \   (_)_\(_)  |   \  ((/ __|  (_)_\(_) / __|  |_   _|  | __| | _ \
 | _ \ |   /  | (_) |   / _ \    | |) |  | (__    / _ \   \__ \    | |    | _|  |   /
 |___/ |_|_\   \___/   /_/ \_\   |___/    \___|  /_/ \_\  |___/    |_|    |___| |_|_\

2023-09-12T14:51:58,978 INFO [main] o.s.b.StartupInfoLogger: Starting Application v1.0-SNAPSHOT using Java 14.0.2 on 77a0de0ca02a with PID 10 (/app/proxyLive.jar started by root in /app)
2023-09-12T14:51:58,981 DEBUG [main] o.s.b.StartupInfoLogger: Running with Spring Boot v2.6.1, Spring v5.3.13
2023-09-12T14:51:58,981 INFO [main] o.s.b.SpringApplication: No active profile set, falling back to default profiles: default
2023-09-12T14:52:00,615 INFO [main] o.s.b.w.e.t.TomcatWebServer: Tomcat initialized with port(s): 8080 (http)
2023-09-12T14:52:00,628 INFO [main] o.a.j.l.DirectJDKLog: Initializing ProtocolHandler ["http-nio-8080"]
2023-09-12T14:52:00,628 INFO [main] o.a.j.l.DirectJDKLog: Starting service [Tomcat]
2023-09-12T14:52:00,629 INFO [main] o.a.j.l.DirectJDKLog: Starting Servlet engine: [Apache Tomcat/9.0.55]
2023-09-12T14:52:00,687 INFO [main] o.a.j.l.DirectJDKLog: Initializing Spring embedded WebApplicationContext
2023-09-12T14:52:00,688 INFO [main] o.s.b.w.s.c.ServletWebServerApplicationContext: Root WebApplicationContext: initialization completed in 1629 ms
2023-09-12T14:52:00,968 DEBUG [main] o.s.w.f.GenericFilterBean: Filter 'JWTBasicFilter' configured for use
2023-09-12T14:52:01,066 WARN [main] o.s.c.s.AbstractApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'frontendController' defined in URL [jar:file:/app/proxyLive.jar!/BOOT-INF/classes!/com/github/segator/proxylive/controller/FrontendController.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createChannelService' defined in class path resource [com/github/segator/proxylive/service/ChannelServiceFactory.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.segator.proxylive.service.ChannelService]: Factory method 'createChannelService' threw exception; nested exception is java.lang.NullPointerException
2023-09-12T14:52:01,071 INFO [main] o.a.j.l.DirectJDKLog: Stopping service [Tomcat]
2023-09-12T14:52:01,088 INFO [main] o.s.b.a.l.ConditionEvaluationReportLoggingListener:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-09-12T14:52:01,110 ERROR [main] o.s.b.SpringApplication: Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'frontendController' defined in URL [jar:file:/app/proxyLive.jar!/BOOT-INF/classes!/com/github/segator/proxylive/controller/FrontendController.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createChannelService' defined in class path resource [com/github/segator/proxylive/service/ChannelServiceFactory.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.segator.proxylive.service.ChannelService]: Factory method 'createChannelService' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
at com.github.segator.proxylive.Application.main(Application.java:38)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createChannelService' defined in class path resource [com/github/segator/proxylive/service/ChannelServiceFactory.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.segator.proxylive.service.ChannelService]: Factory method 'createChannelService' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 27 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.segator.proxylive.service.ChannelService]: Factory method 'createChannelService' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 41 common frames omitted
Caused by: java.lang.NullPointerException: null
at com.github.segator.proxylive.service.ChannelServiceFactory.createChannelService(ChannelServiceFactory.java:18)
at com.github.segator.proxylive.service.ChannelServiceFactory$$EnhancerBySpringCGLIB$$c7ea70df.CGLIB$createChannelService$0()
at com.github.segator.proxylive.service.ChannelServiceFactory$$EnhancerBySpringCGLIB$$c7ea70df$$FastClassBySpringCGLIB$$317817da.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.github.segator.proxylive.service.ChannelServiceFactory$$EnhancerBySpringCGLIB$$c7ea70df.createChannelService()
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 42 common frames omitted`

Can you provide your config yml?

I haven't got any 'config.yml' - just an 'application.yml'. Is this the file you were asking for?

This is my application.yml (tested docker image: segator/proxylive:sha-650c4fe docker run --name=proxylive -p 8080:8080 -v /proxylive/application.yml:/app/application.yml:ro segator/proxylive:sha-650c4fe

source:
    tvheadendURL: "http://xxxx:xxxxxxxxx@10.28.0.87:9981"
    channels:
        type: tvheadend
        refresh: 60 #In seconds
ffmpeg:
    #Path where proxylive can find ffmpeg binary
    path: '/usr/bin/ffmpeg'

    ##Profiles definition alias param is used in the view link, see (Url Definition) for more details of use profiles
    profiles:
        -
            alias: "aac"
            #FFmpeg parameters, check ffmpeg documentation for more info
            parameters: "-i {input} {channelParameters} -sn -ac 2 -c:a aac -b:a 320k -c:v copy"
        -
            alias: "240p"
            parameters: "-i {input} {channelParameters} -sn -c:a:0 aac -ac 2 -b:a 64k -c:v libx264 -tune zerolatency -g 10 -vprofile high -level 4.0 -crf 18 -movflags +faststart -bufsize 15000k -maxrate 300k  -preset veryslow -vf scale=-1:244,yadif=0"
        -
            alias: "360p"
            parameters: "-i {input} {channelParameters} -sn -c:a:0 aac -ac 2 -b:a 96k -c:v libx264 -tune zerolatency -g 10 -vprofile high -level 4.0 -crf 18 -movflags +faststart -bufsize 15000k -maxrate 700k  -preset veryslow -vf scale=-1:360,yadif=0"
        -
            alias: "480p"
            parameters: "-i {input} {channelParameters} -sn -c:a:0 aac -ac 2 -b:a 196k -c:v libx264 -tune zerolatency -g 10 -vprofile high -level 4.0 -crf 18 -movflags +faststart -bufsize 15000k -maxrate 1500k  -preset slow -vf scale=-1:484,yadif=0"
        -
            alias: "720p"
            parameters: "-i {input} {channelParameters} -sn  -c:a:0 aac -ac 2 -b:a 320k -c:v libx264 -tune zerolatency -g 10 -vprofile high -level 4.0 -crf 18 -movflags +faststart -bufsize 15000k -maxrate 3000k  -preset fast -vf scale=-1:720,yadif=0"
        -
            alias: "1080p"
            parameters:  "-i {input} {channelParameters} -sn  -c:a:0 aac -ac 2 -b:a 320k -c:v libx264 -tune zerolatency -g 300 -vprofile high -level 4.0 -movflags +faststart -bufsize 15000k -maxrate 5000k  -preset faster -vf yadif=0"
    mpegTS:
        parameters: "-threads 0 -f mpegts -mpegts_m2ts_mode 1 -mpegts_copyts 1 -mpegts_flags +resend_headers  "
		#Specific parameters for mpegTS(only works if a diferent profile than raw is selected, raw send direct data from backend so no transcoded, in this case not applied this parameter.
    hls:
        #by default HLS is disabled
        enabled: false
        tempPath: "/tmp"
		#Path where HLS will save segment files and playlist
        parameters: "-flags -global_header  -avoid_negative_ts disabled -map_metadata -1 -start_at_zero -copyts -flags -global_header -vsync cfr -y -nostats -f hls  -hls_time 2 -hls_list_size 10 -hls_wrap 20 -hls_allow_cache 0  -hls_flags +append_list -hls_flags +discont_start -hls_flags +delete_segments"
		#FFmpeg parameters specific for HLS
        timeout: 30
		#When user disconnect from stream, we doesnt have any way to be sure the user is totally disconnected so this parameter control how many seconds since last download of a segment of a concret stream, if the timeout is reached, the timeout is canceled.
buffers:
    #The max amount of bytes the application can read from a stream, default 1MB in a single action
    chunkSize: 1048576
    #Buffer size of the broadcast buffer,larger buffer more stable but larger delay than source stream, default 50MB
    broadcastBufferSize: 52428800`

Solved it:
The file wasn't properly formatted. I just copied the example application.yml from https://github.com/segator/proxylive and edited it. Even on the original page the incorrect yml format is highlighted in red. Could have seen that earlier - sorry!