Changing sharing link domain name

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

Changing sharing link domain name

Postby dsync89 » Wed Oct 24, 2012 4:26 pm

Hi, I was wondering is it possible to change the domain name that is used when sharing the link? I read somewhere about how to achieve this but it would require changing the source code.

Thanks for being actively participating in the discussion here hakko.
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Wed Oct 24, 2012 5:26 pm

Yeah, the current situation is as follows:

- if you've registered for a *.subsonic.org name, that is used
- if you haven't registered, an attempt to look up your current host name is made, and if not available, your IP address is used

So if you've signed up for a real DNS service, there's no option to always use that for the newly created links. jacobthe4th asked for the same thing a while ago, it's not a bad idea having it as a personal option to choose how to create the domain part of the URL. But not possible right now without changing the code.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby dsync89 » Thu Oct 25, 2012 12:20 am

Thanks for the prompt reply. As a follow up to your answer, is it possible for us to modify the source code ourselves? What I see is only the class files instead of the .java source files.
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Thu Oct 25, 2012 7:57 am

You can find the source via both http://dilerium.se/musiccabinet/ and the About view in Subsonic.

It's available via https://github.com/hakko/subsonic with instructions on how to compile and build your own subsonic.war, but it takes some work on your part (learning a bit of Git, Maven, Java and Postgresql).
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby dsync89 » Thu Oct 25, 2012 11:19 am

I see. Thanks for letting me know. I had downloaded the source code but couldn't find any instruction on how to compile them on Mac, only Windows http://sourceforge.net/apps/mediawiki/subsonic/index.php?title=Windows_Source. :(

Also, I downloaded two files which are hakko-musiccabinet-8b7152f and hakko-subsonic-30389b6. Which one should I compile and should I overwrite the source code in musiccabinet into subsonic?
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Thu Oct 25, 2012 11:53 am

If you scroll down on the github link, there are building instructions: https://github.com/hakko/subsonic#building

You need some knowledge of the version control system I use for keeping track of the source code, Git. Where it says "Clone git@github.com:hakko/musiccabinet.git", it assumes that you're familiar with Git, and know how to use it for at least checking out code. if not, you can read up here: http://git-scm.com/ and here: http://learn.github.com/p/intro.html. It's very useful knowledge, try setting up a small project for something you're working on and learn how you can keep track of different versions of files, going back in time to previous versions, don't risk overwriting or losing all your work on a hard drive failure etc!

Git, Maven, Java and PostgreSQL all run on a Mac.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby dsync89 » Thu Oct 25, 2012 2:38 pm

Thanks for the instruction. I had try to execute mvn install on music-cabinet but got the following error:
Results :

Code: Select all
Failed tests:
  userWithoutCredentialsCannotLogIn(com.github.hakko.musiccabinet.dao.jdbc.JdbcDatabaseAdministrationDaoEnvironmentDependentTest)

Tests in error:
  findsArtists(com.github.hakko.musiccabinet.service.LibraryBrowserServiceTest): StatementCallback; SQL [select library.add_to_library()]; ERROR: duplicate key value violates unique constraint "fileheader_fileid"
  Detail: Key (file_id)=(2203) already exists.
  Where: SQL statement "insert into library.fileheader (file_id, type_id, bitrate, vbr, duration)
   select file_id, type_id, bitrate, vbr, duration
      from library.file_headertag_import"
PL/pgSQL function library.add_to_library() line 181 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "fileheader_fileid"
  Detail: Key (file_id)=(2203) already exists.
  Where: SQL statement "insert into library.fileheader (file_id, type_id, bitrate, vbr, duration)
   select file_id, type_id, bitrate, vbr, duration
      from library.file_headertag_import"
PL/pgSQL function library.add_to_library() line 181 at SQL statement
  findsAlbums(com.github.hakko.musiccabinet.service.LibraryBrowserServiceTest): StatementCallback; SQL [select library.add_to_library()]; ERROR: duplicate key value violates unique constraint "fileheader_fileid"
  Detail: Key (file_id)=(2216) already exists.
  Where: SQL statement "insert into library.fileheader (file_id, type_id, bitrate, vbr, duration)
   select file_id, type_id, bitrate, vbr, duration
      from library.file_headertag_import"
PL/pgSQL function library.add_to_library() line 181 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "fileheader_fileid"
  Detail: Key (file_id)=(2216) already exists.
  Where: SQL statement "insert into library.fileheader (file_id, type_id, bitrate, vbr, duration)
   select file_id, type_id, bitrate, vbr, duration
      from library.file_headertag_import"
PL/pgSQL function library.add_to_library() line 181 at SQL statement

Tests run: 288, Failures: 1, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:27.104s
[INFO] Finished at: Thu Oct 25 22:33:57 MYT 2012
[INFO] Final Memory: 9M/144M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project musiccabinet-server: There are test failures.
[ERROR]
[ERROR] Please refer to /Volumes/Macintosh HD/Users/dsync/Documents/Git Workspace/musiccabinet/musiccabinet-server/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


And here is the error from postgres console after the initial and second run.
First run error:
Code: Select all
FATAL:  database "musiccabinet-test" does not exist
...
ERROR:  schema "util" does not exist at character 28
STATEMENT:  select max(update_id) from util.musiccabinet_version
...
ERROR:  null value in column "tag_id" violates not-null constraint
DETAIL:  Failing row contains (null, 34, 0).
CONTEXT:  SQL statement "insert into music.tagtopartist (tag_id, artist_id, rank)
      select tag_id, artist_id, rank from music.tagtopartist_import"
   PL/pgSQL function music.update_tagtopartists() line 25 at SQL statement
STATEMENT:  select music.update_tagtopartists()
ERROR:  null value in column "tag_id" violates not-null constraint
DETAIL:  Failing row contains (null, 39, 0).
CONTEXT:  SQL statement "insert into music.tagtopartist (tag_id, artist_id, rank)
      select tag_id, artist_id, rank from music.tagtopartist_import"
   PL/pgSQL function music.update_tagtopartists() line 25 at SQL statement
STATEMENT:  select music.update_tagtopartists()
ERROR:  null value in column "tag_id" violates not-null constraint
DETAIL:  Failing row contains (null, 44, 0).
CONTEXT:  SQL statement "insert into music.tagtopartist (tag_id, artist_id, rank)
      select tag_id, artist_id, rank from music.tagtopartist_import"
   PL/pgSQL function music.update_tagtopartists() line 25 at SQL statement
STATEMENT:  select music.update_tagtopartists()
FATAL:  sorry, too many clients already
...


Second run error:
Code: Select all
ERROR:  duplicate key value violates unique constraint "fileheader_fileid"
DETAIL:  Key (file_id)=(2203) already exists.
CONTEXT:  SQL statement "insert into library.fileheader (file_id, type_id, bitrate, vbr, duration)
      select file_id, type_id, bitrate, vbr, duration
         from library.file_headertag_import"
   PL/pgSQL function library.add_to_library() line 181 at SQL statement
STATEMENT:  select library.add_to_library()
ERROR:  duplicate key value violates unique constraint "fileheader_fileid"
DETAIL:  Key (file_id)=(2216) already exists.
CONTEXT:  SQL statement "insert into library.fileheader (file_id, type_id, bitrate, vbr, duration)
      select file_id, type_id, bitrate, vbr, duration
         from library.file_headertag_import"
   PL/pgSQL function library.add_to_library() line 181 at SQL statement
STATEMENT:  select library.add_to_library()


When building subsonic-main by executing mvn package.
Code: Select all
[INFO] ------------------------------------------------------------------------
[INFO] Building Subsonic Main 0.7
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.github.hakko.musiccabinet:musiccabinet-server:jar:0.7.12 is missing, no dependency information available
[WARNING] The POM for net.sbbi:sbbi-upnplib:jar:1.0.4 is missing, no dependency information available
[WARNING] The POM for org.wetorrent:weupnp:jar:2009-10-16 is missing, no dependency information available
[WARNING] The POM for com.hoodcomputing:natpmp:jar:0.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.024s
[INFO] Finished at: Thu Oct 25 22:46:17 MYT 2012
[INFO] Final Memory: 7M/87M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project subsonic-main: Could not resolve dependencies for project net.sourceforge.subsonic:subsonic-main:war:0.7: The following artifacts could not be resolved: com.github.hakko.musiccabinet:musiccabinet-server:jar:0.7.12, net.sbbi:sbbi-upnplib:jar:1.0.4, org.wetorrent:weupnp:jar:2009-10-16, com.hoodcomputing:natpmp:jar:0.1: Failure to find com.github.hakko.musiccabinet:musiccabinet-server:jar:0.7.12 in http://repository.springsource.com/maven/bundles/release was cached in the local repository, resolution will not be reattempted until the update interval of com.springsource.repository.bundles.release has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Thu Oct 25, 2012 2:48 pm

It looks like you're running Maven 3 and not Maven 2 as per https://github.com/hakko/subsonic#building. This is a bit confusing, but they changed how resource files are copied during test phase, and I haven't adjusted the test cases.

database "musiccabinet-test" does not exist looks like you haven't run mvn exec:java -Dexec.mainClass=com.github.hakko.musiccabinet.service.DatabaseAdministrationService as per the building instructions.

FATAL: sorry, too many clients already looks like you've connected multiple times with different Maven builds and PostgreSQL hasn't disconnected earlier connections yet, so the connection pool gets full. You can force-shutdown earlier connections using the pgAdmin III tool. Connect to the musiccabinet-test database and choose menu option Tools - Server Status.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby hakko » Thu Oct 25, 2012 2:54 pm

And the subsonic-main package can't be built until you've run mvn install successfully on the musiccabinet project, as it depends on having a compiled library for it.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby dsync89 » Thu Oct 25, 2012 3:13 pm

After changing to maven2 the number of errors is decreased to the following when executing mvn install on music-cabinet
Code: Select all
Results :

Failed tests:
  userWithoutCredentialsCannotLogIn(com.github.hakko.musiccabinet.dao.jdbc.JdbcDatabaseAdministrationDaoEnvironmentDependentTest)

Tests run: 288, Failures: 1, Errors: 0, Skipped: 0
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Thu Oct 25, 2012 3:41 pm

Interesting, I haven't seen that happen before. Maybe the test is environment dependent after all, I can't verify myself on a Mac right now. Easiest workarounds:

- try running mvn -fn install, to ignore failed tests (bad habit!)
- try removing the @Test line just before the method userWithoutCredentialsCannotLogIn, in JdbcDatabaseAdministrationDaoEnvironmentDependentTest.java, to remove it from the test suite
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby dsync89 » Thu Oct 25, 2012 3:49 pm

I guess it's environment dependant. I'm removing the @test and the build succeeded now. Will report more updates here.

There is now another build error when executing mvn package on subsonic-main:
Code: Select all
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.hoodcomputing:natpmp:jar:0.1

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.hoodcomputing -DartifactId=natpmp -Dversion=0.1 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.hoodcomputing -DartifactId=natpmp -Dversion=0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
     1) net.sourceforge.subsonic:subsonic-main:war:0.7
     2) com.hoodcomputing:natpmp:jar:0.1

2) net.sbbi:sbbi-upnplib:jar:1.0.4

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=net.sbbi -DartifactId=sbbi-upnplib -Dversion=1.0.4 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=net.sbbi -DartifactId=sbbi-upnplib -Dversion=1.0.4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
     1) net.sourceforge.subsonic:subsonic-main:war:0.7
     2) net.sbbi:sbbi-upnplib:jar:1.0.4

3) org.wetorrent:weupnp:jar:2009-10-16

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.wetorrent -DartifactId=weupnp -Dversion=2009-10-16 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.wetorrent -DartifactId=weupnp -Dversion=2009-10-16 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
     1) net.sourceforge.subsonic:subsonic-main:war:0.7
     2) org.wetorrent:weupnp:jar:2009-10-16

----------
3 required artifacts are missing.

for artifact:
  net.sourceforge.subsonic:subsonic-main:war:0.7

from the specified remote repositories:
  com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release),
  java_net (http://download.java.net/maven/2/),
  com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external),
  central (http://repo1.maven.org/maven2),
  oss-sonatype-snapshots (http://oss.sonatype.org/content/repositories/snapshots),
  jetty-releases (http://oss.sonatype.org/content/repositories/jetty-releases),
  local1 (file:repo),
  local2 (file:../repo)
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Thu Oct 25, 2012 4:08 pm

That's trickier, those are all libraries referenced by Sindre, I had no idea the references didn't work anymore (the references were probably valid the first time I built Sindre's code, and since then, they've stayed copied locally on my machine).

I have to look into updated version for them. The easiest fix I can think of is to take an existing subsonic.war, rename it to subsonic.zip, unzip it, and go to WEB-INF/lib. There are the compiled, missing .jar files.

Follow the maven guideline on how to install them:
Code: Select all
mvn install:install-file -DgroupId=com.hoodcomputing -DartifactId=natpmp -Dversion=0.1 -Dpackaging=jar -Dfile=/path/to/file
mvn install:install-file -DgroupId=net.sbbi -DartifactId=sbbi-upnplib -Dversion=1.0.4 -Dpackaging=jar -Dfile=/path/to/file
mvn install:install-file -DgroupId=org.wetorrent -DartifactId=weupnp -Dversion=2009-10-16 -Dpackaging=jar -Dfile=/path/to/file


This kind of should be reported to Sindre.. but the odds of getting a fast reply on that are fairly low, I'd say.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Changing sharing link domain name

Postby dsync89 » Fri Oct 26, 2012 1:26 pm

Finally this forum had alive, I had been wanting to post my updates here after trying it out this morning.

I come bearing both good news and the not so good news though.

The good news is that I am able to compile both successfully. But the not so good news is that I am given the following error message when I try to visit the page.

Code: Select all
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.IllegalStateException: !(Jetty || Servlet 3.0 || ContinuationFilter)
   org.eclipse.jetty.continuation.ContinuationSupport.getContinuation(ContinuationSupport.java:149)
   org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:247)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
   org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
   org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
   org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
   org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
   org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
   net.sourceforge.subsonic.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:43)
   net.sourceforge.subsonic.filter.ParameterDecodingFilter.doFilter(ParameterDecodingFilter.java:54)
   net.sourceforge.subsonic.filter.BootstrapVerificationFilter.doFilter(BootstrapVerificationFilter.java:54)


Also now I am asked to Upgrade the database when I try to scan the library. But clicking it doesn't seem to have any effect. I wonder why is this happen.

I really appreciate your help so far hakko for assisting me in this issue.
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Changing sharing link domain name

Postby hakko » Fri Oct 26, 2012 5:14 pm

The first error looks like your subsonic.war is newer than your subsonic-booter-jar-with-dependencies.jar (I think it's called that?). Did you build a new booter jar as per the two last build instructions:
cd $workspace/subsonic/subsonic-booter
mvn package

and then copy the resulting file from target/ to your install dir?

You could also build a compatible subsonic.war by running mvn -P tomcat clean package in the subsonic-main directory.

Try that first. I've added some features in the code base that haven't been posted here yet but they shouldn't cause any trouble...
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Next

Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 5 guests