Re: Moving Classes into a package
Re: Moving Classes into a package
- Subject: Re: Moving Classes into a package
- From: Chuck Hill <email@hidden>
- Date: Mon, 11 Sep 2006 21:53:37 -0700
Hi Don,
On Sep 11, 2006, at 9:20 PM, Don Lindsay wrote:
I have more information after playing with this all night. :)
Ah, the joys of geekdom!
I can comment out all of the package clauses in my classes and the
application functions.
OK, that sounds like some confusion on WO's part resolving partial
(class only) names to fully (package) qualified names. It is pretty
good at guessing, but not perfect. Do you have any classes (EOs,
pages, whatever) that have the same class name but different
packages? Perhaps the same class name as in the WO frameworks (or
Wonder frameworks)?
I put the package declarations back in and I get an error about two
protected variables in my LoginPage (aFormKey, etc). All of the
classes are part of the package so should have access to these
protected variables.
No, it doesn't have access. These are accessed via KVC which is
implemented by a class in another package
(com.webobjects.foundation). You need to make them public, provide
accessor/mutator methods, or implement
com.webobjects.foundation.NSKeyValueCoding.ValueAccessor in that
package.
I do not get a stack trace from the application when it encounters
this error. All I get is that a property aFormKey, _aFormKey, etc
does not exist.
This is because KVC can't access them.
If I change the protected keyword to public then the application
will load, but then the main page reloads and does not attempt to
access it's Direct Action.
Probably need more information here. What is the main page supposed
to do? How does it do it? Code examples help.
I think the protected keyword is causing the issue, but I am not
sure how to resolve it. I am guessing the reflection is trying to
get the value of the protected variable and cannot because it is
not part of the main package.
The protected keyword should not be causing the failure to login,
only the error you report above.
So, should I not include my components in the application package
com.psgs.dwtm?
You should include them in some package.
More below.
Chuck
On Sep 11, 2006, at 10:11 PM, Don Lindsay wrote:
Yes, I see session info and if I debug I see the DispatchRequest
action in the application is being run.
don
On Sep 11, 2006, at 9:34 PM, John Larson wrote:
Don -
I can't help much, but I can tell you that you don't have to
fully qualify the page name. I keep all my classes packaged (WO
components and EO objects) and never had a problem. Usually when
this happens it is because the application is returning the
default action. When the page comes up after you try to login do
you see session info in the URL?
John
On Sep 11, 2006, at 7:13 PM, Don Lindsay wrote:
Hello All;
I have an application that needs to be published on Tomcat.
When I installed it, in the log, there was a recommendation that
the Application was not in a package and this might cause
issues. So I decided to package the classes.
Application Description:
WebObjects Version: 5.3
Frameworks (Custom): JavaWOSecurity.Framewor
Changes Made to Package the Application:
Added package name com.psgs.dwtm to the top of all java files.
Modified all EO descriptions to fully qualify the classes.
(Example: com.psgs.dwtm.Person)
Modified the dwtm build to specify the full classpath of the
application.
Issue:
When I run the Application in XCode, the Application The
LoginPage comes up. I enter username and password and submit
the form and the page refreshes but never validates the user.
There are no errors or stack traces in the logs. Debugging does
not reveal anything strange.
What code is the login button bound to?
Questions:
1. When calling pageWithName do I have to fully qualify the
page name?
(Example pageWithName("com.psgs.dwtm.WelcomePage") as opposed
to pageWithName("WelcomePage")
Not 100% necessary, but a good idea. The best idiom I have seen for
this is:
pageWithName(com.psgs.dwtm.WelcomePage.class.getName())
2. Why has the application quit functioning? Has anyone
experienced anything like this before?
It seems that two classes somewhere have the same name.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden