[jitsi-dev] Instantiating net.java.sip.communicator.impl.gui.main.contactlist.SearchField


#1

Hello,

I need a simple search field for the plugin I'm working on (see topic "Editting
Jitsi configuration file")

It seems to me that I can use this class:
net.java.sip.communicator.impl.gui.main.contactlist.SearchField
for my needs.

but I get the following ClassNotFoundException:

     [java] 17:40:47.822 SEVERE: [40]
util.UtilActivator.uncaughtException().91
An uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
and mes
sage was: net/java/sip/communicator/impl/gui/main/contactlist/SearchField
     [java] java.lang.NoClassDefFoundError:
net/java/sip/communicator/impl/gui/m
ain/contactlist/SearchField
     [java] at
net.java.sip.communicator.plugin.propertieseditor.PropertiesE
ditorPanel.<init>(PropertiesEditorPanel.java:77)
     [java] at
net.java.sip.communicator.plugin.propertieseditor.WarningPane
l$1.actionPerformed(WarningPanel.java:70)
     [java] at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton
.java:2018)
     [java] at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractBu
tton.java:2341)
     [java] at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultBut
tonModel.java:402)
     [java] at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.
java:259)
     [java] at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Basi
cButtonListener.java:252)
     [java] at java.awt.Component.processMouseEvent(Component.java:6505)
     [java] at
javax.swing.JComponent.processMouseEvent(JComponent.java:3321
)
     [java] at java.awt.Component.processEvent(Component.java:6270)
     [java] at java.awt.Container.processEvent(Container.java:2229)
     [java] at java.awt.Component.dispatchEventImpl(Component.java:4861)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2287)
     [java] at java.awt.Component.dispatchEvent(Component.java:4687)
     [java] at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.j
ava:4832)
     [java] at
java.awt.LightweightDispatcher.processMouseEvent(Container.ja
va:4492)
     [java] at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4
422)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2273)
     [java] at java.awt.Window.dispatchEventImpl(Window.java:2719)
     [java] at java.awt.Component.dispatchEvent(Component.java:4687)
     [java] at
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
     [java] at java.awt.EventQueue.access$200(EventQueue.java:103)
     [java] at java.awt.EventQueue$3.run(EventQueue.java:688)
     [java] at java.awt.EventQueue$3.run(EventQueue.java:686)
     [java] at java.security.AccessController.doPrivileged(Native
Method)
     [java] at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Prot
ectionDomain.java:76)
     [java] at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Prot
ectionDomain.java:87)
     [java] at java.awt.EventQueue$4.run(EventQueue.java:702)
     [java] at java.awt.EventQueue$4.run(EventQueue.java:700)
     [java] at java.security.AccessController.doPrivileged(Native
Method)
     [java] at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Prot
ectionDomain.java:76)
     [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
     [java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDisp
atchThread.java:242)
     [java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatc
hThread.java:161)
     [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
atchThread.java:150)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
ava:146)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
ava:138)
     [java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

   * [java] Caused by: java.lang.ClassNotFoundException:
net.java.sip.communicat*
*or.impl.gui.main.contactlist.SearchField not found by [135]*
     [java] at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDe
legation(ModuleImpl.java:812)
     [java] at
org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.j
ava:72)
     [java] at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadC
lass(ModuleImpl.java:1807)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

I think I'm missing some import packages in my bundle manifest but I dont
have much experience with OSGi and I'm stuck.
Any help would be appreciated!

Thanks in advance!

Regards,
Marin


#2

Hi,

so every package that you use in OSGI must be imported, and every
imported package must be exported from another bundle.
But here there is a problem in your situation. The general rule is we
do not import packages from the impl package.
Maybe you must create another SIPCommTextField as the SearchField with
custom UI as the one in (SearchFieldUI), as I see that currently
SearchField and its SearchFieldUI are dependent the main frame and
some of its components and cannot be used as generic one.
Or you can try to make it generic by placing it in dektoputil plugin
and use it from there in impl.gui and in your plugin.
Hope this helps.

Regrads
damencho

···

On Tue, Aug 6, 2013 at 5:47 PM, Marin Dzhigarov <marin@bluejimp.com> wrote:

Hello,

I need a simple search field for the plugin I'm working on (see topic
"Editting Jitsi configuration file")

It seems to me that I can use this class:
net.java.sip.communicator.impl.gui.main.contactlist.SearchField for my
needs.

but I get the following ClassNotFoundException:

     [java] 17:40:47.822 SEVERE: [40]
util.UtilActivator.uncaughtException().91
An uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main] and
mes
sage was: net/java/sip/communicator/impl/gui/main/contactlist/SearchField
     [java] java.lang.NoClassDefFoundError:
net/java/sip/communicator/impl/gui/m
ain/contactlist/SearchField
     [java] at
net.java.sip.communicator.plugin.propertieseditor.PropertiesE
ditorPanel.<init>(PropertiesEditorPanel.java:77)
     [java] at
net.java.sip.communicator.plugin.propertieseditor.WarningPane
l$1.actionPerformed(WarningPanel.java:70)
     [java] at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton
.java:2018)
     [java] at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractBu
tton.java:2341)
     [java] at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultBut
tonModel.java:402)
     [java] at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.
java:259)
     [java] at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Basi
cButtonListener.java:252)
     [java] at java.awt.Component.processMouseEvent(Component.java:6505)
     [java] at
javax.swing.JComponent.processMouseEvent(JComponent.java:3321
)
     [java] at java.awt.Component.processEvent(Component.java:6270)
     [java] at java.awt.Container.processEvent(Container.java:2229)
     [java] at java.awt.Component.dispatchEventImpl(Component.java:4861)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2287)
     [java] at java.awt.Component.dispatchEvent(Component.java:4687)
     [java] at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.j
ava:4832)
     [java] at
java.awt.LightweightDispatcher.processMouseEvent(Container.ja
va:4492)
     [java] at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4
422)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2273)
     [java] at java.awt.Window.dispatchEventImpl(Window.java:2719)
     [java] at java.awt.Component.dispatchEvent(Component.java:4687)
     [java] at
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
     [java] at java.awt.EventQueue.access$200(EventQueue.java:103)
     [java] at java.awt.EventQueue$3.run(EventQueue.java:688)
     [java] at java.awt.EventQueue$3.run(EventQueue.java:686)
     [java] at java.security.AccessController.doPrivileged(Native
Method)
     [java] at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Prot
ectionDomain.java:76)
     [java] at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Prot
ectionDomain.java:87)
     [java] at java.awt.EventQueue$4.run(EventQueue.java:702)
     [java] at java.awt.EventQueue$4.run(EventQueue.java:700)
     [java] at java.security.AccessController.doPrivileged(Native
Method)
     [java] at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Prot
ectionDomain.java:76)
     [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
     [java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDisp
atchThread.java:242)
     [java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatc
hThread.java:161)
     [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
atchThread.java:150)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
ava:146)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
ava:138)
     [java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

     [java] Caused by: java.lang.ClassNotFoundException:
net.java.sip.communicat
or.impl.gui.main.contactlist.SearchField not found by [135]
     [java] at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDe
legation(ModuleImpl.java:812)
     [java] at
org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.j
ava:72)
     [java] at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadC
lass(ModuleImpl.java:1807)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

I think I'm missing some import packages in my bundle manifest but I dont
have much experience with OSGi and I'm stuck.
Any help would be appreciated!

Thanks in advance!

Regards,
Marin

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