From: Drayton B. <dra...@gm...> - 2009-11-24 12:01:51
|
Hi all I checked out XMLVM a while ago and I've been watching it grow over the last few months. I've been quite impressed with the development! (Infact I find the whole idea quite ingenious!) Anyway's I've now decided to dip my feet in the water and give it a go! Although, as this is going to be more than testing a proof of concept, there's something I would like to clear up before I start. The problem I'm having is probably due to my development environment, which at the moment is Netbeans 6.7.1 When I import the XMLVM project into Netbeans and try and run the iFireworks example I get error: Unable to load image with name battery.png Unable to load image with name wifi.png Unable to load image with name chassis.png java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:161) at org.xmlvm.iphone.internal.Device.addChassis(Device.java:101) at org.xmlvm.iphone.internal.Device.<init>(Device.java:68) at org.xmlvm.iphone.internal.SimulatorGUI.addDevice(SimulatorGUI.java:36) at org.xmlvm.iphone.internal.SimulatorGUI.<init>(SimulatorGUI.java:27) at org.xmlvm.iphone.internal.SimulatorDesktop.<init>(SimulatorDesktop.java:54) at org.xmlvm.iphone.UIApplication.<init>(UIApplication.java:24) at org.xmlvm.demo.ifireworks.Main.<init>(Main.java:8) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.xmlvm.iphone.UIApplication.main(UIApplication.java:78) at org.xmlvm.demo.ifireworks.Main.main(Main.java:48) Now I know this is because the images are not being found by the getResource() method in ImageLoader class (ln: 13). When I was just playing about with the code I would just hard code the appropriate path to get it to work. However I would now like to be able to just run the application and have it run without having to change this line. (As you can expect this gets frustrating quite quickly, also I would rather use the code as I get it from you :) ) I've tried using Eclipse, which seems to work, but I'm not familiar with the IDE, so I'd rather stick to what I know. I've also found this folder: xmlvm/var/iphone/netbeans which seems to have a netbeans project skeleton, however I cann't open this project. What version of netbeans is being used for this? I've tried compiling the source in Eclipse and then using the xmlvm.jar in a newly created NB project (both with and without copying over the relevent files with ones from the skeleton project) however the exceptions persist. I would greatly appreciate any sort of help with regards to this problem. Besides this I think the project is fantastic, and I'm looking forward to tapping out my first iPhone app with it! Regards Drayton -- http://www.facebook.com/DraytonBrown |
From: Arno P. <ar...@pu...> - 2009-11-24 12:40:54
|
you already found out the core of the problem: in order to launch an application you need to set the classpath properly. Under Eclipse you can define a launch configuration where you have to set this once. I'm not a Netbeans user, so I don't know what you have to do there. In most cases it might be sufficient to include xmlvm.jar to the classpath. Here are a few shell commands to get you going: java -jar xmlvm.jar --skeleton=iphone --app-name=HelloWorld mkdir bin javac -classpath xmlvm.jar -sourcepath src -d bin src/xmlvm/Main.java java -cp xmlvm.jar:bin xmlvm.Main Notice that the --skeleton option will also generate Netbeans project files. I've never tried that but I think/assume that it will have all necessary paths configured correctly. Arno Drayton Brown wrote: > Hi all > > I checked out XMLVM a while ago and I've been watching it grow over the > last few months. I've been quite impressed with the development! (Infact > I find the whole idea quite ingenious!) > Anyway's I've now decided to dip my feet in the water and give it a go! > Although, as this is going to be more than testing a proof of concept, > there's something I would like to clear up before I start. > > The problem I'm having is probably due to my development environment, > which at the moment is Netbeans 6.7.1 When I import the XMLVM project > into Netbeans and try and run the iFireworks example I get error: > > Unable to load image with name battery.png > Unable to load image with name wifi.png > Unable to load image with name chassis.png > java.lang.NullPointerException > at javax.swing.ImageIcon.<init>(ImageIcon.java:161) > at org.xmlvm.iphone.internal.Device.addChassis(Device.java:101) > at org.xmlvm.iphone.internal.Device.<init>(Device.java:68) > at > org.xmlvm.iphone.internal.SimulatorGUI.addDevice(SimulatorGUI.java:36) > at > org.xmlvm.iphone.internal.SimulatorGUI.<init>(SimulatorGUI.java:27) > at > org.xmlvm.iphone.internal.SimulatorDesktop.<init>(SimulatorDesktop.java:54) > at org.xmlvm.iphone.UIApplication.<init>(UIApplication.java:24) > at org.xmlvm.demo.ifireworks.Main.<init>(Main.java:8) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:355) > at java.lang.Class.newInstance(Class.java:308) > at org.xmlvm.iphone.UIApplication.main(UIApplication.java:78) > at org.xmlvm.demo.ifireworks.Main.main(Main.java:48) > > Now I know this is because the images are not being found by the > getResource() method in ImageLoader class (ln: 13). When I was just > playing about with the code I would just hard code the appropriate path > to get it to work. However I would now like to be able to just run the > application and have it run without having to change this line. (As you > can expect this gets frustrating quite quickly, also I would rather use > the code as I get it from you :) ) > > I've tried using Eclipse, which seems to work, but I'm not familiar with > the IDE, so I'd rather stick to what I know. I've also found this folder: > > xmlvm/var/iphone/netbeans > > which seems to have a netbeans project skeleton, however I cann't open > this project. What version of netbeans is being used for this? > > I've tried compiling the source in Eclipse and then using the xmlvm.jar > in a newly created NB project (both with and without copying over the > relevent files with ones from the skeleton project) however the > exceptions persist. > > I would greatly appreciate any sort of help with regards to this problem. > > Besides this I think the project is fantastic, and I'm looking forward > to tapping out my first iPhone app with it! > > Regards > Drayton > > -- > http://www.facebook.com/DraytonBrown > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |
From: Panayotis K. <pan...@pa...> - 2009-11-24 21:22:59
|
On 24 Νοε 2009, at 2:01 μ.μ., Drayton Brown wrote: > Hi all > > I checked out XMLVM a while ago and I've been watching it grow over the last few months. I've been quite impressed with the development! (Infact I find the whole idea quite ingenious!) > Anyway's I've now decided to dip my feet in the water and give it a go! Although, as this is going to be more than testing a proof of concept, there's something I would like to clear up before I start. > > The problem I'm having is probably due to my development environment, which at the moment is Netbeans 6.7.1 When I import the XMLVM project into Netbeans and try and run the iFireworks example I get error: One easy solution is to create a skeleton project and add iFireworks files (or whatever) in it. If you want to do it manually by yourself, click on Project -> Properties -> Libraries -> Add Jar/folder and add the xmlvm.jar file All required files (including the images) are inside xmlvm is working perfectly with Netbeans 6.7.1 |