Results 1 to 2 of 2
Thread: OSGi and Swing
- 02-08-2011, 03:35 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
OSGi and Swing
Greetings.
I'm having serious issues in having JFrames declared inside the Activator class or any class used in a service!!!
When i try to start the bundle, there's always an error like this (an example):
"Error executing commang: Activator start error in bundle swing_osgi [183]."
swing_osgi is the bundle and 183 is the ID.
What's is the problem????
I didn't put any code here because it's happening the same, i have the saaaaaaaaaame issue, in every example i make...
:(Last edited by dead_devil_66; 02-08-2011 at 03:55 AM.
- 02-08-2011, 04:12 PM #2
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
example...
this will fail to start and will cause apache servicemix to throw a message like the one i posted in the first post.Java Code:package pack.server; import java.util.Dictionary; import java.util.Hashtable; import javax.swing.JFrame; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; import pack.iserver.IServer; public class Activator implements BundleActivator { private ServiceRegistration registration; private JFrame f = null; public void start(BundleContext context) throws Exception { Dictionary<String, String> props = new Hashtable<String, String>(); javax.swing.SwingUtilities.invokeLater(new Runnable() { // This creates of the application window. public void run() { System.out.println("hey"); f = new JFrame(); f.setVisible(true); } }); // Console c = new Console(); // c.setSystemInput(); // c.setSystemOutput(); // c.setSystemErr(); registration = context.registerService(IServer.class.getName(), new Server(), props); System.out.println("O servidor foi registado"); // String[] keys = registration.getReference().getPropertyKeys(); // // for(String k: keys){ // System.out.println(k); // } } public void stop(BundleContext context) throws Exception { registration.unregister(); } }
strange thing is that "hey" isn't even printed.... wtf
I even tried without using the invokeLater method and causes to happen the same.
Similar Threads
-
OSGi and Class Loaders
By nim123 in forum Advanced JavaReplies: 0Last Post: 04-15-2010, 01:26 AM -
Swing
By tmotse in forum AWT / SwingReplies: 0Last Post: 03-31-2010, 10:18 AM -
jSpellCorrect 0.4-osgi
By Java Tip in forum Java SoftwareReplies: 0Last Post: 04-26-2008, 08:35 PM -
AWT or Swing
By bugger in forum AWT / SwingReplies: 4Last Post: 11-22-2007, 09:44 AM -
map javax.swing.text.Element to javax.swing.text.View
By elizabeth in forum New To JavaReplies: 1Last Post: 07-30-2007, 07:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks