This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Problem (Exception) while integrate SIP into OSGi Framework
ChunSean Lok
Greenhorn
Joined: Jul 23, 2009
Posts: 4
posted
0
Dear Developers,
I have created a simple sip application (java based) that successful send the REGISTER and INVITE packet to the proxy server
Currently I tried to integrate this simple application into an standard plug in service with OSGi framework (with eclipse) to implement in Knopflerfish osgi framework environment.
When I try to initiate the SIP service, it throws this exception:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/sip/InvalidArgumentException
at testsvc.UITest_Mainmenu.call_layout(UITest_Mainmenu.java:2954)
at testsvc.UITest_Mainmenu$2.keyPressed(UITest_Mainmenu.java:1188)
at java.awt.Component.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.sip.InvalidArgumentException
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:483)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 26 more
Can anyone help me? Or probably could tell me what's the problem?
Thanks a million in advance.
ChunSean Lok ( SEAN )
Hong Anderson
Ranch Hand
Joined: Jul 05, 2005
Posts: 1936
posted
0
It could not find javax/sip/InvalidArgumentException, have you added classpath correctly?
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
ChunSean Lok
Greenhorn
Joined: Jul 23, 2009
Posts: 4
posted
0
Kengkaj Sathianpantarit wrote:It could not find javax/sip/InvalidArgumentException, have you added classpath correctly?
First of all, thanks for the reply.
You meant the program cannot find the "javax/sip/InvalidArgumentException"?
I have added the library into the project library.
Which classpath do you meant?
Hong Anderson
Ranch Hand
Joined: Jul 05, 2005
Posts: 1936
posted
0
I don't really know, because lately I'm not working on OSGi.
But you have to make your bundle is able to find SIP library at run-time.
You should take a look at run configuration screen (I don't know what tool are you using, but it should have one), there should be something like Run-time library.
ChunSean Lok
Greenhorn
Joined: Jul 23, 2009
Posts: 4
posted
0
Kengkaj Sathianpantarit wrote:I don't really know, because lately I'm not working on OSGi.
But you have to make your bundle is able to find SIP library at run-time.
You should take a look at run configuration screen (I don't know what tool are you using, but it should have one), there should be something like Run-time library.
I am currently using the eclipse to develop the application and plug-in.
Do you have any idea where it is placed on?
Do you meant the project properties -> Java Build Path -> Libraries ?
Is that exception error based on the configuration? Not on my coding?
Hong Anderson
Ranch Hand
Joined: Jul 05, 2005
Posts: 1936
posted
0
ChunSean Lok wrote:
Do you meant the project properties -> Java Build Path -> Libraries ?
Is that exception error based on the configuration? Not on my coding?
No, not Java Build Path, that is for compile time. I believe this happened because improperly configuration, it has nothing to do with coding.
How do you run the application? I think you can find configuration about Run-time Libraries in a tab in that dialog .
Craig Walls
author
Ranch Hand
Joined: Sep 19, 2003
Posts: 301
posted
0
I don't know much about SIP, but I do know that you have a NCDFE on javax.sip.InvalidArgumentException.
In OSGi, that probably means that your bundle doesn't import the javax.sip package. Honestly, I almost never lean on the Eclipse PDE to handle this work for me, so I am a bit fuzzy on what you'd need to do with regard to Eclipse PDE...but breaking it down to bare OSGi, you'll need an "Import-Package: javax.sip" in your bundle's manifest. How you get that there can be done a number of ways, depending on your development model.
I use things like BND and Pax-Construct...they're awesome at handling this kind of detail for me. But in PDE...I'm not so sure. Sorry that I can't help more in that regard.
Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
ChunSean Lok
Greenhorn
Joined: Jul 23, 2009
Posts: 4
posted
0
Thanks everyone for helping me resolve this problem.
It is been resolved.
We need to add the library at the OSGi Manifast file
so that it can be found.
Hong Anderson
Ranch Hand
Joined: Jul 05, 2005
Posts: 1936
posted
0
Thanks for the update.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Problem (Exception) while integrate SIP into OSGi Framework