I've been testing a Java library that works in both PC and Android platforms, a few time ago someone here told me to use JLayer. Today I was happily coding and then this exception showed up:
java.lang.ExceptionInInitializerError
at javazoom.jl.decoder.SynthesisFilter.load_d(Unknown Source)
at javazoom.jl.decoder.SynthesisFilter.<init>(Unknown Source)
at javazoom.jl.decoder.Decoder.initialize(Unknown Source)
at javazoom.jl.decoder.Decoder.decodeFrame(Unknown Source)
at javazoom.jl.player.Player.decodeFrame(Unknown Source)
at javazoom.jl.player.Player.play(Unknown Source)
at javazoom.jl.player.Player.play(Unknown Source)
at Main.Play(Main.java:23)
at Main.main(Main.java:164)
Caused by: java.io.IOException: unable to load resource 'sfd.ser'
at javazoom.jl.decoder.JavaLayerUtils.deserializeArrayResource(Unknown Source)
... 9 more
I've tried to google the cause for this exception with no results, so I come here begging for your help.
This is the function where I'm trying to play the audio file:
public static void Play()
{
try
{
InputStream fis = new FileInputStream("L://POO//MyWS//WakeUp!//Back in black.mp3");
Player p = new Player(fis);
p.play();
}
catch(FileNotFoundException e)
{
e.printStackTrace();
}
catch (JavaLayerException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
catch(ExceptionInInitializerError e)
{
e.printStackTrace();
}
}
Thank you in advance! :D
-
1"I've tried to google the cause for this exception with no results" Try Google with 'JLayer+ExceptionInInitializerError' and get back to us after you've checked over those (about) 1,870,000 hits, or at least the first page full.Andrew Thompson– Andrew Thompson2013年05月05日 03:39:52 +00:00Commented May 5, 2013 at 3:39
-
I don't find anything that I didn't checked before, that's why I came here.Jhon– Jhon2013年05月05日 03:59:32 +00:00Commented May 5, 2013 at 3:59
2 Answers 2
Version of JLayer did not matter for me.
In my case, importing javazoom.jl.player.Player was not enough. When building my application into a jar, I did include jl1.0.1.jar, but I also had to make sure to include javazoom in the fileset dir of build file.