0

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

asked May 5, 2013 at 3:25
2
  • 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. Commented May 5, 2013 at 3:39
  • I don't find anything that I didn't checked before, that's why I came here. Commented May 5, 2013 at 3:59

2 Answers 2

1

Finally I'm using JLayer 1.0 and it works like a charm, you can get it from here. This is a sample code I found here.

EDIT: in Eclipse, if the error keeps showing up, change your workspace to a new one.

answered May 6, 2013 at 13:27
Sign up to request clarification or add additional context in comments.

Comments

0

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.

answered Jan 7, 2016 at 17:20

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.