Skip to main content



      Home
Home » Eclipse Projects » Virgo » Swing applications based on Virgo(Is there any reason that a Swing application cannot run on Virgo or are there any special steps that need to be taken? )
Swing applications based on Virgo [message #664265] Fri, 08 April 2011 03:41 Go to next message
Eclipse UserFriend
Hi,

Is there any reason that a Swing application cannot run on Virgo or are there any special steps that need to be taken?

The reason I ask is that I am trying to port the Swing paint program from the OSGi in Action book Chapter 5 to Virgo. It is is very straightforward but I end up with this exception:
Caused by: java.lang.reflect.InvocationTargetException: null
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1079)
	at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1326)
	at org.foo.paint.Activator.start(Activator.java:60)

when starting the core paint bundle. The full stacktrace is attached.

Many thanks,
Joel


[2011-04-08 08:15:10.742] CP Connection(276)-127.0.0.1 <DE0000I> Installing bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 
[2011-04-08 08:15:10.780] CP Connection(276)-127.0.0.1 <DE0001I> Installed bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 
[2011-04-08 08:15:10.814] CP Connection(276)-127.0.0.1 <DE0004I> Starting bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 
[2011-04-08 08:15:10.903] CP Connection(276)-127.0.0.1 <DE0010I> Stopping bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 
[2011-04-08 08:15:10.953] start-signalling-7           <DE0006E> Start failed for bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. java.lang.RuntimeException: bundle stopped
	at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$StartupTrackerBundleListener.bundleChanged(BundleStartTracker.java:246)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1349)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1300)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:395)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
	at org.eclipse.virgo.kernel.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:57)
	at org.eclipse.virgo.kernel.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:45)
	at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at $Proxy60.start(Unknown Source)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.startBundle(StandardBundleDriver.java:168)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.start(StandardBundleDriver.java:149)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.doStart(StandardBundleInstallArtifact.java:253)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.driveDoStart(AbstractInstallArtifact.java:203)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.start(StandardBundleInstallArtifact.java:242)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.start(PipelinedApplicationDeployer.java:285)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:195)
	at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
	at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:167)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:96)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:33)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
	at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
	at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)

[2011-04-08 08:15:10.981] CP Connection(276)-127.0.0.1 <DE0011I> Stopped bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 
[2011-04-08 08:15:11.088] CP Connection(276)-127.0.0.1 <DE0006E> Start failed for bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: BundleException
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.startBundle(StandardBundleDriver.java:170)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.start(StandardBundleDriver.java:149)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.doStart(StandardBundleInstallArtifact.java:253)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.driveDoStart(AbstractInstallArtifact.java:203)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.start(StandardBundleInstallArtifact.java:242)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.start(PipelinedApplicationDeployer.java:285)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:195)
	at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
	at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:167)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:96)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:33)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
	at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
	at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
Caused by: org.osgi.framework.BundleException: Exception in org.foo.paint.Activator.start() of bundle com.iggroup.paint.example.core.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
	at org.eclipse.virgo.kernel.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:57)
	at org.eclipse.virgo.kernel.core.internal.StandardBundleStarter.start(StandardBundleStarter.java:45)
	at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at $Proxy60.start(Unknown Source)
	at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleDriver.startBundle(StandardBundleDriver.java:168)
	... 36 common frames omitted
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.foo.paint.Activator.start(Activator.java:63)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	... 59 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1079)
	at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1326)
	at org.foo.paint.Activator.start(Activator.java:60)
	... 62 common frames omitted
java.lang.NullPointerException: null
	at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:133)
	at javax.swing.UIDefaults.getUI(UIDefaults.java:742)
	at javax.swing.UIManager.getUI(UIManager.java:1001)
	at javax.swing.JPanel.updateUI(JPanel.java:109)
	at javax.swing.JPanel.<init>(JPanel.java:69)
	at javax.swing.JPanel.<init>(JPanel.java:92)
	at javax.swing.JPanel.<init>(JPanel.java:100)
	at javax.swing.JRootPane.createGlassPane(JRootPane.java:528)
	at javax.swing.JRootPane.<init>(JRootPane.java:348)
	at javax.swing.JFrame.createRootPane(JFrame.java:255)
	at javax.swing.JFrame.frameInit(JFrame.java:236)
	at javax.swing.JFrame.<init>(JFrame.java:203)
	at org.foo.paint.PaintFrame.<init>(PaintFrame.java:64)
	at org.foo.paint.Activator.run(Activator.java:92)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
	at java.awt.EventQueue.access$000(EventQueue.java:86)
	at java.awt.EventQueue$1.run(EventQueue.java:639)
	at java.awt.EventQueue$1.run(EventQueue.java:637)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

[2011-04-08 08:15:11.215] CP Connection(276)-127.0.0.1 <DE0013I> Uninstalling bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 
[2011-04-08 08:15:11.254] CP Connection(276)-127.0.0.1 <DE0014I> Uninstalled bundle 'com.iggroup.paint.example.core' version '0.0.2.SNAPSHOT'. 

[Updated on: Fri, 08 April 2011 03:44] by Moderator

Re: Swing applications based on Virgo [message #664270 is a reply to message #664265] Fri, 08 April 2011 04:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

AFAIK there should be no special steps to run Swing in Virgo. I haven't tried this though, so I'll be glad if you share your experience here on the forum Smile

From the stacktrace it seems that the invocation was successful but the code failed with NPE in the end:

java.lang.NullPointerException: null
	at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:133)
	....
	at org.foo.paint.PaintFrame.<init>(PaintFrame.java:64)
	at org.foo.paint.Activator.run(Activator.java:92)
	....
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


I'm not quite sure why this happened. Can this be due to null passed as parameter (parent component for instance)?

Regards,
Hristo Iliev
Re: Swing applications based on Virgo [message #664408 is a reply to message #664265] Fri, 08 April 2011 12:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi again,

I am probably going to Embarrassed when I figure this out, but right now I am rather frustrated. I appears that the core of my problem is that my shape api is not being resolved by the other bundles. This is demonstrated in the ide by getting Maven out of the way and just using the Bundle Classpath Container, I do not understand the lack of resolution as the package is being exported and the import/export statements are all at the same version.

Any advice would be extremely welcome at this juncture. Would even be happy to throw in a pint on next meeting Wink

Source is attached.

Many thanks,
Joel
Re: Swing applications based on Virgo [message #664412 is a reply to message #664408] Fri, 08 April 2011 13:16 Go to previous messageGo to next message
Eclipse UserFriend
Okay, I'm going out for a pint Very Happy and I am not all that embarrassed just had to learn something new.

The problem was that I was not setting the project reference, sigh... never ran into that before, guess because I build with maven usually. I found the answer in another post here. Btw I found that I have to regenerate the manifest afterwards with Bundlor for the tooling to recognize the new bundle.

Now that I can run I have a
Caused by: java.lang.ClassNotFoundException: com.apple.laf.AquaLookAndFeel
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:135)
	... 34 common frames omitted


I know zilch about Swing, so guess I will wait for my wife and sip my pint and start the BBQ.

Extra bonus point though for the kind sole who says... oh' that because Wink

New source attached.

[Updated on: Fri, 08 April 2011 13:18] by Moderator

Re: Swing applications based on Virgo [message #664416 is a reply to message #664412] Fri, 08 April 2011 13:58 Go to previous messageGo to next message
Eclipse UserFriend
I'm not a Mac user, but perhaps this forum topic will help.

More general info can be found here
Re: Swing applications based on Virgo [message #664433 is a reply to message #664416] Fri, 08 April 2011 16:01 Go to previous message
Eclipse UserFriend
Hey Hristo,

You definitely get the bonus points. Your pointers are just what I needed to be able to pursue this. You're a star!!

All the best,
Joel

Hristo Iliev wrote on Fri, 08 April 2011 18:58
I'm not a Mac user, but perhaps this forum topic will help.

More general info can be found here


[Updated on: Fri, 08 April 2011 16:02] by Moderator

Previous Topic:Continous Integration
Next Topic:No DynamicImport-Package in Scoped Bundle?
Goto Forum:
  


Current Time: Sat Jul 05 11:28:57 EDT 2025

Powered by FUDForum. Page generated in 0.05178 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top