RE: Rendering Bug?
Kirk Daries <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <D09B591872D1D611AF2B0010B5A1AAD07BE99A@WCSMAIL> |
Hi Jake,
Getting a weird exception.
It's something to do the dom stuff??
Xerces2 or Xmlc.
Don't know which one.
The funny thing is.
It compiles fine. The rest of the application works fine.
Just when I hit this particular page it falls over.
Here's the code snippet...
pageSize = (HTMLSelectElement) xmlcPage.getElementById("pageSize");
.
.
.
.
//Process any properties for pageNumber
if (pageSize != null) {
//If there is no resultset, disabled the combo box.
if ((dbResultSet == null) ||(dbResultSet.getTotalPages() == 0)) {
pageSize.setDisabled(true);
} else {
//Get the Browse Sizes for this application
StringTokenizer e = new
StringTokenizer(requestContext.getApplication().getDefaultBrowsePageSizes(),
",");
//Document doc = vc.getElementFactory().getDocument();
//Loop through list, adding option elements
while (e.hasMoreElements()) {
String size = e.nextToken();
//Use the HTML doc object to create option elements
HTMLOptionElement optionElement = (HTMLOptionElement)
xmlcPage.createElement("OPTION");
//Set their values
optionElement.setValue(size);
//Determine if the element needs to be selected
if (pageSizeValue != null) {
if (size.equals(pageSizeValue.toString())) {
optionElement.setSelected(true);
}
}
//Set the element text
DOMUtil.setTextInNode(optionElement, size,false);
//Add to the select element
pageSize.add(optionElement,null);
}
}
}
Whadda think?
This used to work in the release of Barracuda?
Possible runtime conflict with another package??
The offending statement is:
optionElement.setSelected(true);
java.lang.NoSuchMethodError:
org.w3c.dom.html.HTMLOptionElement.setSelected(Z)V
at
sitawc.barraframework.presentation.buttons.BrowseButtons.processButtonState(
BrowseButtons.java:252)
at
sitawc.barraframework.presentation.buttons.BrowseButtons.processButtonNodes(
BrowseButtons.java:78)
at
sitawc.barraframework.eventListeners.response.privateEvent.RenderBrowsePage_
Listener$RenderBrowsePage_Handler$BrowsePageModel.getItem(RenderBrowsePage_L
istener.java:403)
at
org.enhydra.barracuda.core.comp.AbstractTemplateModel.getItem(AbstractTempla
teModel.java:125)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.getNode(TemplateHelp
er.java:307)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.copyChildNodes(Templ
ateHelper.java:131)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.getNode(TemplateHelp
er.java:618)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.copyChildNodes(Templ
ateHelper.java:131)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.getNode(TemplateHelp
er.java:618)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.copyChildNodes(Templ
ateHelper.java:131)
at
org.enhydra.barracuda.core.comp.renderer.TemplateHelper.render(TemplateHelpe
r.java:109)
at
org.enhydra.barracuda.core.comp.renderer.html.HTMLTemplateRenderer.renderCom
ponent(HTMLTemplateRenderer.java:114)
at
org.enhydra.barracuda.core.comp.BComponent.renderView(BComponent.java:567)
at
org.enhydra.barracuda.core.comp.BComponent.render(BComponent.java:462)
at
org.enhydra.barracuda.core.comp.BComponent.render(BComponent.java:480)
at
org.enhydra.barracuda.core.comp.BComponent.render(BComponent.java:388)
at
sitawc.barraframework.eventListeners.response.privateEvent.RenderBrowsePage_
Listener$RenderBrowsePage_Handler.handleViewEvent(RenderBrowsePage_Listener.
java:224)
at
org.enhydra.barracuda.core.event.DefaultBaseEventListener.handleEvent(Defaul
tBaseEventListener.java:66)
at
org.enhydra.barracuda.core.event.DefaultEventDispatcher.notifyListeners(Defa
ultEventDispatcher.java:415)
at
org.enhydra.barracuda.core.event.DefaultEventDispatcher.dispatch(DefaultEven
tDispatcher.java:185)
at
org.enhydra.barracuda.core.event.DefaultEventDispatcher.dispatchEvent(Defaul
tEventDispatcher.java:122)
at
org.enhydra.barracuda.core.event.DefaultEventBroker.dispatchEvent(DefaultEve
ntBroker.java:494)
at
org.enhydra.barracuda.core.event.ApplicationGateway.handleDefaultExt(Applica
tionGateway.java:404)
at
org.enhydra.barracuda.core.event.ApplicationGateway.handleDefault(Applicatio
nGateway.java:234)
at
org.enhydra.barracuda.core.event.ApplicationGateway.doGet(ApplicationGateway
.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:534)
Thanx
Regards
KD
-----Original Message-----
X-Sybari-Space: 00000000 00000000 00000000 00000000
From: Jacob Kjome [mailto:[email protected]]
Sent: 20 June 2003 07:10
To: [email protected]
Subject: RE: [Barracuda] Rendering Bug?
Hi Kirk,
Note that you will need to have xercesImpl.jar (Xerces2) + xml-apis.jar or
xmlParserAPIs.jar in your classpath. Actually, put them in one of the
common lib directories in Tomcat 3.3. Remove any older xmlc-*
jars....especially the xerces 1.4.4 jar.
One quick way to see which jars you need in your WEB-INF/lib is to run "ant
install" on the Barracuda build and then look at the resulting jars in
WEB-INF/lib. You can copy the jars from there. The ones you need are (in
alphabetical order)...
barracuda-core.jar
bcel-5.1.jar
gnu-regexp-1.1.4.jar
jtidy-r7-xmlc-2.2.jar
log4j-1.2.8.jar
log4j-sandbox-selector-0.1alpha.jar
log4j-sandbox-servlet-0.1alpha.jar
plankton.jar
xmlc-all-runtime-2.2.jar
To use the Localize taskdef, you will also need the following jar in your
Ant build classpath...
WEB-INF/jars/xmlc-taskdef-2.2.jar and, obviously, barracuda-ant.jar
Also, read this:
http://www.barracudamvc.org/Barracuda/docs/build_deploy.html
<http://www.barracudamvc.org/Barracuda/docs/build_deploy.html>
Make sure also to check Barracuda's web.xml and event-gateway.xml to see if
there are any changes you might need to take into account. One thing might
be the log4j initialization stuff (if you use it) which moved from
Barracuda's codebase to the log4j sandbox codebase. Of course, you'll need
to use the InitServlet rather than the InitContextListener for Tomcat 3.3.
You should really think about updating to the latest Tomcat 4.1.xx where you
can take advantage of servlet 2.3.
If you have any specific issues with all this, let me know.
Jake
At 06:54 PM 6/20/2003 +0200, you wrote:
Urrrm.... yep...
Haven't upgraded yet.
I tried about a week ago.
Had problems getting the new xmlc release working with Barracuda.
Or more to the point..
Getting it working under Tomcat 3.3... :(
Will try again tom morning/afternoon...
This is def on my todo list.
-----Original Message-----
From: Jacob Kjome [ mailto:[email protected] <mailto:[email protected]> ]
Sent: 20 June 2003 06:44
To: [email protected]
Subject: RE: [Barracuda] Rendering Bug?
Hi Kirk,
What version of Barracuda did you say you were using? Have you tried 1.2.0
or even the latest CVS? I think you will find a lot of bugs have been fixed
and some things have been improved. I would try the upgrade and see if it
fixes any of your issues. If it does, well, there you go. Don't need to
worry about those things anymore.
Jake
At 05:32 PM 6/20/2003 +0200, you wrote:
Hi Christian,
Will consider using the custom model approach...
Will report if this works or not.
Thanx
Regards
KD
-----Original Message-----
From: Christian Cryder [ mailto:[email protected]
<mailto:[email protected]> ]
Sent: 20 June 2003 05:01
To: [email protected]
Subject: RE: [Barracuda] Rendering Bug?
Hmmm...this is quite odd. I wonder if that particular element is actually
getting rendered twice? Might be interesting to stick a debug line in place
and then see if the model is getting called multiple times for the same
element.
Another thing to consider is whether XMLC is somehow mucking with the
structure (that's something of a longshot, since <div>s can be nested).
One other thing to consider...while the approach you've outlined (returning
null to control visibility) _should_ work, I personally prefer a different
approach where you use a custom directive to control visibility. For
instance,
<div id="portlet_CallDesk"
class="Dir::IsVisible.GetPage.p_has_access_calldesk_portal_calldesk">
What this requires you to do is implement the process_Directive method in
your model:
//process any custom directives
public boolean processDirective(TemplateDirective td) {
if (td.getCommand().equals(IS_VISIBLE)) {
...return true or false...
} else {
return true;
}
}
THe advantage of this approach is that if you return false, no nodes below
this are processed (whereas in the approach where you return null or an
invisible component from getItem(), child nodes ARE still processed. So
there are obvious performance advantages in taking this approach.
Let us know if that helps...
Christian
----------------------------------------------
Christian Cryder
Internet Architect, ATMReports.com
Project Chair, BarracudaMVC - http://barracudamvc.org
<http://barracudamvc.org/>
----------------------------------------------
"Coffee? I could quit anytime, just not today"
> -----Original Message-----
> From: [email protected]
> [ mailto:[email protected]
<mailto:[email protected]> ]On Behalf Of Kirk Daries
> Sent: Friday, June 20, 2003 8:31 AM
> To: [email protected]
> Subject: [Barracuda] Rendering Bug?
>
>
> Hi Guys,
>
> I've come across a strange bug when one of my pages is rendered?
>
> Note the 'Dir::Get_Data.GetPage.p_has_access_calldesk_portal_calldesk'
> directive.
> This returns a BComponent if a user has rights to view the 'Div'.
> It returns null when validation fails.
>
> Now..onto the bug.
>
> If validation is successful... processing continues until the next
> directive.
> Namely, 'Dir::Get_Data.GetPage.p_has_access_calldesk_anonymous_call_log'
> This also evaluates based on the users security rights.
> However, if I return null, to prevent the node from rendering, Barracuda
> still
> renders the node?
>
> Anyone got any clue as to why this is happening?
>
> Regards
> KD
>
> <div id="portlet_CallDesk" class="portletTable
> Dir::Get_Data.GetPage.p_has_access_calldesk_portal_calldesk">
> <div align="center" class="td_4">CallDesk</div>
> <div
> class="Dir::Get_Data.GetPage.p_has_access_calldesk_anonymous_call_log">
> <span class="td_2"><a class="hlink"
> href="/barraframework/GetRequestPage.event?p_application=CallDesk">Log a
> Call</a></span>
> </div>
>
> <div
> class="Dir::Get_Data.GetPage.p_has_access_calldesk_my_calls_calculations"
> style="width: 75%;float:left;">
> <span class="td_2
> Dir::Get_Data.CallDeskEntry.p_mycalls_link">My
> Calls</span>
> </div>
> <div class="Transparent
> Dir::Get_Data.GetPage.p_has_access_calldesk_my_calls_calculations">
> <span
> class="Dir::Get_Data.CallDeskEntry.p_mycalls_count">###</span>
> </div>
> </div>
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
<http://barracudamvc.org/lists/listinfo/barracuda>
_______________________________________________
Barracuda mailing list
[email protected]
http://barracudamvc.org/lists/listinfo/barracuda
<http://barracudamvc.org/lists/listinfo/barracuda>
_______________________________________________
Barracuda mailing list
[email protected]
http://barracudamvc.org/lists/listinfo/barracuda
<http://barracudamvc.org/lists/listinfo/barracuda>