Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 01:08:44 am
Xith3D CommunityXith3D InternalsDeveloper discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)HowTo: Render controls in Eclipse Rich Client Plugin with Xith3D
Pages: 1 2 [3]
Print
Author Topic: HowTo: Render controls in Eclipse Rich Client Plugin with Xith3D  (Read 7779 times)
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #30 on: 09. March 2008, 11:11:40 pm »

The easiest way to get around these initial problems is to unzip all the X3D jars into the output directory of your project.  Clearly, your system cannot find the files inside gluegen.jar.  Before we get too far into some of the stuff that it might be, have you been able to run the regular JOGL tests found as part of the tools (a separate project)?
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
qbproger
developers
Becoming dependent
***
Offline Offline

Posts: 217


View Profile
« Reply #31 on: 10. March 2008, 01:12:12 am »

The easiest way to get around these initial problems is to unzip all the X3D jars into the output directory of your project.  Clearly, your system cannot find the files inside gluegen.jar.  Before we get too far into some of the stuff that it might be, have you been able to run the regular JOGL tests found as part of the tools (a separate project)?

There isn't so much an output directory in this application.  It's built on top of the eclipse framework.  (Similar to: http://udig.refractions.net/ It's another application built on the eclipse framework)  I originally put everything in the plugins directory.  Nothing got detected because it wasn't an Eclipse Plugin.  I repackaged them as Eclipse plugins, and put everything in the plugins directory.  The plugins aren't copied to any kind of output directory.

I have been able to run the demos on this computer.  I could create a project and create a Java app that uses Xith3D.  It wouldn't be built on the eclipse framework though.  I could just write a simple java app with everything in the classpath.  I'd suspect it would work, just like the demos.

I suspect the problem is that I didn't package the plugins correctly.  I think I'm missing a dependency somewhere.  For each plugin that uses any other plugin, you have to add a "Require-Bundle" to the manifest for everything it requires.  I think I might be missing one of those for something that needs gluegen.

One thing I could try would be to include the X3D jars to the classpath rather than trying to load them as plugins.  I'm not sure if this will work correctly, but it's worth a shot.  I think I'll give that a shot next and see what happens.

Thanks.
Logged

horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #32 on: 10. March 2008, 03:27:45 am »

There isn't so much an output directory in this application.  It's built on top of the eclipse framework.  (Similar to: http://udig.refractions.net/ It's another application built on the eclipse framework)  I originally put everything in the plugins directory.  Nothing got detected because it wasn't an Eclipse Plugin.  I repackaged them as Eclipse plugins, and put everything in the plugins directory.  The plugins aren't copied to any kind of output directory.

That's more of a production configuration.  I was thinking that you should start with baby steps.  If you create an Eclipse plug-in project, you can set it to compile your class files into an output directory that will automatically be included in the classpath when you run the subordinate/child Eclipse that uses your project.  Sometimes it gets confusing for people because there are two versions of Eclipse running with some common classes and some unique classes: those in the plugins directory and those in the output directory.  When you run (or debug) the Eclipse plug-in project, Eclipse knows how to set things up correctly.

Not that you need to start at the beginning of these steps; however, I suggest using the following steps to get running with Xith inside Eclipse:
  • Run the Xith demos located in the toolkit project
  • Create Eclipse plug-in project using the "Hello World" plug-in project wizard
  • Execute the project to get a feel for how it creates a parent/child environment with all your standard plug-ins from the plug-ins directory in both environments plus your "Hello World" view only available in the child
  • Either place the Xith libs in the libs directory of the project or unzip all the files into a subdirectory of libs inside the project
  • Initialize Xith as you did above
  • Execute to make sure everything runs without a stack trace
  • Code and execute whatever demo code you like until you get a good feel for camera positioning and placing objects in the Xith world
  • Package your plug-in correctly

Each of these steps teaches something and/or reveals the status of your development environment.  In my mind, you're trying the last step without all the intermediate steps.

I have been able to run the demos on this computer.  I could create a project and create a Java app that uses Xith3D.  It wouldn't be built on the eclipse framework though.  I could just write a simple java app with everything in the classpath.  I'd suspect it would work, just like the demos.

Good, that indicates that your environment is compatible.  I don't see a particular reason to write a standalone java app.

I suspect the problem is that I didn't package the plugins correctly.  I think I'm missing a dependency somewhere.  For each plugin that uses any other plugin, you have to add a "Require-Bundle" to the manifest for everything it requires.  I think I might be missing one of those for something that needs gluegen.

As you have discovered, this piece is hard due to the minimal feedback.  That's why I suggest the steps outlined above combined with source code control (SVN, CVS, etc.)  Even without an external system, Eclipse has a built-in 7-day history feature that works well for demo sized code.

One thing I could try would be to include the X3D jars to the classpath rather than trying to load them as plugins.  I'm not sure if this will work correctly, but it's worth a shot.  I think I'll give that a shot next and see what happens.

Depending how you manipulate your classpath, this can be problematic for many people.  I suggest allowing Eclipse to handle this step (#6 in my list).


Hope this advice leads you somewhere useful.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
qbproger
developers
Becoming dependent
***
Offline Offline

Posts: 217


View Profile
« Reply #33 on: 10. March 2008, 03:11:29 pm »

Thanks for the advice, I'll begin working on it today.  I'm not sure when I'll have the sequence of steps done, but as soon as I finish I'll let you know if it works.

Thanks again.
Logged

qbproger
developers
Becoming dependent
***
Offline Offline

Posts: 217


View Profile
« Reply #34 on: 11. March 2008, 03:48:49 pm »

horati, I got it working, thanks for all your help.  I started going through your steps, but I don't have a lib folder.  I ended up re-exporting all the plugins, and that seemed to fix the problem.

The only problem I'm having now is that the 3D doesn't show up unless I resize the window.  If you have any thoughts on that let me know.

Thanks again
Logged

qbproger
developers
Becoming dependent
***
Offline Offline

Posts: 217


View Profile
« Reply #35 on: 11. March 2008, 04:55:17 pm »

The only problem I'm having now is that the 3D doesn't show up unless I resize the window.  If you have any thoughts on that let me know.

I added a setFocus(); to the end of createPartControl() and now it works.
Logged

horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #36 on: 11. March 2008, 09:10:24 pm »

I added a setFocus(); to the end of createPartControl() and now it works.

Congratulations!
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Earl
Just dropped in

Offline Offline

Posts: 9


View Profile
« Reply #37 on: 24. September 2008, 09:10:25 am »

Hey guys,

i tested every example of code from this thread, but no version runs.
i use ganymede, the stacktrace which i got is the following:
Code:
java.lang.Error: java.lang.NoClassDefFoundError: org/eclipse/swt/graphics/Device
at org.xith3d.render.Canvas3DFactory.create(Canvas3DFactory.java:109)
at org.xith3d.render.Canvas3DFactory.create(Canvas3DFactory.java:158)
at org.xith3d.render.Canvas3DFactory.create(Canvas3DFactory.java:210)
at edu.tum.cs.common3d.demo.Demo3DView.createPartControl(Demo3DView.java:38)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:371)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:230)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2127)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1062)
at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3773)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3770)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3746)
at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:165)
at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:109)
at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247)
at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:134)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/graphics/Device
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.xith3d.render.Canvas3DFactory.create(Canvas3DFactory.java:105)
... 50 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.graphics.Device
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:481)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
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)
... 53 more

Does someone know, what to do?
Thanks for everyone's help

greetings

my girlfriend edith was here:
i solved the error - it was a missing dependencie. thanks guys!
« Last Edit: 24. September 2008, 09:19:36 am by Earl » Logged
Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic