Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ilkka/7541828 to your computer and use it in GitHub Desktop.

Select an option

Save ilkka/7541828 to your computer and use it in GitHub Desktop.
Here's how jetty:run fails if the native lib packaging is changed to dylib.
From 0fb3e83164a5228d4c98194ae225f4568292ed2c Mon Sep 17 00:00:00 2001
From: Ilkka Laukkanen <[email protected]>
Date: Tue, 19 Nov 2013 09:53:41 +0200
Subject: [PATCH] Change references to .so libs to .dylib
---
native-jar/pom.xml | 8 ++++----
native/pom.xml | 2 +-
pom.xml | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/native-jar/pom.xml b/native-jar/pom.xml
index 844b542..cd14973 100644
--- a/native-jar/pom.xml
+++ b/native-jar/pom.xml
@@ -43,10 +43,10 @@
<groupId>jahspotify</groupId>
<artifactId>libjahspotify</artifactId>
<version>0.0.1-SNAPSHOT</version>
- <type>so</type>
+ <type>dylib</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
- <destFileName>libjahspotify.so</destFileName>
+ <destFileName>libjahspotify.dylib</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
@@ -69,11 +69,11 @@
<dependency>
<groupId>jahspotify</groupId>
<artifactId>libjahspotify</artifactId>
- <type>so</type>
+ <type>dylib</type>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git a/native/pom.xml b/native/pom.xml
index 022be78..7617083 100644
--- a/native/pom.xml
+++ b/native/pom.xml
@@ -44,7 +44,7 @@
<linkeropts>-lspotify -lc -ldl -framework OpenAL</linkeropts>
<compilerparams>${additional.includes}</compilerparams>
<artifact>libjahspotify</artifact>
- <packaging>so</packaging>
+ <packaging>dylib</packaging>
<additional.includes>-I/System/Library/Frameworks/JavaVM.framework/Headers -I${java.home}/../include -I${java.home}../include/darwin -I/System/Library/Frameworks/OpenAL.framework/Headers</additional.includes>
</properties>
</profile>
diff --git a/pom.xml b/pom.xml
index 37b0b68..e4311a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,7 +73,7 @@
<groupId>jahspotify</groupId>
<artifactId>libjahspotify</artifactId>
<version>0.0.1-SNAPSHOT</version>
- <type>so</type>
+ <type>dylib</type>
</dependency>
<dependency>
--
1.8.4.2
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for jahspotify:jahspotify-web:war:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ line 46, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jahspotify-web 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-jetty-plugin:6.1.25:run (default-cli) @ jahspotify-web >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jahspotify-web ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ jahspotify-web ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jahspotify-web ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/ilau/Documents/leap/jahspotify/web/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jahspotify-web ---
[INFO] No sources to compile
[INFO]
[INFO] <<< maven-jetty-plugin:6.1.25:run (default-cli) @ jahspotify-web <<<
[INFO]
[INFO] --- maven-jetty-plugin:6.1.25:run (default-cli) @ jahspotify-web ---
[INFO] Configuring Jetty for project: jahspotify-web
[INFO] Webapp source directory = /Users/ilau/Documents/leap/jahspotify/web/src/main/webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = /Users/ilau/Documents/leap/jahspotify/web/target/classes
[INFO] Logging to org.slf4j.impl.SimpleLogger(org.mortbay.log) via org.mortbay.log.Slf4jLog
[INFO] Context path = /jahspotify
[INFO] Tmp directory = determined at runtime
[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = /Users/ilau/Documents/leap/jahspotify/web/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = /Users/ilau/Documents/leap/jahspotify/web/src/main/webapp
[INFO] Starting jetty 6.1.25 ...
[INFO] jetty-6.1.25
[INFO] No Transaction manager found - if your webapp requires one, please configure one.
[INFO] Initializing Spring root WebApplicationContext
09:52:24,118 INFO ContextLoader:273 - Root WebApplicationContext: initialization started
09:52:24,180 INFO XmlWebApplicationContext:495 - Refreshing Root WebApplicationContext: startup date [Tue Nov 19 09:52:24 EET 2013]; root of context hierarchy
09:52:24,222 INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/config/web-application-config.xml]
09:52:24,400 INFO ClassPathBeanDefinitionScanner:210 - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
09:52:24,447 INFO ClassPathBeanDefinitionScanner:210 - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
09:52:24,479 INFO ClassPathBeanDefinitionScanner:210 - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
09:52:24,550 INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/config/spring-servlet.xml]
09:52:24,888 INFO PropertyPlaceholderConfigurer:177 - Loading properties file from class path resource [jahspotify.properties]
09:52:24,889 INFO PropertyPlaceholderConfigurer:177 - Loading properties file from class path resource [jahspotify-override.properties]
09:52:24,890 WARN PropertyPlaceholderConfigurer:198 - Could not load properties from class path resource [jahspotify-override.properties]: class path resource [jahspotify-override.properties] cannot be opened because it does not exist
09:52:24,904 INFO AutowiredAnnotationBeanPostProcessor:139 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
09:52:24,915 INFO DefaultListableBeanFactory:557 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4ee6065d: defining beans [fileMediaStorage,inMemoryMediaStorage,mongoDBMediaStorage,inMemoryHistoricalStorage,mongoDBHistoricalStorage,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,echoNestService,echoNestSpotifyBridge,historyCollector,jahSpotifyService,mediaPlayer,nuanceManager,queueManager,RSSFeedManager,searchEngine,shuffler,albumController,artistController,configurationController,historyController,imageController,mediaController,mediaPlayerController,playlistController,queueController,searchController,serverBroadcaster,systemController,trackController,historyBrowswerUIController,mediaBrowserUIController,queueBrowserUIController,searchMediaUIController,serverSettingsUIController,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#2,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#2,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#3,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#3,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#4,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#4,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#5,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#5,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#6,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#6,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,jacksonMessageConverter,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0,JahSpotify]; root of factory hierarchy
09:52:24,960 DEBUG MongoDBMediaStorage:49 - Initializing Mongo DB instance
09:52:25,588 INFO JNILibraryLoader:196 - Extraction Directory: /var/folders/r6/0j2_t76s7vb5ndrdlnb42l840000gn/T/
09:52:25,589 INFO JNILibraryLoader:197 - Leave Extracted Resources: Enabled
09:52:25,590 INFO JNILibraryLoader:198 - Overwrite Existing Resources: Enabled
09:52:25,591 WARN JNILibraryLoader:115 - Output file for resource 'libjahspotify.dylib' located at '/var/folders/r6/0j2_t76s7vb5ndrdlnb42l840000gn/T/libjahspotify.dylib' already exists
09:52:25,591 WARN JNILibraryLoader:119 - Will proceed to overwrite existing resource
09:52:25,592 DEBUG JNILibraryLoader:137 - Extracting 'libjahspotify.dylib' to '/var/folders/r6/0j2_t76s7vb5ndrdlnb42l840000gn/T/libjahspotify.dylib'
09:52:25,594 DEBUG JNILibraryLoader:145 - Resource extraction completed, 101584 bytes successfully read
09:52:25,604 DEBUG NativeLogger:48 - [jnihelpers::JNI_OnLoad] vm: 0xd363f98 env: 0x1b8011e8
09:52:25,606 DEBUG NativeLogger:48 - [jahspotify::JNI_OnLoad] Exiting (result=0x10004)
09:52:25,607 DEBUG NativeLogger:48 - [jahspotify::registerNativeMediaLoadedListener] Registered media loaded listener: 0x1a4114c0
09:52:25,608 DEBUG NativeLogger:48 - [jahspotify::registerNativeSearchCompleteListener] Registered search complete listener: 0x1a4114b8
09:52:25,609 DEBUG NativeLogger:48 - [jahspotify::registerNativePlaybackListener] Registered playback listener: 0x1a4114b0
09:52:25,610 DEBUG NativeLogger:48 - [jahspotify::registerNativeLibraryListener] Registered playlist listener: 0x1a4114a8
09:52:25,611 DEBUG NativeLogger:48 - [jahspotify::registerNativeConnectionListener] Registered connection listener: 0x1a4114a0
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000119bf75c8, pid=68575, tid=25859
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libspotify.12.1.51.dylib+0x1325c8] sp_session_set_private_session+0x1c8
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/ilau/Documents/leap/jahspotify/web/hs_err_pid68575.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
@nahojkap
Copy link
Copy Markdown

Could you double check the JahSpotify directory exists - it is currently defaulted to /var/lib/jahspotify which may or may not be writable.

It should in theory be changed to use something more sensible but it is a small project at the moment.

johan

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