Asterisk-Java unable to load Properties File

I’m developing a very simple Asterisk-Java IVR based program that greets the caller, retrieves some information from a web service, reads up the retrieved data to the caller, and finally hangs up.

What steps I followed:

Added the following line is entered on extensions_custom.conf:

exten => 1000,n,Agi(agi://

Created the following file structure inside C:\Project\target\classes\

Inside I have:

ivryobi.agi = main.IvrYobi

The contens of IvrYoby are:

public class IvrYobi extends BaseAgiScript {

	public void service(AgiRequest request, AgiChannel channel) throws AgiException {
	String callerMsisdn = request.getCallerIdNumber();

When it works normally

Running the following command in the console

C:\Project\target\classes>java -cp

As you can see on the following console output, works perfectly

jun 30, 2020 6:09:04 PM org.asteriskjava.fastagi.DefaultAgiServer
startup INFORMACIËN: Listening on *:4573. jun 30, 2020 6:09:09 PM
org.asteriskjava.fastagi.AbstractAgiServer getPool INFORMACIËN: Thread
pool started. jun 30, 2020 6:09:09 PM
loadResourceBundle INFORMACIËN: Added mapping for ‘ivryobi.agi’ to
class IvrYobi …

When the problem appears

When I run the very same code, but insted of the console I use

Here are the contents of

DefaultAgiServer server = new DefaultAgiServer();

	public MyRunnable() {

		ClassNameMappingStrategy strategy = new ClassNameMappingStrategy(false);



	public void run() {

		try {


		} catch (IllegalStateException | IOException e) {





	public void stop() {

We can observe the following error on Eclipse’s console:

0 [main] DEBUG org.asteriskjava.fastagi.DefaultAgiServer - Using
org.asteriskjava.fastagi.internal.DefaultAgiChannelFactory 9 [main]
INFO org.asteriskjava.fastagi.DefaultAgiServer - Listening on *:4573.
4806 [main] DEBUG org.asteriskjava.fastagi.DefaultAgiServer -
Received connection from / 4810 [main] INFO
org.asteriskjava.fastagi.DefaultAgiServer - Thread pool started. 4849
[AJ DaemonPool-1.1] DEBUG
org.asteriskjava.fastagi.ClassNameMappingStrategy - Unable to create
AgiScript instance of type ivryobi.agi: Class not found, make sure the
class exists and is available on the CLASSPATH 4849 [AJ
DaemonPool-1.1] ERROR
org.asteriskjava.fastagi.internal.FastAgiConnectionHandler - No
script configured for URL ‘agi://’ (script

Attempted troubleshooting

  • I already made sure that is on the CLASSPATH.
  • Tried different name and case
  • Copied the .properties file on the java Execution Path
  • Compiled the project as an executable jar
  • Added / removed packages inside eclipse (ex: com.test.IvrYobi) and also applied the changes on the .properties file.
  • I checked the code inside asterisk-java-3.5.0.jar, looks like that in case that the configuration file is not found, it just continues without throwing any warning. Since is packed inside the jar I’m unable to modify that code.

Please, do you have any other ideas I can try?

Asterisk Java is third party software. Try starting from

Thank you by your answer David! I already tried with the GitHub page, but looks like the project has not been updated years ago. I was hoping to maybe find someone in this forum with more experience with this specific library.

Do you know if there is another (even commercial) well matained library, capable of implementing a simple IVR that queries a SOAP webservice and reads the response back to the caller?

Finally found the solution by myself

I had to recompile asterisk-java.jar using the project’s source code

On change the line:

resourceBundle = ResourceBundle.getBundle(configResourceBundleName);


	FileInputStream fis = new FileInputStream("");
	resourceBundle = new PropertyResourceBundle(fis);"resourceBundle cargado ok!");

On the catch, replace the


with a more decent response, so you will know if the resource could not be loaded"resourceBundle cargado ok!");        	       
        catch (MissingResourceException | IOException e)
        	logger.error("No existe el recurso invocado: " + e.getMessage());

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.