Parmeisan
09-30-2004, 11:21 PM
I will warn you that I have not been programming in Java for very long, but I'm familiar with C++ and it's not so very different. Also, the program on which I'm working was not started by me, so there are areas with which I am still unfamiliar. That said, my problem...
The program, when I found it, had a "Javalayer MP3 decoder" from http://www.javazoom.net/javalayer/javalayer.html. It worked fine, but was old. Seeing that the new one had some functionality I needed, I have updated all the files I need (the music agent makefile and MusicAgent, specifically) but when I run it, I get this error:
java.lang.ExceptionInInitializerError
at javazoom.jl.decoder.SynthesisFilter.load_d(SynthesisFilter.java:1624)
at javazoom.jl.decoder.SynthesisFilter.<init>(SynthesisFilter.java:73)
at javazoom.jl.decoder.Decoder.initialize(Decoder.java:282)
at javazoom.jl.decoder.Decoder.decodeFrame(Decoder.java:137)
at javazoom.jl.player.Player.decodeFrame(Player.java:206)
at javazoom.jl.player.Player.play(Player.java:113)
at javazoom.jl.player.Player.play(Player.java:97)
at MusicAgent.MusicBox.run(MusicAgent.java:271)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: unable to load resource 'sfd.ser'
at javazoom.jl.decoder.JavaLayerUtils.deserializeArrayResource(JavaLayerUtils.java:145)
at javazoom.jl.decoder.SynthesisFilter.load_d(SynthesisFilter.java:1619)
... 8 more
The program itself is quite large, so I regret that I can't give you all the code you might need... just ask for specific bits if I'm not showing you enough.
Synthesis Filter (part of Javazoom)
static private float[] load_d()
{
try
{
Class elemType = Float.TYPE;
Object o = JavaLayerUtils.deserializeArrayResource("sfd.ser", elemType, 512);
return (float[])o;
}
catch (IOException ex)
{
throw new ExceptionInInitializerError(ex);
}
}
Java Layer Utils (part of Javazoom)
static public Object deserializeArrayResource(String name, Class elemType, int length) throws IOException
{
InputStream str = getResourceAsStream(name);
if (str==null)
throw new IOException("unable to load resource '"+name+"'");
Object obj = deserializeArray(str, elemType, length);
return obj;
}
static synchronized public InputStream getResourceAsStream(String name)
{
InputStream is = null;
if (hook!=null)
{
is = hook.getResourceAsStream(name);
}
else
{
Class cls = JavaLayerUtils.class;
is = cls.getResourceAsStream(name);
}
return is;
}
I have no idea what a hook is, but this is still the Javazoom code, so I sort of suspect that's not the problem.
MusicAgent - MusicBox
public void run()
{
if(musicSocket != null)
{
try
{
if (!initd)
{
player = new Player(sin);
initd = true;
}
player.play();
}
catch(Exception e)
{
Log.logInfo("problem with the player");
}
}
else
{
Log.logInfo("MusicBox failed to run");
}
}
Which should be innocent enough.
MusicAgent - imports
import java.io.*;
import java.net.*;
import java.lang.*;
import teema.*;
//import MusicAgent.javazoom.jlme.decoder.*;
//import MusicAgent.javazoom.jlme.util.*;
// Old above, new below
import javazoom.jl.player.*;
import javazoom.jl.decoder.*;
import javazoom.jl.converter.*;
makefile
@echo off
del MusicAgent.jar
javac -classpath ..\;..\..\;.\ *.java
rem OLD javac -classpath ..\;..\..\;.\ javazoom/jlme/util/*.java
javac -classpath ..\;..\..\;.\ javazoom/jl/player/*.java
javac -classpath ..\;..\..\;.\ javazoom/jl/decoder/*.java
javac -classpath ..\;..\..\;.\ javazoom/jl/converter/*.java
rem Gives same error with or without compiling these last two
cd ..
rem jar cmf MusicAgent/Manifest.txt MusicAgent/MusicAgent.jar MusicAgent/*.class MusicAgent/javazoom/jlme/util/*.class MusicAgent/javazoom/jlme/decoder/*.class MusicAgent/d16.dat MusicAgent/huffman.dat d16.dat
rem Old above, new below
jar cmf MusicAgent/Manifest.txt MusicAgent/MusicAgent.jar MusicAgent/*.class javazoom/jl/player/*.class javazoom/jl/decoder/*.class javazoom/jl/converter/*.class javazoom/jl/decoder/*.ser MusicAgent/d16.dat MusicAgent/huffman.dat d16.dat
cd MusicAgent
del *.class
I've tried moving the file into multiple folders, but I suppose I can't remove that possibility entirely. So... I'm hoping someone here has seen a similar problem before, or can recognize what it might be. Thanks in advance for any tips!
The program, when I found it, had a "Javalayer MP3 decoder" from http://www.javazoom.net/javalayer/javalayer.html. It worked fine, but was old. Seeing that the new one had some functionality I needed, I have updated all the files I need (the music agent makefile and MusicAgent, specifically) but when I run it, I get this error:
java.lang.ExceptionInInitializerError
at javazoom.jl.decoder.SynthesisFilter.load_d(SynthesisFilter.java:1624)
at javazoom.jl.decoder.SynthesisFilter.<init>(SynthesisFilter.java:73)
at javazoom.jl.decoder.Decoder.initialize(Decoder.java:282)
at javazoom.jl.decoder.Decoder.decodeFrame(Decoder.java:137)
at javazoom.jl.player.Player.decodeFrame(Player.java:206)
at javazoom.jl.player.Player.play(Player.java:113)
at javazoom.jl.player.Player.play(Player.java:97)
at MusicAgent.MusicBox.run(MusicAgent.java:271)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: unable to load resource 'sfd.ser'
at javazoom.jl.decoder.JavaLayerUtils.deserializeArrayResource(JavaLayerUtils.java:145)
at javazoom.jl.decoder.SynthesisFilter.load_d(SynthesisFilter.java:1619)
... 8 more
The program itself is quite large, so I regret that I can't give you all the code you might need... just ask for specific bits if I'm not showing you enough.
Synthesis Filter (part of Javazoom)
static private float[] load_d()
{
try
{
Class elemType = Float.TYPE;
Object o = JavaLayerUtils.deserializeArrayResource("sfd.ser", elemType, 512);
return (float[])o;
}
catch (IOException ex)
{
throw new ExceptionInInitializerError(ex);
}
}
Java Layer Utils (part of Javazoom)
static public Object deserializeArrayResource(String name, Class elemType, int length) throws IOException
{
InputStream str = getResourceAsStream(name);
if (str==null)
throw new IOException("unable to load resource '"+name+"'");
Object obj = deserializeArray(str, elemType, length);
return obj;
}
static synchronized public InputStream getResourceAsStream(String name)
{
InputStream is = null;
if (hook!=null)
{
is = hook.getResourceAsStream(name);
}
else
{
Class cls = JavaLayerUtils.class;
is = cls.getResourceAsStream(name);
}
return is;
}
I have no idea what a hook is, but this is still the Javazoom code, so I sort of suspect that's not the problem.
MusicAgent - MusicBox
public void run()
{
if(musicSocket != null)
{
try
{
if (!initd)
{
player = new Player(sin);
initd = true;
}
player.play();
}
catch(Exception e)
{
Log.logInfo("problem with the player");
}
}
else
{
Log.logInfo("MusicBox failed to run");
}
}
Which should be innocent enough.
MusicAgent - imports
import java.io.*;
import java.net.*;
import java.lang.*;
import teema.*;
//import MusicAgent.javazoom.jlme.decoder.*;
//import MusicAgent.javazoom.jlme.util.*;
// Old above, new below
import javazoom.jl.player.*;
import javazoom.jl.decoder.*;
import javazoom.jl.converter.*;
makefile
@echo off
del MusicAgent.jar
javac -classpath ..\;..\..\;.\ *.java
rem OLD javac -classpath ..\;..\..\;.\ javazoom/jlme/util/*.java
javac -classpath ..\;..\..\;.\ javazoom/jl/player/*.java
javac -classpath ..\;..\..\;.\ javazoom/jl/decoder/*.java
javac -classpath ..\;..\..\;.\ javazoom/jl/converter/*.java
rem Gives same error with or without compiling these last two
cd ..
rem jar cmf MusicAgent/Manifest.txt MusicAgent/MusicAgent.jar MusicAgent/*.class MusicAgent/javazoom/jlme/util/*.class MusicAgent/javazoom/jlme/decoder/*.class MusicAgent/d16.dat MusicAgent/huffman.dat d16.dat
rem Old above, new below
jar cmf MusicAgent/Manifest.txt MusicAgent/MusicAgent.jar MusicAgent/*.class javazoom/jl/player/*.class javazoom/jl/decoder/*.class javazoom/jl/converter/*.class javazoom/jl/decoder/*.ser MusicAgent/d16.dat MusicAgent/huffman.dat d16.dat
cd MusicAgent
del *.class
I've tried moving the file into multiple folders, but I suppose I can't remove that possibility entirely. So... I'm hoping someone here has seen a similar problem before, or can recognize what it might be. Thanks in advance for any tips!