Re: Subclasses of a component that do not have the .wo file
Re: Subclasses of a component that do not have the .wo file
- Subject: Re: Subclasses of a component that do not have the .wo file
- From: Greg Hulands <email@hidden>
- Date: Sun, 13 Jul 2008 23:01:32 -0700
TrackLog is the application name. In trying to figure out a solution,
I had changed in the direct action to do new
AccountCreateResponse(context()), but changing it back to the way it
was, gives the same error - just a slightly different stack trace...
java.lang.reflect.InvocationTargetException
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:269)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:158)
at
er
.extensions
.appserver
.ERXDirectActionRequestHandler
.handleRequest(ERXDirectActionRequestHandler.java:124)
at
com
.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:
1687)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1567)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1531)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:
226)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.IllegalStateException: Unable to find framework
named "TrackLog".
at
com
.webobjects
.appserver
._private.WOComponentDefinition.<init>(WOComponentDefinition.java:249)
at
com
.webobjects
.appserver
.WOApplication._componentDefinitionFromClassNamed(WOApplication.java:
2785)
at
com
.webobjects
.appserver.WOApplication._componentDefinition(WOApplication.java:2889)
at
com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:
2321)
at com.webobjects.appserver.WOAction.pageWithName(WOAction.java:125)
at tl.app.rest.Account.createAction(Account.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com
.webobjects
.appserver.WODirectAction.performActionNamed(WODirectAction.java:144)
at
er
.extensions
.appserver.ERXDirectAction.performActionNamed(ERXDirectAction.java:335)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:259)
... 8 more
Just to be clear... I do not have the .wo component for
AccountCreateResponse as I am trying to avoid it as it can use the
"XMLStandardResponse" instead.
Greg
On 13/07/2008, at 10:51 PM, Chuck Hill wrote:
On Jul 13, 2008, at 10:38 PM, Greg Hulands wrote:
WO 5.4.2.
<com.webobjects.appserver._private.WOComponentDefinition> No
template found for component AccountCreateResponse at "file:/Users/
ghulands/Documents/workspace/TrackLog/build/TrackLog.woa/".
java.lang.reflect.InvocationTargetException
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:
269)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:
158)
at
er
.extensions
.appserver
.ERXDirectActionRequestHandler
.handleRequest(ERXDirectActionRequestHandler.java:124)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1567)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1531)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.IllegalStateException: Unable to find
framework named "TrackLog".
Is TrackLog your application and not a framework? If so, check here
for possible causes:
http://www.gvcsitemaker.com/gvc.webobjects/faq&mode=single&recordID=72521
Chuck
at
com
.webobjects
.appserver
._private.WOComponentDefinition.<init>(WOComponentDefinition.java:
249)
at
com
.webobjects
.appserver
.WOApplication
._componentDefinitionFromClassNamed(WOApplication.java:2785)
at
com
.webobjects
.appserver.WOApplication._componentDefinition(WOApplication.java:
2889)
at
com
.webobjects
.appserver.WOComponent._componentDefinition(WOComponent.java:475)
at com.webobjects.appserver.WOComponent.<init>(WOComponent.java:239)
at
tl
.app
.components.XMLResponseComponent.<init>(XMLResponseComponent.java:23)
at
tl
.app
.components.AccountCreateResponse.<init>(AccountCreateResponse.java:
17)
at tl.app.rest.Account.createAction(Account.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com
.webobjects
.appserver.WODirectAction.performActionNamed(WODirectAction.java:144)
at
er
.extensions
.appserver.ERXDirectAction.performActionNamed(ERXDirectAction.java:
335)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:
259)
... 8 more
I have changed the original way I was doing it. I have the
XMLResponse now being the shell component that has the standard
format for the way I pass back a response...
eg.
<Response code="100" message="some message">
<component content here/>
</Response>
I now have a XMLResponseComponent which is what all my REST
components subclass from. The majority of these do not require to
send back any custom content in the xml response, so I created a
helper component called XMLStandardResponse which just contains
<webobject name="xml">
</webobject>
xml: XMLResponse {
responseCode = responseCode;
responseMessage = responseMessage;
}
The actual class of this component doesn't implement these bindings
because I am overriding the template() method in the
XMLResponseComponent class...
private static WOElement _standardResponse = null;
public WOElement template() {
if (useStandardResponseFormat()) {
if (_standardResponse == null) {
_standardResponse = (new
XMLStandardResponse(context())).template();
}
return _standardResponse;
}
else {
return super.template();
}
}
I had put in debug logging into the template() method and it is
never getting called, so the only thing I can think of is that the
component creation doesn't use this method early on in the init
process.
Greg
On 13/07/2008, at 12:43 PM, Chuck Hill wrote:
Which version of WO? Can you paste the exception name, message,
and stack trace from the Console view in Eclipse? That will be
more helpful than a screen capture of the browser.
Chuck
On Jul 12, 2008, at 12:55 PM, Greg Hulands wrote:
When I override template() I'm still getting the same stack
trace... template() is not getting called before this exception
occurring... It looks like it tries to load the .wo file before
asking itself for the template().
I can't see any other methods to override to get this to work.
Greg
On 12/07/2008, at 11:41 AM, Chuck Hill wrote:
Don't see it in the new Wiki, but this should get you started:
http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Applications/Development/Custom_Templates
Chuck
On Jul 12, 2008, at 11:16 AM, Greg Hulands wrote:
Hi,
I have a component named XMLResponse that has a .wo file with
an api so that all responses from my REST interface share an
identical format. I have a subclass of XMLResponse named
CreateAccountResponse. When I try to create this page with
CreateAccountResponse response =
(CreateAccountResponse
)pageWithName(CreateAccountResponse.class.getName());
I get this
<pastedGraphic.png>
It looks like it is trying to find the .wo file for the
CreateAccountResponse component... only it doesn't exist as I
want it to use its super class's one.
Is this possible to do?
Regards,
Greg
_______________________________________________
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
--
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
--
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