Direct to Web java.lang.ClassNotFoundException: Application error
Date:
2004-12-30 12:42:33
From:
Florijan
I am using OSX 10.3.7 with WebObjects 5.2.3
When i try making a Direct to Web project in XCode, and I go through the tutorial for it, i get a succesful compilation result, but when the projects starts running i don't get further from the command line. It loads it's WebObjects extensions, and then reposrts the following:
Can't load Application class, exiting...
java.lang.ClassNotFoundException: Application
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at com.webobjects._bootstrap.WOBootstrap.main(WOBootstrap.java:68)
Executable D2WTutorial9 has exited with status 1.
i tried running it on a newly installed system, and on a newly made user, i can never get it to work. The funny thing is that the guy next to me can run those same tutorials, and also the project that i made and transferred to him.
Any help would be appreciated because i really don't know where this is coming from.
Thanks
Showing messages 1 through 9 of 9.
Direct to Web java.lang.ClassNotFoundException: Application error
2004-12-30 14:17:43
Josh Paul |
[View]
Florijan,
There are a few things that come to mind:
1) check to see you are building the correct target. You will find this setting in the upper left corner of your project window, as a popup menu. It should be set to "D2WTutorial9".
2) check to see that the Application class is a part of your Application Server build target. You can check this by selecting Application Server from the Target popup menu (as above). Then check to see that the checkbox to the left is checked. If you don't see a checkbox, select View->Groups & Files Columns->Target Membership.
3) make sure there are no spaces in the path to your project. For example: "/Users/Florijan/Projects/D2WTutorial9" works well, whereas "/Users/Florijan/My Projects/D2WTutorial" does not.
HTH,
Josh
Direct to Web java.lang.ClassNotFoundException: Application error
2004-12-31 05:43:22
Florijan
[View]
Thank you Josh,
Creating projects in paths with no spaces helped. I managed to run the login screen of WebObjects. However, when I clicked login, I got the following error:
Application:
D2WTutorial
Error:
com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: [ valueForKey()]: lookup of unknown key: 'visibleEntityNames'. This WOComponent does not have an instance variable of the name visibleEntityNames or _visibleEntityNames, nor a method of the name visibleEntityNames, _visibleEntityNames, getVisibleEntityNames, or _getVisibleEntityNames
Reason:
[<com.webobjects.appserver.WOComponent name: MenuHeader subcomponents: null > valueForKey()]: lookup of unknown key: 'visibleEntityNames'. This WOComponent does not have an instance variable of the name visibleEntityNames or _visibleEntityNames, nor a method of the name visibleEntityNames, _visibleEntityNames, getVisibleEntityNames, or _getVisibleEntityNames
From what I can make out of it, it looks like he can not access methods of the classes generated by the EO model. And I am using the RealEstate tutorial model specified in the D2W documentation. I really don't understand why that happens because the model is freshly installed with the system, and the OpenBase says that he is runnig the database.
I would be grateful for suggestions on how to overcome this.
Thank you
Managed to fix my problem. I went through the XCode 1.5 documentation and saw that they had an issue with generating D2W projects, by not placing two java classes in their proper place. After changing that in my projects I now can get what the tutorial says i should get. Maybe now i can continue learning...
I would like to know in details, what you did to overcome this issue. I have the same problem with my D2W application and all the samples. I appreciate any help!
Error: com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: [ valueForKey()]: lookup of unknown key: 'visibleEntityNames'. This WOComponent does not have an instance variable of the name visibleEntityNames or _visibleEntityNames, nor a method of the name visibleEntityNames, _visibleEntityNames, getVisibleEntityNames, or _getVisibleEntityNames
Reason: [<com.webobjects.appserver.WOComponent name: MenuHeader subcomponents: null > valueForKey()]: lookup of unknown key: 'visibleEntityNames'. This WOComponent does not have an instance variable of the name visibleEntityNames or _visibleEntityNames, nor a method of the name visibleEntityNames, _visibleEntityNames, getVisibleEntityNames, or _getVisibleEntityNames
problem fixed
2006-12-10 08:55:41
Josh Paul |
[View]
From the release notes:
For Direct To Web projects: When creating a new Direct To Web project, you'll notice that the MenuHeader.java and PageWrapper.java source files are not correctly added to the Application Servers target and are in the Bundle Resources build phase and not in the Sources build phase. After creating a new project, open the Application Servers target in the Groups & Files view and drag the MenuHeader.java and PageWrapper.java source files from the Bundle Resources build phase to Sources build phase.
Instructions, as explained by Andres Toussaint on the Apple WebObjects list:
'After you create your D2W project in xCode, open the contents of the "Targets" group (a red bullseye).
Double click the "Application Server" target.
Select "Build Phases". In the right hand you will see the build phases, indicated by "Sources", "Bundle resources", etc..
Drag the MenuHeader.java and PageWrapper.java from the Bundle Resources to the Sources.
I got my D2W to work correctly. Thank you so much!
problem fixed
2006-12-10 08:55:17
Josh Paul |
[View]
From the release notes:
For Direct To Web projects: When creating a new Direct To Web project, you'll notice that the MenuHeader.java and PageWrapper.java source files are not correctly added to the Application Servers target and are in the Bundle Resources build phase and not in the Sources build phase. After creating a new project, open the Application Servers target in the Groups & Files view and drag the MenuHeader.java and PageWrapper.java source files from the Bundle Resources build phase to Sources build phase.
Instructions, as explained by Andres Toussaint on the Apple WebObjects list:
'After you create your D2W project in xCode, open the contents of the "Targets" group (a red bullseye).
Double click the "Application Server" target.
Select "Build Phases". In the right hand you will see the build phases, indicated by "Sources", "Bundle resources", etc..
Drag the MenuHeader.java and PageWrapper.java from the Bundle Resources to the Sources.
What java classes and where are you supposed to change the two java classes to? I am having the same errors as you previously had. I know that one of the java classes is MenuHeader.java .. please help!
There are a few things that come to mind:
1) check to see you are building the correct target. You will find this setting in the upper left corner of your project window, as a popup menu. It should be set to "D2WTutorial9".
2) check to see that the Application class is a part of your Application Server build target. You can check this by selecting Application Server from the Target popup menu (as above). Then check to see that the checkbox to the left is checked. If you don't see a checkbox, select View->Groups & Files Columns->Target Membership.
3) make sure there are no spaces in the path to your project. For example: "/Users/Florijan/Projects/D2WTutorial9" works well, whereas "/Users/Florijan/My Projects/D2WTutorial" does not.
HTH,
Josh