[jitsi-dev] Failed to initialize LibJitsi backend when call LibJitsi.start()

Hi,

I just wrote a very simple program like the following:

import org.jitsi.service.libjitsi.LibJitsi;
public class LibJitsiTest {

  public static void main(String[] args) {
    // TODO Auto-generated method stub
    LibJitsi.start();
  }

}

But when I run the program, there is an exception:

Dec 27, 2013 10:47:47 下午 org.jitsi.util.Logger info
Info: Failed to initialize LibJitsi backend org.jitsi.impl.libjitsi.LibJitsiOSGiImpl. (Exception stack trace follows.) Will try an alternative.
java.lang.IllegalStateException: FrameworkUtil.getBundle
  at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.<init>(LibJitsiOSGiImpl.java:37)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at java.lang.Class.newInstance(Class.java:374)
  at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:227)
  at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:171)
  at LibJitsiTest.main(LibJitsiTest.java:8)

Did I configure the libjitsi right? I have included it in the referenced libraries in Eclipse and set the native library.

Thank you very much.

Hi,

Hi,

I just wrote a very simple program like the following:

*import* org.jitsi.service.libjitsi.LibJitsi;
*public* *class* LibJitsiTest {

*public* *static* *void* main(String[] args) {
// *TODO* Auto-generated method stub
LibJitsi.*start*();
}

}

But when I run the program, there is an exception:

Dec 27, 2013 10:47:47 下午 org.jitsi.util.Logger info
Info: Failed to initialize LibJitsi backend
org.jitsi.impl.libjitsi.LibJitsiOSGiImpl. (Exception stack trace follows.)
Will try an alternative.
java.lang.IllegalStateException: FrameworkUtil.getBundle
at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.<init>(
LibJitsiOSGiImpl.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:227)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:171)
at LibJitsiTest.main(LibJitsiTest.java:8)

Did I configure the libjitsi right? I have included it in the referenced
libraries in Eclipse and set the native library.

This is benign. It just notifies you that you don't have OSGI container in
place so libjitsi cannot get initialized through OSGI
Libjitsi is designed to work without OSGI so on the backend it will
initialize LibJitsiImpl instead.
So go ahead and continue playing with libjitsi - you will have a lot of
fun :slight_smile:
Some tutorial I found out and might help you:
http://www.aosabook.org/en/jitsi.html
Also there are two examples you can try for receiver and transmitter in
libjitsi codebase:
org.jitsi.examples.AVTransmit2.java
org.jitsi.examples.AVReceive2.java

also check: https://jitsi.org/Documentation/DeveloperDocumentation

Hope this helps,
Mircea

···

On Sat, Dec 28, 2013 at 6:41 AM, decoet <decoet@163.com> wrote:

Thank you very much.

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

Hi,

Thank you for your help. It looks like the configuration works. LibJitsi.start() goes well now.

But I am applying JNIEncoder in package org.jitsi.impl.neomedia.codec.video.h264.* as a plugin for JMF. I check the functions it provide, it should be compatible. However, when I add it into the plugin manager and start capture, there is a exception like:

Exception in thread "JMF thread: com.sun.media.ProcessEngine@ca8f43[ com.sun.media.ProcessEngine@ca8f43 ] ( realizeThread)" java.lang.NullPointerException
  at org.jitsi.impl.configuration.ConfigurationServiceImpl.getProperty(ConfigurationServiceImpl.java:381)
  at org.jitsi.impl.configuration.ConfigurationServiceImpl.getString(ConfigurationServiceImpl.java:1294)
  at org.jitsi.impl.configuration.ConfigurationServiceImpl.getBoolean(ConfigurationServiceImpl.java:1331)
  at org.jitsi.impl.neomedia.codec.video.h264.JNIEncoder.open(JNIEncoder.java:518)
  at com.sun.media.BasicFilterModule.doRealize(BasicFilterModule.java:49)
  at com.sun.media.PlaybackEngine.buildTrackFromGraph(PlaybackEngine.java:1753)
  at com.sun.media.ProcessEngine$ProcGraphBuilder.buildTrackFromGraph(ProcessEngine.java:952)
  at com.sun.media.ProcessEngine$ProcGraphBuilder.buildCustomGraph(ProcessEngine.java:1210)
  at com.sun.media.ProcessEngine$ProcGraphBuilder.buildGraph(ProcessEngine.java:944)
  at com.sun.media.ProcessEngine$ProcTControl.buildTrack(ProcessEngine.java:655)
  at com.sun.media.PlaybackEngine.doRealize1(PlaybackEngine.java:326)
  at com.sun.media.ProcessEngine.doRealize(ProcessEngine.java:77)
  at com.sun.media.RealizeWorkThread.process(BasicController.java:1400)
  at com.sun.media.StateTransitionWorkThread.run(BasicController.java:1339)

I check ConfigurationServiceImpl class. But I still don’t know why this exception happened. The line 381 of ConfigurationServiceImpl is:

result = store.getProperty(propertyName);

The exception is null pointer exception, so I think the store is NULL when it call this function. However, I have no idea about when the “store” is initialized. Do I need to do some configuration before I use JNIEncoder?

Thank you very much.

在 2013年12月28日,3:22,Mircea Carasel <mirceac@ezuce.com> 写道:

···

Hi,

On Sat, Dec 28, 2013 at 6:41 AM, decoet <decoet@163.com> wrote:
Hi,

I just wrote a very simple program like the following:

import org.jitsi.service.libjitsi.LibJitsi;
public class LibJitsiTest {

  public static void main(String[] args) {
    // TODO Auto-generated method stub
    LibJitsi.start();
  }

}

But when I run the program, there is an exception:

Dec 27, 2013 10:47:47 下午 org.jitsi.util.Logger info
Info: Failed to initialize LibJitsi backend org.jitsi.impl.libjitsi.LibJitsiOSGiImpl. (Exception stack trace follows.) Will try an alternative.
java.lang.IllegalStateException: FrameworkUtil.getBundle
  at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.<init>(LibJitsiOSGiImpl.java:37)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at java.lang.Class.newInstance(Class.java:374)
  at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:227)
  at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:171)
  at LibJitsiTest.main(LibJitsiTest.java:8)

Did I configure the libjitsi right? I have included it in the referenced libraries in Eclipse and set the native library.
This is benign. It just notifies you that you don't have OSGI container in place so libjitsi cannot get initialized through OSGI
Libjitsi is designed to work without OSGI so on the backend it will initialize LibJitsiImpl instead.
So go ahead and continue playing with libjitsi - you will have a lot of fun :slight_smile:
Some tutorial I found out and might help you:
http://www.aosabook.org/en/jitsi.html
Also there are two examples you can try for receiver and transmitter in libjitsi codebase:
org.jitsi.examples.AVTransmit2.java
org.jitsi.examples.AVReceive2.java

also check: https://jitsi.org/Documentation/DeveloperDocumentation

Hope this helps,
Mircea

Thank you very much.

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

Thank you for your help. It looks like the configuration works.
LibJitsi.start() goes well now.

But I am applying JNIEncoder in package
org.jitsi.impl.neomedia.codec.video.h264.* as a plugin for JMF. I check

the

functions it provide, it should be compatible. However, when I add it into
the plugin manager and start capture, there is a exception like:

Exception in thread "JMF thread: com.sun.media.ProcessEngine@ca8f43[
com.sun.media.ProcessEngine@ca8f43 ] ( realizeThread)"
java.lang.NullPointerException at
org.jitsi.impl.configuration.ConfigurationServiceImpl.getProperty(Configu
rati onServiceImpl.java:381)

[...]

I check ConfigurationServiceImpl class. But I still don't know why this
exception happened. The line 381 of ConfigurationServiceImpl is:

result = store.getProperty(propertyName);

The exception is null pointer exception, so I think the store is NULL when

it

call this function. However, I have no idea about when the "store" is
initialized. Do I need to do some configuration before I use JNIEncoder?

Please try to debug why ConfigurationServiceImpl.createConfigurationFile()
fails to assign the store. There should be no need to configure the
JNIEncoder.

Thank you very much.

Ingo

Thank you for your help. In fact I have no idea about it. I don’t know if I configure the Libjitsi right.

I can’t even run the basic examples from Libjitsi webpage: AVTransmit2 and AVReceive2.

Here is what I do configuring library:

1. Create a project and add libjitsi.jar in referenced libraries. I also set the native library to local path in libjitsi’s folder “lib/natvie/windows”.

2. Set correct arguments: --local-port-base=16290 --remote-host=127.0.0.1 --remote-port-base=16291
and VM arguments:
-Dfelix.config.properties=file:lib/felix.client.run.properties
-Djava.util.logging.config.file=lib/logging.properties

I also set the environment as following like (https://jitsi.org/Documentation/ConfigureEclipseNew):
In the "Environment" tab of the configuration add a new variable called path and let it point to the system path and additionally to the library path for your system.
For Windows this is %path%;./lib/native/windows.

After doing this, I run AVTransmit2, the exception in console is:

Exception in thread "main" java.lang.NullPointerException
  at org.jitsi.examples.AVTransmit2.start(AVTransmit2.java:110)
  at org.jitsi.examples.AVTransmit2.main(AVTransmit2.java:342)
It should be because it can get proper return when it runs:
MediaService mediaService = LibJitsi.getMediaService();
I look into Libjitsi.class but I have no idea why this will happen.

Will be possible that libjitsi need more configuration before running the example?

Thank you very much.

在 2013年12月29日,6:58,Ingo Bauersachs <ingo@jitsi.org> 写道:

···

Thank you for your help. It looks like the configuration works.
LibJitsi.start() goes well now.

But I am applying JNIEncoder in package
org.jitsi.impl.neomedia.codec.video.h264.* as a plugin for JMF. I check

the

functions it provide, it should be compatible. However, when I add it into
the plugin manager and start capture, there is a exception like:

Exception in thread "JMF thread: com.sun.media.ProcessEngine@ca8f43[
com.sun.media.ProcessEngine@ca8f43 ] ( realizeThread)"
java.lang.NullPointerException at
org.jitsi.impl.configuration.ConfigurationServiceImpl.getProperty(Configu
rati onServiceImpl.java:381)

[...]

I check ConfigurationServiceImpl class. But I still don't know why this
exception happened. The line 381 of ConfigurationServiceImpl is:

result = store.getProperty(propertyName);

The exception is null pointer exception, so I think the store is NULL when

it

call this function. However, I have no idea about when the "store" is
initialized. Do I need to do some configuration before I use JNIEncoder?

Please try to debug why ConfigurationServiceImpl.createConfigurationFile()
fails to assign the store. There should be no need to configure the
JNIEncoder.

Thank you very much.

Ingo

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

The documentation page you cited refers to Jitsi itself, not libiitsi.

I'm not really involved with standalone libjitsi development, but:
- unless you use Felix and OSGi, there's no need for the VM property felix...
- AFAIK you also need to reference all the jars from libjitsi/lib in your build path

Freundliche Grüsse,
Ingo Bauersachs

-- sent from my mobile

···

Le 29.12.2013 à 22:14, "decoet" <decoet@163.com> a écrit :

Thank you for your help. In fact I have no idea about it. I don’t know if I configure the Libjitsi right.

I can’t even run the basic examples from Libjitsi webpage: AVTransmit2 and AVReceive2.

Here is what I do configuring library:

1. Create a project and add libjitsi.jar in referenced libraries. I also set the native library to local path in libjitsi’s folder “lib/natvie/windows”.

2. Set correct arguments: --local-port-base=16290 --remote-host=127.0.0.1 --remote-port-base=16291
and VM arguments:
-Dfelix.config.properties=file:lib/felix.client.run.properties
-Djava.util.logging.config.file=lib/logging.properties

I also set the environment as following like (https://jitsi.org/Documentation/ConfigureEclipseNew):
In the "Environment" tab of the configuration add a new variable called path and let it point to the system path and additionally to the library path for your system.
For Windows this is %path%;./lib/native/windows.

After doing this, I run AVTransmit2, the exception in console is:

Exception in thread "main" java.lang.NullPointerException
  at org.jitsi.examples.AVTransmit2.start(AVTransmit2.java:110)
  at org.jitsi.examples.AVTransmit2.main(AVTransmit2.java:342)
It should be because it can get proper return when it runs:
MediaService mediaService = LibJitsi.getMediaService();
I look into Libjitsi.class but I have no idea why this will happen.

Will be possible that libjitsi need more configuration before running the example?

Thank you very much.

在 2013年12月29日,6:58,Ingo Bauersachs <ingo@jitsi.org> 写道:

Thank you for your help. It looks like the configuration works.
LibJitsi.start() goes well now.

But I am applying JNIEncoder in package
org.jitsi.impl.neomedia.codec.video.h264.* as a plugin for JMF. I check

the

functions it provide, it should be compatible. However, when I add it into
the plugin manager and start capture, there is a exception like:

Exception in thread "JMF thread: com.sun.media.ProcessEngine@ca8f43[
com.sun.media.ProcessEngine@ca8f43 ] ( realizeThread)"
java.lang.NullPointerException at
org.jitsi.impl.configuration.ConfigurationServiceImpl.getProperty(Configu
rati onServiceImpl.java:381)

[...]

I check ConfigurationServiceImpl class. But I still don't know why this
exception happened. The line 381 of ConfigurationServiceImpl is:

result = store.getProperty(propertyName);

The exception is null pointer exception, so I think the store is NULL when

it

call this function. However, I have no idea about when the "store" is
initialized. Do I need to do some configuration before I use JNIEncoder?

Please try to debug why ConfigurationServiceImpl.createConfigurationFile()
fails to assign the store. There should be no need to configure the
JNIEncoder.

Thank you very much.

Ingo

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

Thank you. In fact I have include all jars but it doesn’t help.

I also clone the source file from github and load that project. When I run the examples in its packet, it still shows this problem.

在 2013年12月29日,18:30,Ingo Bauersachs <ingo@jitsi.org> 写道:

···

The documentation page you cited refers to Jitsi itself, not libiitsi.

I'm not really involved with standalone libjitsi development, but:
- unless you use Felix and OSGi, there's no need for the VM property felix...
- AFAIK you also need to reference all the jars from libjitsi/lib in your build path

Freundliche Grüsse,
Ingo Bauersachs

-- sent from my mobile

Le 29.12.2013 à 22:14, "decoet" <decoet@163.com> a écrit :

Thank you for your help. In fact I have no idea about it. I don’t know if I configure the Libjitsi right.

I can’t even run the basic examples from Libjitsi webpage: AVTransmit2 and AVReceive2.

Here is what I do configuring library:

1. Create a project and add libjitsi.jar in referenced libraries. I also set the native library to local path in libjitsi’s folder “lib/natvie/windows”.

2. Set correct arguments: --local-port-base=16290 --remote-host=127.0.0.1 --remote-port-base=16291
and VM arguments:
-Dfelix.config.properties=file:lib/felix.client.run.properties
-Djava.util.logging.config.file=lib/logging.properties

I also set the environment as following like (https://jitsi.org/Documentation/ConfigureEclipseNew):
In the "Environment" tab of the configuration add a new variable called path and let it point to the system path and additionally to the library path for your system.
For Windows this is %path%;./lib/native/windows.

After doing this, I run AVTransmit2, the exception in console is:

Exception in thread "main" java.lang.NullPointerException
  at org.jitsi.examples.AVTransmit2.start(AVTransmit2.java:110)
  at org.jitsi.examples.AVTransmit2.main(AVTransmit2.java:342)
It should be because it can get proper return when it runs:
MediaService mediaService = LibJitsi.getMediaService();
I look into Libjitsi.class but I have no idea why this will happen.

Will be possible that libjitsi need more configuration before running the example?

Thank you very much.

在 2013年12月29日,6:58,Ingo Bauersachs <ingo@jitsi.org> 写道:

Thank you for your help. It looks like the configuration works.
LibJitsi.start() goes well now.

But I am applying JNIEncoder in package
org.jitsi.impl.neomedia.codec.video.h264.* as a plugin for JMF. I check

the

functions it provide, it should be compatible. However, when I add it into
the plugin manager and start capture, there is a exception like:

Exception in thread "JMF thread: com.sun.media.ProcessEngine@ca8f43[
com.sun.media.ProcessEngine@ca8f43 ] ( realizeThread)"
java.lang.NullPointerException at
org.jitsi.impl.configuration.ConfigurationServiceImpl.getProperty(Configu
rati onServiceImpl.java:381)

[...]

I check ConfigurationServiceImpl class. But I still don't know why this
exception happened. The line 381 of ConfigurationServiceImpl is:

result = store.getProperty(propertyName);

The exception is null pointer exception, so I think the store is NULL when

it

call this function. However, I have no idea about when the "store" is
initialized. Do I need to do some configuration before I use JNIEncoder?

Please try to debug why ConfigurationServiceImpl.createConfigurationFile()
fails to assign the store. There should be no need to configure the
JNIEncoder.

Thank you very much.

Ingo

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev