New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is this working ? #1

Closed
carcabot opened this Issue Feb 25, 2016 · 12 comments

Comments

Projects
None yet
2 participants
@carcabot

carcabot commented Feb 25, 2016

hello,

is this working ? can you provide a way to install this on a webserver ?
thanks

@hanneslowette

This comment has been minimized.

Show comment
Hide comment
@hanneslowette

hanneslowette Feb 25, 2016

Owner

I have revised the code onto my other account (where my code/commits are rather sloppy) into a Spring controller here: https://github.com/hanz0r/ytmp3-controller. You can just set Maven to package it as a war file and you can use it with any Spring capable application server, or you can use use it as-is and run it with the Spring boot option.
The only issue with it is that it behaves oddly when the request is done from a different machine. I believe the fix is rather easy, but I currently do not have the time to fix this.

PS: I accidentally uploaded some Eclipse/configuration files and the target folder as it was very late when I did the commit, you can ignore those :P.

Owner

hanneslowette commented Feb 25, 2016

I have revised the code onto my other account (where my code/commits are rather sloppy) into a Spring controller here: https://github.com/hanz0r/ytmp3-controller. You can just set Maven to package it as a war file and you can use it with any Spring capable application server, or you can use use it as-is and run it with the Spring boot option.
The only issue with it is that it behaves oddly when the request is done from a different machine. I believe the fix is rather easy, but I currently do not have the time to fix this.

PS: I accidentally uploaded some Eclipse/configuration files and the target folder as it was very late when I did the commit, you can ignore those :P.

@carcabot

This comment has been minimized.

Show comment
Hide comment
@carcabot

carcabot Feb 25, 2016

I've tried to do what you said , but seems that with ytmp3-controller tomcat is crashing and cannot run, and for youtube-mp3-api i can't compile it as war...

carcabot commented Feb 25, 2016

I've tried to do what you said , but seems that with ytmp3-controller tomcat is crashing and cannot run, and for youtube-mp3-api i can't compile it as war...

@hanneslowette

This comment has been minimized.

Show comment
Hide comment
@hanneslowette

hanneslowette Feb 25, 2016

Owner

The youtube-mp3-api is just a normal Java application, it's not a web application. The ytmp3-controller is a maven spring-boot project. You can run it with mvn spring-boot:run or run the Application class and it should start a Tomcat server on the port specified in application.properties. You can change the packaging in the pom file to war if you want to compile it to a war file so you can upload it to a Tomcat server yourself.

Owner

hanneslowette commented Feb 25, 2016

The youtube-mp3-api is just a normal Java application, it's not a web application. The ytmp3-controller is a maven spring-boot project. You can run it with mvn spring-boot:run or run the Application class and it should start a Tomcat server on the port specified in application.properties. You can change the packaging in the pom file to war if you want to compile it to a war file so you can upload it to a Tomcat server yourself.

@carcabot

This comment has been minimized.

Show comment
Hide comment
@carcabot

carcabot Feb 25, 2016

yes i know , but still get errors on compilation

[INFO] --- spring-boot-maven-plugin:1.2.5.RELEASE:run (default-cli) @ musicbot ---
[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:78)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
        at org.hannes.musicbot.util.Bootstrap.load(Bootstrap.java:30)
        at org.hannes.musicbot.App.main(App.java:29)
        ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.011 s
[INFO] Finished at: 2016-02-25T14:15:46+01:00
[INFO] Final Memory: 20M/448M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.2.5.RELEASE:run (default-cli) on project musicbot: An exception occured while running. null: InvocationTargetException: NullPointerException -> [Help 1]

carcabot commented Feb 25, 2016

yes i know , but still get errors on compilation

[INFO] --- spring-boot-maven-plugin:1.2.5.RELEASE:run (default-cli) @ musicbot ---
[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:78)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
        at org.hannes.musicbot.util.Bootstrap.load(Bootstrap.java:30)
        at org.hannes.musicbot.App.main(App.java:29)
        ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.011 s
[INFO] Finished at: 2016-02-25T14:15:46+01:00
[INFO] Final Memory: 20M/448M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.2.5.RELEASE:run (default-cli) on project musicbot: An exception occured while running. null: InvocationTargetException: NullPointerException -> [Help 1]
@hanneslowette

This comment has been minimized.

Show comment
Hide comment
@hanneslowette

hanneslowette Feb 25, 2016

Owner

Do you have the javascript file in your resource path?

Owner

hanneslowette commented Feb 25, 2016

Do you have the javascript file in your resource path?

@carcabot

This comment has been minimized.

Show comment
Hide comment
@carcabot

carcabot Feb 25, 2016

I just cloned your repository, if you have it then it must be there...

-rw-r--r-- 1 root root   88 Feb 25 14:17 application.properties
-rw-r--r-- 1 root root 2832 Feb 25 14:17 client.js
drwxr-xr-x 5 root root 4096 Feb 25 14:17 static
root@local:~/ytmp3-controller/src/main/resources#

seems that is there.

How about the other one , i've tried to run it with java and i get error

root@local:~/youtube-mp3-api/youtubemp3# java -jar target/youtubemp3-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
        at org.hannes.youtubemp3.App.<clinit>(App.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 1 more

carcabot commented Feb 25, 2016

I just cloned your repository, if you have it then it must be there...

-rw-r--r-- 1 root root   88 Feb 25 14:17 application.properties
-rw-r--r-- 1 root root 2832 Feb 25 14:17 client.js
drwxr-xr-x 5 root root 4096 Feb 25 14:17 static
root@local:~/ytmp3-controller/src/main/resources#

seems that is there.

How about the other one , i've tried to run it with java and i get error

root@local:~/youtube-mp3-api/youtubemp3# java -jar target/youtubemp3-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
        at org.hannes.youtubemp3.App.<clinit>(App.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 1 more
@hanneslowette

This comment has been minimized.

Show comment
Hide comment
@hanneslowette

hanneslowette Feb 25, 2016

Owner

I have committed a cheap hack so that at least it runs now... I don't know how it broke as I still use the application (even though I don't develop it any further) almost daily.

Owner

hanneslowette commented Feb 25, 2016

I have committed a cheap hack so that at least it runs now... I don't know how it broke as I still use the application (even though I don't develop it any further) almost daily.

@carcabot

This comment has been minimized.

Show comment
Hide comment
@carcabot

carcabot Feb 25, 2016

Ok, i've succeeded to build and run it but seems that downloader is not working any more.

carcabot commented Feb 25, 2016

Ok, i've succeeded to build and run it but seems that downloader is not working any more.

@hanneslowette

This comment has been minimized.

Show comment
Hide comment
@hanneslowette

hanneslowette Feb 25, 2016

Owner

Can you tell me what the error is? I have just tried it and I got it to download the file I needed it to. Did you go to http://localhost:8080/music.html?

Owner

hanneslowette commented Feb 25, 2016

Can you tell me what the error is? I have just tried it and I got it to download the file I needed it to. Did you go to http://localhost:8080/music.html?

@carcabot

This comment has been minimized.

Show comment
Hide comment
@carcabot

carcabot Feb 25, 2016

      <html><head><title>not found</title></head><body>
        <h1>Not Found</h1>
        <p>Please retry your last action at <a href="http://www.youtube-mp3.org/"><b>http://www.youtube-mp3.org/</b></a>
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          ga('create', 'UA-9749996-5', 'auto');
          ga('send', 'pageview');
        </script>
        </body></html>

I guess this is because the referer must be their website , which you can't do that from javascript.

carcabot commented Feb 25, 2016

      <html><head><title>not found</title></head><body>
        <h1>Not Found</h1>
        <p>Please retry your last action at <a href="http://www.youtube-mp3.org/"><b>http://www.youtube-mp3.org/</b></a>
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          ga('create', 'UA-9749996-5', 'auto');
          ga('send', 'pageview');
        </script>
        </body></html>

I guess this is because the referer must be their website , which you can't do that from javascript.

@hanneslowette

This comment has been minimized.

Show comment
Hide comment
@hanneslowette

hanneslowette Feb 25, 2016

Owner

I think that is where I closed the project because I didn't have time to investigate it a bit further, but I think it has something to do with the requestor id. I figure if you can just include it in the rest call you should be able to get it working.
It works 100% like it should on localhost, it's just that when you put the web service remotely it starts working only sometimes.

Owner

hanneslowette commented Feb 25, 2016

I think that is where I closed the project because I didn't have time to investigate it a bit further, but I think it has something to do with the requestor id. I figure if you can just include it in the rest call you should be able to get it working.
It works 100% like it should on localhost, it's just that when you put the web service remotely it starts working only sometimes.

@carcabot

This comment has been minimized.

Show comment
Hide comment
@carcabot

carcabot Feb 25, 2016

Ok, thanks for your effort , i got it working

carcabot commented Feb 25, 2016

Ok, thanks for your effort , i got it working

@carcabot carcabot closed this Feb 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment