Re: WO doesn´t find correct "Session" class
Re: WO doesn´t find correct "Session" class
- Subject: Re: WO doesn´t find correct "Session" class
- From: Georg von Bülow <email@hidden>
- Date: Wed, 11 Oct 2006 18:06:02 -0300
Hi Chuck,
thank you, I'll try to get through with cheating :-)
To your first response, I´m doing all the way you said. Ok, I call
ERXApplication.main( argv, Application.class );
but this shouldn´t make any difference. I start command line
./Prontuario. Actually I can see that everything starts up fine including
didFinishLaunching(). Only when I try to open the app in my browser,
i.e. WOApplication should create a Session, it trys to pick up the
wrong one from the Framework.
I think this used to work when I had Application/Session/DirectAction in
the default package (which I skipped for refactoring), even with
embedded Frameworks.
Thanks again,
Georg
Well, if cheating is what you want... :-)
In Application.java add this:
public WOSession createSessionForRequest(WORequest aRequest) {
return new br.nist.nust.prontuario.basico.Session();
}
On Oct 11, 2006, at 1:37 PM, Georg von Bülow wrote:
Thanks Mike,
I would like to cheat, but where and how I can set this? The class
_NSUtilities is final...
Greetings,
Georg
When you are embedding frameworks, the order of the classes in the
applications NSBundle is effectively random (at this point,
anyway). I'm guessing this is what you're seeing. The order of
classloading with embedding does not respect classpath ordering. I
just stumbled onto this exact problem yesterday with "Main" getting
loaded from ERIMAdaptor when I embedded the Wonder frameworks.
You might be able to cheat with
_NSUtilities.setClassForName(MySession.class, "Session"); as a
stop-gap. We need to address this "officially", though and see if
it's possible to change the way NSBundle stores that order.
On Oct 11, 2006, at 3:08 PM, Georg von Bülow wrote:
Hi,
I get the following strange error message when trying to run a .woa
through terminal (or JavaMonitor).
/java.lang.IllegalArgumentException:
<br.nist.nust.prontuario.basico.Application> Class 'Session' exists
(class javax.mail.Session) but is not a subclass of WOSession.../
True, there is a Session.class in ERJavaMail, which I use as an
embedded Framework. But the generated classpath looks quite normal,
i.e. first appears the jar of the application (Prontuario) and
later the one of the embedded frameworks:
/Generated classpath:
/Library/WebObjects/Applications/Prontuario.woa/Contents/Resources/Java/prontuario.jar
...[more stuff]
/Library/WebObjects/Applications/Prontuario.woa/Contents/Frameworks/Library/Frameworks/ERJavaMail.framework/Resources/Java/mail-1.3.jar
...[more stuff]/
My Session class is in the same package as my Application
(br.nist.nust.prontuario.basico). Any idea why WOApplication looks
up Session.class from the Framework? Shouldn´t it look first in the
same package as my Application.class is? Should I configure this
somewhere??
Now what confuses me even more, is that I have a quite similiar app
which also uses ERJavaMail and runs whithout problems. I checked
and compared the two apps many times but I didn´t see any obvious
differences which could explain this (the other app (Acidente) has
an acidente.jar and the Application.class is in the package
br.nist.acidente.basico).
I´m using WO 5.3.1/Mac, and build with WOLips. Ah, and I use WONDER.
Any hint would be greatly apreciated, I´m just running out of ideas...
Thanks in advance,
Georg
--\o/ Georg von Bülow, Moleque de Idéias Educação e Tecnologia Ltda
| Phone: 55-21-2710-0178 E-mail: email@hidden
/ \ http://www.moleque.com.br Niterói - Rio de Janeiro - Brasil
_______________________________________________
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
_______________________________________________
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
--\o/ Georg von Bülow, Moleque de Idéias Educação e Tecnologia Ltda
| Phone: 55-21-2710-0178 E-mail: email@hidden
/ \ http://www.moleque.com.br Niterói - Rio de Janeiro - Brasil
_______________________________________________
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
--
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
--
\o/ Georg von Bülow, Moleque de Idéias Educação e Tecnologia Ltda
| Phone: 55-21-2710-0178 E-mail: email@hidden
/ \ http://www.moleque.com.br Niterói - Rio de Janeiro - Brasil
_______________________________________________
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