[ 
https://issues.apache.org/jira/browse/ARIES-780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14709934#comment-14709934
 ] 

Elliot Huntington commented on ARIES-780:
-----------------------------------------

Updating the libraries fixed the ClassFormatError. I'm now using:

asm-all-5.0.4.jar
org.apache.aries.spifly.dynamic.bundle-1.0.2.jar
org.apache.aries.util-1.1.1.jar

Now everything starts appropriately, but my application is still not able to 
play an MP3 file. I must not have the headers set appropriately in the other 
bundles. 

Here are the headers for the bundles involved. Bundle id 5 is the provider 
bundle, and bundle id 2 is the consumer bundle:

g! headers 5
com.googlecode.soundlibs.mp3spi (5)
-----------------------------------
Archiver-Version = Plexus Archiver
Bnd-LastModified = 1440297369331
Build-Jdk = 1.6.0_21
Built-By = Patrik
Bundle-ManifestVersion = 2
Bundle-Name = com.googlecode.soundlibs.mp3spi
Bundle-SymbolicName = com.googlecode.soundlibs.mp3spi
Bundle-Version = 1.9.5
Created-By = 1.8.0_51 (Oracle Corporation)
Export-Package = 
javazoom.spi,javazoom.spi.mpeg.sampled.convert;uses:="javax.sound.sampled,javazoom.spi,javazoom.spi.mpeg.sampled.file.tag,org.tritonus.share.sampled.convert",javazoom.spi.mpeg.sampled.file;uses:="javax.sound.sampled,javazoom.spi.mpeg.sampled.file.tag,org.tritonus.share.sampled,org.tritonus.share.sampled.file",javazoom.spi.mpeg.sampled.file.tag
Import-Package = 
javax.sound.sampled;resolution:=optional,javazoom.jl.decoder;resolution:=optional,org.tritonus.share;resolution:=optional,org.tritonus.share.sampled;resolution:=optional,org.tritonus.share.sampled.convert;resolution:=optional,org.tritonus.share.sampled.file;resolution:=optional
Manifest-Version = 1.0
Originally-Created-By = Apache Maven
Require-Capability = osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
SPI-Provider = javax.sound.sampled.AudioSystem
Tool = Bnd-2.4.1.201501161927

g! headers 2
com.github.axiopisty.osgi.mp3spi.integration.mp3player (2)
----------------------------------------------------------
Bnd-LastModified = 1440444838009
Build-Jdk = 1.8.0_25
Built-By = elliot
Bundle-ManifestVersion = 2
Bundle-Name = com.github.axiopisty.osgi.mp3spi.integration.mp3player
Bundle-SymbolicName = com.github.axiopisty.osgi.mp3spi.integration.mp3player
Bundle-Version = 1.0.0.SNAPSHOT
Created-By = Apache Maven Bundle Plugin
Export-Package = 
com.github.axiopisty.osgi.mp3spi.integration.mp3player.api;uses:="javafx.application,javafx.stage";version="1.0.0"
Import-Package = 
javafx.application,javafx.collections,javafx.event,javafx.scene,javafx.scene.control,javafx.scene.input,javafx.scene.layout,javafx.stage,javax.sound.sampled
Manifest-Version = 1.0
Require-Capability = osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
SPI-Consumer = javax.sound.sampled.AudioSystem#getAudioInputStream
Tool = Bnd-2.4.1.201501161923



Based on the SPI Fly documentation page I updated the provider bundle to 
contain:
SPI-Provider: javax.sound.sampled.AudioSystem

and the consumer bundle to contain:
SPI-Consumer: javax.sound.sampled.AudioSystem#getAudioInputStream

Yet when I try to play an mp3 file it reports this error:
java.io.IOException: mark/reset not supported
        at java.io.InputStream.reset(InputStream.java:348)
        at 
com.sun.media.sound.SoftMidiAudioFileReader.getAudioInputStream(SoftMidiAudioFileReader.java:135)
        at 
javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1113)
        at 
com.github.axiopisty.osgi.mp3spi.integration.mp3player.internal.MP3Player.<init>(MP3Player.java:21)
        at 
com.github.axiopisty.osgi.mp3spi.integration.mp3player.api.Gui.lambda$getRoot$0(Gui.java:36)
        at 
com.github.axiopisty.osgi.mp3spi.integration.mp3player.api.Gui$$Lambda$70/564566100.handle(Unknown
 Source)
        at 
com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
        at 
com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at 
com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at 
com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at 
com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at 
com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at 
com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at 
com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3437)
        at javafx.scene.Scene$ClickGenerator.access$7900(Scene.java:3365)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3733)
        at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3452)
        at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1728)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2461)
        at 
com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:348)
        at 
com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:273)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:382)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:553)
        at com.sun.glass.ui.View.notifyMouse(View.java:925)


Do you notice anything wrong with the manifest headers that I should modify to 
get this working?

Thank you.





> problem getting mp3spi working with dynamic/static weaving
> ----------------------------------------------------------
>
>                 Key: ARIES-780
>                 URL: https://issues.apache.org/jira/browse/ARIES-780
>             Project: Aries
>          Issue Type: Question
>          Components: Subsystem
>    Affects Versions: parent-0.4.0
>         Environment: win7 x64, apache felix 4.0.1 and equinox 3.7.1
>            Reporter: oliver  z
>            Assignee: David Bosschaert
>            Priority: Minor
>
> I'm trying to build a modular player for sites like jamendo. The problem is 
> that the streaming format is in mp3 (or ogg sometimes). The librarys 
> providing such support try to use the SPI mechanism of the JRE which is a 
> problem in OSGi environments.
> So i'm really happy that this is adressed with SPI Fly - but its somehow not 
> working for me.
> I tried the dynamic weaving:
> added the asm bundle and the spi fly dynamic weaving bundle in the "bundle" 
> dir of apache felix (works fine, lb shows me that both bundles are running)
>    ID|State      |Level|Name
>     0|Active     |    0|System Bundle (4.0.1)
>     1|Active     |    1|ASM all classes (3.2.0)
>     2|Active     |    1|json simple OSGi Bundle (1.0.0.SNAPSHOT)
>     3|Active     |    1|Mp3Wrapper OSGi Bundle (1.0.0.SNAPSHOT)
>     4|Active     |    1|Apache Aries SPI Fly Dynamic Weaving Bundle 
> (0.4.0.SNAPSHOT)
> the mp3wrapper contains the spi providers (mp3spi, tritounus share etc. for 
> playing mp3 files - they replace AudioInputStream and some others), so i 
> added in the MANIFEST.MF in mp3wrapper the following header:
> SPI-Provider: *
> the consumer is my playerengine bundle which contains the following line in 
> its manifest:
> SPI-Consumer: *
> when i start the OSGi container i get the following:
> [BROWSER]: Standard Gui (Browser) registered.
> @@@ 1: <init>#()V#null~null
> ### 183: java/lang/Object#<init>#()V
> @@@ 1: start#(Lorg/osgi/framework/BundleContext;)V#null~[java/lang/Exception]
> ### 183: 
> org/dyndns/soundi/soundboxplayerengine/DefaultPlayerEngine#<init>#(Lorg/osgi/framework/BundleContext;)V
> ### 182: 
> org/dyndns/soundi/portals/interfaces/CommunicationAction#toString#()Ljava/lang/String;
> ### 182: 
> org/dyndns/soundi/portals/interfaces/CommunicationAction#toString#()Ljava/lang/String;
> ### 183: java/util/Hashtable#<init>#()V
> ### 182: 
> java/util/Dictionary#put#(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
> ### 182: java/lang/Class#getName#()Ljava/lang/String;
> ### 182: java/lang/Class#getName#()Ljava/lang/String;
> ### 185: 
> org/osgi/framework/BundleContext#registerService#([Ljava/lang/String;Ljava/lang/Object;Ljava/util/Dictionary;)L
> org/osgi/framework/ServiceRegistration;
> ### 184: 
> org/dyndns/soundi/utils/Util#sendMessage#(Lorg/dyndns/soundi/utils/Util$Component;Ljava/lang/String;)V
> @@@ 1: stop#(Lorg/osgi/framework/BundleContext;)V#null~[java/lang/Exception]
> @@@ 0: <init>#(Lorg/osgi/framework/BundleContext;)V#null~null
> ### 183: java/lang/Object#<init>#()V
> @@@ 1: 
> play#(Ljava/io/InputStream;Lorg/dyndns/soundi/portals/interfaces/Song;)V#null~null
> ### 184: 
> javax/sound/sampled/AudioSystem#getAudioFileTypes#()[Ljavax/sound/sampled/AudioFileFormat$Type;
> ### 182: 
> javax/sound/sampled/AudioFileFormat$Type#getExtension#()Ljava/lang/String;
> ### 182: java/io/PrintStream#println#(Ljava/lang/String;)V
> ### 183: java/io/BufferedInputStream#<init>#(Ljava/io/InputStream;)V
> ### 184: 
> javax/sound/sampled/AudioSystem#getAudioInputStream#(Ljava/io/InputStream;)Ljavax/sound/sampled/AudioInputStrea
> m;
> ### 182: java/lang/Class#getName#()Ljava/lang/String;
> ### 184: 
> java/util/logging/Logger#getLogger#(Ljava/lang/String;)Ljava/util/logging/Logger;
> ### 182: 
> java/util/logging/Logger#log#(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
> ### 182: java/lang/Class#getName#()Ljava/lang/String;
> ### 184: 
> java/util/logging/Logger#getLogger#(Ljava/lang/String;)Ljava/util/logging/Logger;
> ### 182: 
> java/util/logging/Logger#log#(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
> ### 182: 
> javax/sound/sampled/AudioInputStream#getFormat#()Ljavax/sound/sampled/AudioFormat;
> ### 182: javax/sound/sampled/AudioFormat#getSampleRate#()F
> ### 182: javax/sound/sampled/AudioFormat#getChannels#()I
> ### 182: javax/sound/sampled/AudioFormat#getChannels#()I
> ### 182: javax/sound/sampled/AudioFormat#getSampleRate#()F
> ### 183: 
> javax/sound/sampled/AudioFormat#<init>#(Ljavax/sound/sampled/AudioFormat$Encoding;FIIIFZ)V
> ### 184: 
> javax/sound/sampled/AudioSystem#getAudioInputStream#(Ljavax/sound/sampled/AudioFormat;Ljavax/sound/sampled/Audi
> oInputStream;)Ljavax/sound/sampled/AudioInputStream;
> ### 183: 
> org/dyndns/soundi/soundboxplayerengine/DefaultPlayerEngine#rawplay#(Ljavax/sound/sampled/AudioFormat;Ljavax/sou
> nd/sampled/AudioInputStream;Lorg/dyndns/soundi/portals/interfaces/Song;)V
> @@@ 1: pause#()V#null~null
> @@@ 1: stop#()V#null~null
> @@@ 1: handleEvent#(Lorg/osgi/service/event/Event;)V#null~null
> @@@ 2: 
> rawplay#(Ljavax/sound/sampled/AudioFormat;Ljavax/sound/sampled/AudioInputStream;Lorg/dyndns/soundi/portals/interf
> aces/Song;)V#null~null
> ### 183: 
> org/dyndns/soundi/soundboxplayerengine/DefaultPlayerEngine#getLine#(Ljavax/sound/sampled/AudioFormat;)Ljavax/so
> und/sampled/SourceDataLine;
> ### 185: javax/sound/sampled/SourceDataLine#start#()V
> ### 185: javazoom/spi/PropertiesContainer#properties#()Ljava/util/Map;
> ### 185: java/util/Map#get#(Ljava/lang/Object;)Ljava/lang/Object;
> ### 182: java/lang/Long#longValue#()J
> ### 185: java/util/Map#get#(Ljava/lang/Object;)Ljava/lang/Object;
> ### 182: java/lang/Long#longValue#()J
> ### 182: javax/sound/sampled/AudioInputStream#read#([BII)I
> ### 185: javax/sound/sampled/SourceDataLine#write#([BII)I
> ### 185: javax/sound/sampled/SourceDataLine#drain#()V
> ### 185: javax/sound/sampled/SourceDataLine#stop#()V
> ### 185: javax/sound/sampled/SourceDataLine#close#()V
> ### 182: java/lang/Exception#printStackTrace#()V
> @@@ 2: 
> getLine#(Ljavax/sound/sampled/AudioFormat;)Ljavax/sound/sampled/SourceDataLine;#null~[javax/sound/sampled/LineUna
> vailableException]
> ### 183: 
> javax/sound/sampled/DataLine$Info#<init>#(Ljava/lang/Class;Ljavax/sound/sampled/AudioFormat;)V
> ### 184: 
> javax/sound/sampled/AudioSystem#getLine#(Ljavax/sound/sampled/Line$Info;)Ljavax/sound/sampled/Line;
> ### 185: 
> javax/sound/sampled/SourceDataLine#open#(Ljavax/sound/sampled/AudioFormat;)V
> [PLAYERENGINE]: Default player engine registered!
> so it does *something*, but it looks like errors. I got a reply that this is 
> just debugging output and the functionality should work.
> But it does not. I wrote a little test in my playerengine bundle:
> Type[] audioFileTypes = AudioSystem.getAudioFileTypes();
>         for(Type a : audioFileTypes)
>         {
>             System.out.println(a.getExtension()); 
>         }
> if it would work, there should be:
> wav (provided by JRE)
> au (provided by JRE)
> aif (provided by JRE)
> mp3 (provided by mp3spi)
> but the last one is missing, i cannot play mp3s, i get an exception:
> 13.11.2011 09:23:05 
> org.dyndns.soundi.soundboxplayerengine.DefaultPlayerEngine play
> SCHWERWIEGEND: null
> javax.sound.sampled.UnsupportedAudioFileException: could not get audio input 
> stream from input stream
>         at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
>         at 
> org.dyndns.soundi.soundboxplayerengine.DefaultPlayerEngine.play(DefaultPlayerEngine.java:47)
>         at 
> org.dyndns.soundi.soundbox.core.gui.PlayerFrame.play(PlayerFrame.java:217)
>         at 
> org.dyndns.soundi.soundbox.core.gui.PlayerFrame.handleEvent(PlayerFrame.java:194)
>         at 
> org.apache.felix.eventadmin.impl.tasks.HandlerTaskImpl.execute(HandlerTaskImpl.java:88)
> maybe this is a bug? i'm not familiar with bytecode so i can't help nor go 
> deeper and check whats going on :(
> the complete framework with my bundles and asm/dynamic weaving (running 
> example) can be downloaded here (2.3mb):
> http://download.origo.ethz.ch/soundbox/3349/felix-framework-4.0.1.7z
> thanks in advance
> edit:
> to run the application:
> 1) java -jar bin\felix.jar 
>     then 2 windows should open 
>     wait a little bit until "Jamendo plugin initialized" appears
> 2) now go the textfield where "Enter a keyword..." stands 
>     enter something like "dire" and click on the "go" button
>     there should appear a list of songs in the table
> 3) click one so that it is marked and hit the button "add to player"
>     "add to player" tries to start the playback - the dynamic weaving happens 
> and the exception will be thrown
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to