Welcome! Log In Create A New Profile

Advanced

OS X Netbeans - was RepRap Host software bug

Posted by sheep 
OS X Netbeans - was RepRap Host software bug
March 14, 2009 08:07PM
I am moving this into a new thread as It indirectly relates to the original topic of a specific Host bug.

I was able to successfully build the 20081218 project using the linux instructions here:

[www.reprap.org]

The trick was that there is no SVN or eclipse import needed. What I did not understand where to find the projects panel.

I had a number of errors

The admonition to reload the java 3d libraries was confusing. It took a while to figure out that the rxtx files do indeed go into the /Library/Java/Extentions folder - even though they are in the project lib.

The program now compiles.

It does not run. Neither does the distribution version on this machine run.

At first there was an issue with a can not open port exeption. This was fixed by finding an old hint to create /var/lock and set the group permissions to uucp.

It looks like the initial boot loader wants to connect to the net. This is not good as I want to work this on a clean net free system.

The program still seems to fail after an attempt to open the usb port (Which I do not have the hardware for yet)

I find it interesting that the behavior of the same 20081218 distrubution (binary) acts differently on two separate mackintoshes. On the old system upgraded over time only one window opens. On the clean no net install, the program crashes on launch.

I am finding netbeans to be extremely slow. This may be due that the ibook only has 256MB of ram, although it has a 160GB drive for a swap disk. Most of the time is spent "Task Scanning."

I am finding the step debug to not work well as the steps take minutes to happen with the section that fails happening in a sub-thread which does not break when step-into is clicked on. The spawned thread runs and crashes the same as running the exec.

It would be really bad if this IDE is constantly attempting net timeouts.

In the meantime at least I have a system, which might be able to locate why the code fails to run. If I can figure out where to place a breakpoint.

I still think this is a matter of figuring out what libraries go where.

-julie




blokkendoos Wrote:
-------------------------------------------------------
> reece.arnott Wrote:
> --------------------------------------------------
> -----
> > Thats looks fine. The problem then is probably
> the
> > known issue with the Sun Java versions. i.e.
> For
> > the latest host software versions you need Java
> 6
> > which is not available for Mac OS X 10.4.
> Sorry.
>
> Java 6 is not mandatory anymore. On an Intel iMac
> with OS X 10.4.11 I successfully compiled the Java
> Host (SVN version #2539) using Netbeans. Aside
> from the host suffering some bugs as the first
> post in this thread shows.
>
> NetBeans does have some quirks to create a
> project, details you find here:
> [1m93.blogspot.com]
> -104.html
>
> Regards,
> Johan
Re: OS X Netbeans - was RepRap Host software bug
March 15, 2009 01:07AM
I am not real fond of posting to my own topic, but I have made a few more tests.

I find it interesting that the same code behaves different on two different macintoshes. Theoretically this is the 20081218 distribution.

On the distributed binary only one window opens and the error message is as follows:
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Error opening port: /dev/ttyUSB0
Exception in thread "RepRap" java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
	at org.reprap.Main$9.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Building the code on an ibook then running on the mac mini gives:
RepRap preference: Extruder0_EvenHatchDirection(degrees) not found in either preference file.
Refresh extruder preferences: java.lang.NullPointerException
RepRap preference: Extruder0_EvenHatchDirection(degrees) not found in either preference file.
Refresh extruder preferences: java.lang.NullPointerException
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Error opening port: /dev/ttyUSB0
RepRap preference: Extruder0_EvenHatchDirection(degrees) not found in either preference file.
Refresh extruder preferences: java.lang.NullPointerException
java.lang.Exception: Cannot locate background STL file
	at org.reprap.gui.Panel3D.getStlBackground(Panel3D.java:523)
	at org.reprap.gui.RepRapBuild.createSceneBranchGroup(RepRapBuild.java:304)
	at org.reprap.gui.Panel3D.initJava3d(Panel3D.java:303)
	at org.reprap.gui.Panel3D.initialise(Panel3D.java:187)
	at org.reprap.gui.RepRapBuild.(RepRapBuild.java:225)
	at org.reprap.Main.createAndShowGUI(Main.java:348)
	at org.reprap.Main.access$1500(Main.java:50)
	at org.reprap.Main$9.run(Main.java:679)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "RepRap" java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
	at org.reprap.Main$9.run(Main.java:688)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

runnining either the build distribution binary or the clean build on the ibook gives:
RepRap preference: Extruder0_EvenHatchDirection(degrees) not found in either preference file.
Refresh extruder preferences: java.lang.NullPointerException
RepRap preference: Extruder0_EvenHatchDirection(degrees) not found in either preference file.
Refresh extruder preferences: java.lang.NullPointerException
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Error opening port: /dev/ttyUSB0
RepRap preference: Extruder0_EvenHatchDirection(degrees) not found in either preference file.
Refresh extruder preferences: java.lang.NullPointerException
Exception in thread "RepRap" java.lang.NoClassDefFoundError: javax/media/opengl/GLException
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:164)
	at javax.media.j3d.Pipeline$1.run(Pipeline.java:162)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.j3d.Pipeline.createPipeline(Pipeline.java:157)
	at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:965)
	at javax.media.j3d.VirtualUniverse.(VirtualUniverse.java:299)
	at javax.media.j3d.GroupRetained.(GroupRetained.java:161)
	at javax.media.j3d.BranchGroupRetained.(BranchGroupRetained.java:55)
	at javax.media.j3d.BranchGroup.createRetained(BranchGroup.java:76)
	at javax.media.j3d.SceneGraphObject.(SceneGraphObject.java:119)
	at javax.media.j3d.Node.(Node.java:178)
	at javax.media.j3d.Group.(Group.java:556)
	at javax.media.j3d.BranchGroup.(BranchGroup.java:68)
	at org.reprap.gui.Panel3D.(Panel3D.java:86)
	at org.reprap.gui.RepRapBuild.(RepRapBuild.java:224)
	at org.reprap.Main.createAndShowGUI(Main.java:348)
	at org.reprap.Main.access$1500(Main.java:50)
	at org.reprap.Main$9.run(Main.java:679)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


I found a hidden directory at "~/.reprap" which has a copy of the preferences file. It seems that the binary distribution was build from a different source than the 20081218 release, even though that is the date on the reprap.preferences.dist file.

This still does not address the failure in gui.Panel3D. I think some of the issue is in the library class javax.media.j3d.BranchGroup. I now seem to be experencing the same null pointer others have reported.


I tried doing a ln -s reprap-wv.stl to the netbeans project folder as described in this thread: [forums.reprap.org]

This made no difference. I also attempted a search on the reprap.jar binary to find reprap-wv.stl which appears in the binary distribution, but not in the newly build distribution. (It must be in there somewhere for the error message to print.) Since the code crashes in the debugger before I get to this point I have not been able to locate where the host software is looking for this file.

It may be a few days before I get a chance to fuz around with this again. In the meantime, I am interested in what feedback other have on why this release distribution is so bunged up.

If I must, I will temporarily attach the ibook to the net to use the svn server to get the latest branch of the code. This however is something I really do not want to do. Where my cnc is and the reprap (repstrap) will be is not net accessible so the final result has to be net free.


-julie
Re: OS X Netbeans - was RepRap Host software bug smiling smiley
March 21, 2009 11:49PM
Finally some success !

By copying the Java/Extensions folder from the mac mini to the ibook, I was able to get the ibook to generate the same exceptions as the mini.

With the release build this opens up only one window. With the build from last week, I get the "Cannot locate background STL file" exception.

Running the code from the netbeans debugger. No exceptions and the botconsole window opens. Some of the buttons do not show unless the mouse is draged over the window, then they redraw spasticaly. Clicking on the button space, the button appears and the function called.

For some reason after my first successful debug session. Netbeans got confused and could not find the main project anymore. After a few attempts at rebuild, the project ran directly from the netbeans IDE.

The project will no run from the command line, eather from the /dist folder on netbeans, Or when dragged into the reprap-host-mac-20081218 folder under applications.

Examining the code, the error seems to be in the call "ClassLoader.getSystemResource(wv_location)"

This same call is also used to access the hidden prefs file in ~/.reprap so there is something failing here in which instance of this library function is called. Or how this is set to the search path for the resources.

My understanding that there is a Shell script variable called CLASSPATH. This should be set to the current "." directory. I am unclear how this becomes associated with other directories.

From the commented locations relating to the getStlBackground() it looks like there has been a lot of revision happening here.

Somehow this resource abstraction has become something system dependent. That where the code is built determines how the Java system stores the global parameters needed to get to the root resources.

At least I now have a work-around method to run the reprap program from the netbeans IDE. This way I can get the Thermocouple working and start testing some of the communications to the reprap controller.

I have started aquiring some of the parts needed for a repstrap (Using my CNC mill) So getting the host software to run is a major milestone.

It would be nice, If I was not the only one working with the Mac version of the host. Especially as I think I want a stepper extruder on my repstrap. I have a nice small stepper motor from either an old scanner or printer, that should work well as a pinch wheel system. Although it would mean borrowing a friends knurling tool.

Help incorporating the pinch wheel code into the mac would be appreciated. Especially as I would much rather work on the embedded stuff, where I do not have to fight with library paths and revisions for the sake of revisions.

-julie
Sorry, only registered users may post in this forum.

Click here to login