Hi!
Last fridays SVN-Snapshot gives me the following error using firefox
when changing one of the components an eventlistener is attached to:
ERROR: 10:43:16: Error evaluating script: //<![CDATA[ var
tapestry._preload = new Array(); if (document.images) {
tapestry._preload[0] = new Image(); tapestry._preload[0].src =
"/HelloWorld/app?service=asset&path=%2Forg%2Fapache%2Ftapestry%2Fcontrib%2Finspector%2Finspector-rollover.gif";
tapestry._preload[1] = new Image(); tapestry._preload[1].src =
"/HelloWorld/app?service=asset&path=%2Forg%2Fapache%2Ftapestry%2Fcontrib%2Finspector%2Ftapestry-logo.gif";}
function popup_window() { var newWindow =
window.open('/HelloWorld/app?component=%24InspectorButton.link&page=Home&service=direct&session=T',
'TapestryInspector',
'titlebar,resizable,scrollbars,width=700,height=600');
newWindow.focus(); } tapestry.mouseOver_rollover=function(){ if
(document.images){ dojo.byId('rollover').src = tapestry._preload[0].src;
} } tapestry.mouseOut_rollover=function(){ if (document.images) {
dojo.byId('rollover').src = tapestry._preload[1].src; } }
dojo.require("tapestry.event"); //]]> SyntaxError : missing ; before
statement :
http://localhost:8080/HelloWorld/app?service=asset&path=%2Ftapestry%2Fcore.js
: line 256
(this or a similar exception comes for every updated component)
Still the test-application works as it should (at least in firefox)
IE shows a similar message but still an exception is caused on the
second update
This mornings tapestry-snapshot (and svn-version, too) crashes the
test-app on start with the follwing exception(s):
javax.servlet.ServletException: Unable to construct service
tapestry.enhance.ComponentConstructorFactory: Error building service
tapestry.enhance.ComponentConstructorFactory: Failure invoking constructor for
class org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl:
edu/emory/mathcs/backport/java/util/concurrent/locks/ReentrantLock
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:60)
$ServletRequestServicer_10f4ce38a3c.service($ServletRequestServicer_10f4ce38a3c.java)
$ServletRequestServicer_10f4ce38a3b.service($ServletRequestServicer_10f4ce38a3b.java)
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
$ServletRequestServicerFilter_10f4ce38a38.service($ServletRequestServicerFilter_10f4ce38a38.java)
$ServletRequestServicerFilter_10f4ce38a37.service($ServletRequestServicerFilter_10f4ce38a37.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
$ServletRequestServicerFilter_10f4ce38a36.service($ServletRequestServicerFilter_10f4ce38a36.java)
$ServletRequestServicerFilter_10f4ce38a35.service($ServletRequestServicerFilter_10f4ce38a35.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
$ServletRequestServicerFilter_10f4ce38a3a.service($ServletRequestServicerFilter_10f4ce38a3a.java)
$ServletRequestServicerFilter_10f4ce38a39.service($ServletRequestServicerFilter_10f4ce38a39.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
$ServletRequestServicer_10f4ce38a30.service($ServletRequestServicer_10f4ce38a30.java)
$ServletRequestServicer_10f4ce38a2f.service($ServletRequestServicer_10f4ce38a2f.java)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause:
org.apache.hivemind.ApplicationRuntimeException: Unable to construct service
tapestry.enhance.ComponentConstructorFactory: Error building service
tapestry.enhance.ComponentConstructorFactory: Failure invoking constructor for
class org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl:
edu/emory/mathcs/backport/java/util/concurrent/locks/ReentrantLock
[jar:file:/home/klein/bi-so/TapestryTest/context/WEB-INF/lib/tapestry-framework-4.1.1-SNAPSHOT.jar!/META-INF/tapestry.enhance.xml,
line 27, column 21]
org.apache.tapestry.error.ExceptionPresenterImpl.presentException(ExceptionPresenterImpl.java:66)
$ExceptionPresenter_10f4ce38a00.presentException($ExceptionPresenter_10f4ce38a00.java)
$ExceptionPresenter_10f4ce389ff.presentException($ExceptionPresenter_10f4ce389ff.java)
org.apache.tapestry.engine.AbstractEngine.activateExceptionPage(AbstractEngine.java:126)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:276)
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
$WebRequestServicer_10f4ce38a5a.service($WebRequestServicer_10f4ce38a5a.java)
$WebRequestServicer_10f4ce38a59.service($WebRequestServicer_10f4ce38a59.java)
$WebRequestServicer_10f4ce38a56.service($WebRequestServicer_10f4ce38a56.java)
$WebRequestServicer_10f4ce38a55.service($WebRequestServicer_10f4ce38a55.java)
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
$ServletRequestServicer_10f4ce38a3c.service($ServletRequestServicer_10f4ce38a3c.java)
$ServletRequestServicer_10f4ce38a3b.service($ServletRequestServicer_10f4ce38a3b.java)
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
$ServletRequestServicerFilter_10f4ce38a38.service($ServletRequestServicerFilter_10f4ce38a38.java)
$ServletRequestServicerFilter_10f4ce38a37.service($ServletRequestServicerFilter_10f4ce38a37.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
$ServletRequestServicerFilter_10f4ce38a36.service($ServletRequestServicerFilter_10f4ce38a36.java)
$ServletRequestServicerFilter_10f4ce38a35.service($ServletRequestServicerFilter_10f4ce38a35.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
$ServletRequestServicerFilter_10f4ce38a3a.service($ServletRequestServicerFilter_10f4ce38a3a.java)
$ServletRequestServicerFilter_10f4ce38a39.service($ServletRequestServicerFilter_10f4ce38a39.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
$ServletRequestServicer_10f4ce38a30.service($ServletRequestServicer_10f4ce38a30.java)
$ServletRequestServicer_10f4ce38a2f.service($ServletRequestServicer_10f4ce38a2f.java)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause:
org.apache.hivemind.ApplicationRuntimeException: Unable to construct service
tapestry.enhance.ComponentConstructorFactory: Error building service
tapestry.enhance.ComponentConstructorFactory: Failure invoking constructor for
class org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl:
edu/emory/mathcs/backport/java/util/concurrent/locks/ReentrantLock
[jar:file:/home/klein/bi-so/TapestryTest/context/WEB-INF/lib/tapestry-framework-4.1.1-SNAPSHOT.jar!/META-INF/tapestry.enhance.xml,
line 27, column 21]
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(AbstractServiceModelImpl.java:166)
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation(AbstractServiceModelImpl.java:140)
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation(SingletonServiceModel.java:69)
$ComponentConstructorFactory_10f4ce38a99._service($ComponentConstructorFactory_10f4ce38a99.java)
$ComponentConstructorFactory_10f4ce38a99.getComponentConstructor($ComponentConstructorFactory_10f4ce38a99.java)
$ComponentConstructorFactory_10f4ce38a98.getComponentConstructor($ComponentConstructorFactory_10f4ce38a98.java)
org.apache.tapestry.pageload.PageLoader.instantiatePage(PageLoader.java:564)
org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:591)
$IPageLoader_10f4ce38a92.loadPage($IPageLoader_10f4ce38a92.java)
$IPageLoader_10f4ce38a93.loadPage($IPageLoader_10f4ce38a93.java)
org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:119)
$IPageSource_10f4ce389f3.getPage($IPageSource_10f4ce389f3.java)
org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:248)
org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:235)
org.apache.tapestry.error.ExceptionPresenterImpl.presentException(ExceptionPresenterImpl.java:42)
$ExceptionPresenter_10f4ce38a00.presentException($ExceptionPresenter_10f4ce38a00.java)
$ExceptionPresenter_10f4ce389ff.presentException($ExceptionPresenter_10f4ce389ff.java)
org.apache.tapestry.engine.AbstractEngine.activateExceptionPage(AbstractEngine.java:126)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:276)
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
$WebRequestServicer_10f4ce38a5a.service($WebRequestServicer_10f4ce38a5a.java)
$WebRequestServicer_10f4ce38a59.service($WebRequestServicer_10f4ce38a59.java)
$WebRequestServicer_10f4ce38a56.service($WebRequestServicer_10f4ce38a56.java)
$WebRequestServicer_10f4ce38a55.service($WebRequestServicer_10f4ce38a55.java)
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
$ServletRequestServicer_10f4ce38a3c.service($ServletRequestServicer_10f4ce38a3c.java)
$ServletRequestServicer_10f4ce38a3b.service($ServletRequestServicer_10f4ce38a3b.java)
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
$ServletRequestServicerFilter_10f4ce38a38.service($ServletRequestServicerFilter_10f4ce38a38.java)
$ServletRequestServicerFilter_10f4ce38a37.service($ServletRequestServicerFilter_10f4ce38a37.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
$ServletRequestServicerFilter_10f4ce38a36.service($ServletRequestServicerFilter_10f4ce38a36.java)
$ServletRequestServicerFilter_10f4ce38a35.service($ServletRequestServicerFilter_10f4ce38a35.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
$ServletRequestServicerFilter_10f4ce38a3a.service($ServletRequestServicerFilter_10f4ce38a3a.java)
$ServletRequestServicerFilter_10f4ce38a39.service($ServletRequestServicerFilter_10f4ce38a39.java)
$ServletRequestServicer_10f4ce38a3d.service($ServletRequestServicer_10f4ce38a3d.java)
$ServletRequestServicer_10f4ce38a30.service($ServletRequestServicer_10f4ce38a30.java)
$ServletRequestServicer_10f4ce38a2f.service($ServletRequestServicer_10f4ce38a2f.java)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
[...]
Patrick
Hello!
I'm still having some trouble with my test-application and IE.
The intended functionality is the following:
Page consists out of three PropertySelections, one TextField and one
Checkbox.
PropertySelection 1 affects the content of PropertySelection 2 and
possibly the content of PropertySelection 3
PropertySelection 2 affects the content of PropertySelection 3
PropertySeleciton 3 affects both TextField and Checkbox.
Using Firefox, the components get updated as they should.
However, using IE doesn't work. The EventListener gets called on the
first change of Selection 1, but the other Components don't get
updated. If i change the value of that Selection again, the
application crashes before the EventListener is called. Additionally
the (should be) affected PropertySelections don't get updated during
the run of the EventListener. If there was a working Selection before
in one of the affected Selections, these are gone after the first
EventListener-call as well.
I'm using last nights svn-snapshot of Tapestry for testing.
Did i miss something or is there really a problem with
Tapestry411/AJAX and IE?
Patrick
----------- Test Page -----------------
The html-template looks like this:
<html jwcid="@Shell" title="TestPage">
<body jwcid="@Body">
<h1>Test...</h1>
<form jwcid="[EMAIL PROTECTED]">
Page Counter: <div jwcid="@Insert" value="ognl:counter"/>
<div jwcid="[EMAIL PROTECTED]" id="button"
listener="listener:button" value="Press Me"/>
</form>
<form jwcid="[EMAIL PROTECTED]" async="ognl:true"
updateComponents="ognl:updateComponentsSingle">
<br/><br/>
<br/><br/>
<div jwcid="@PropertySelection" id="testSelection"
model="ognl:testModel" value="ognl:test"/>
<div jwcid="@PropertySelection" id="resultSelection"
model="ognl:resultModel" value="ognl:result"/>
<div jwcid="@PropertySelection" id="targetSelection"
model="ognl:targetModel" value="ognl:target"/>
<div jwcid="@Any" id="updateMe">
<div jwcid="@TextField" id="output" value="ognl:output"/>
</div>
<div jwcid="@Any" id="updateBool">
<div jwcid="@Checkbox" id="outBool"
value="ognl:outBool" disabled="ognl:true"/>
</div>
<br/><br/>
<br/><br/>
</form>
<span jwcid="@contrib:InspectorButton"
disabled="ognl:false"/> </body>
</html>
The Java-class has the following content:
package test;
import java.util.ArrayList;
import java.util.List;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.annotations.EventListener;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.event.BrowserEvent;
import org.apache.tapestry.event.PageBeginRenderListener;
import org.apache.tapestry.event.PageEvent;
import org.apache.tapestry.form.IPropertySelectionModel;
import org.apache.tapestry.html.BasePage;
public abstract class Home extends BasePage implements
PageBeginRenderListener {
public void pageBeginRender(PageEvent event) {
if (getResultModel() == null) {
fillResultModel();
}
if (getTargetModel() == null) {
fillTargetModel();
}
}
public String getCallingElementId(BrowserEvent event) {
return (String)
event.getTarget().get(BrowserEvent.TARGET_ATTR_ID);
}
// /////////////////////////////////////////////
// generate/build the needed Selection-Models //
// /////////////////////////////////////////////
public void fillResultModel() {
setResultModel(getResultModel(getTest()));
}
public IPropertySelectionModel getResultModel(Test test) {
List<Enum> resultingList = new ArrayList<Enum>();
resultingList.add(null);
if (test != null) {
switch (test) {
case TEST1:
resultingList.add(Result.RESULT1);
resultingList.add(Result.RESULT3);
break;
case TEST2:
resultingList.add(Result.RESULT2);
resultingList.add(Result.RESULT4);
break;
case TEST3:
resultingList.add(Result.RESULT3);
resultingList.add(Result.RESULT1);
break;
case TEST4:
resultingList.add(Result.RESULT4);
resultingList.add(Result.RESULT2);
break;
}
}
return new EnumerationSelectionModel(resultingList
.toArray(new Enum[resultingList.size()]));
}
public IPropertySelectionModel getTestModel() {
List<Enum> resultingList = new ArrayList<Enum>();
resultingList.add(null);
Enum[] temp = Test.values();
for (int i = 0; i < temp.length; i++) {
resultingList.add(temp[i]);
}
return new EnumerationSelectionModel(resultingList
.toArray(new Enum[resultingList.size()]));
}
public void fillTargetModel() {
if (!Result.RESULT4.equals(getResult())) {
setOutput(null);
setOutBool(false);
}
setTargetModel(getTargetModel(getResult()));
}
public IPropertySelectionModel getTargetModel(Result result) {
List<Enum> resultingList = new ArrayList<Enum>();
resultingList.add(null);
if (Result.RESULT4.equals(result)) {
Enum[] temp = Target.values();
for (int i = 0; i < temp.length; i++) {
resultingList.add(temp[i]);
}
} else {
setOutput(null);
}
return new EnumerationSelectionModel(resultingList
.toArray(new Enum[resultingList.size()]));
}
// ///////////////////////////////////////////////////////////////
// Event Listener for the Single Data Case (working, except IE) //
// ///////////////////////////////////////////////////////////////
@EventListener(elements = "testSelection", events = "onchange",
submitForm = "testFormSingle", async = true)
public void adjustResultModel(BrowserEvent event) {
System.out.println("adjustResultModel called. Counter = "
+ getCounter());
if (getTest() == null) {
setResult(null);
} else {
switch (getTest()) {
case TEST1:
case TEST3:
if (Result.RESULT2.equals(getResult())
|| Result.RESULT4.equals(getResult())) {
setResult(null);
}
setTarget(null);
break;
case TEST2:
case TEST4:
if (Result.RESULT1.equals(getResult())
|| Result.RESULT3.equals(getResult())) {
setResult(null);
}
if (!Result.RESULT4.equals(getResult())) {
setResult(null);
}
break;
}
}
fillResultModel();
fillTargetModel();
getRequestCycle().getResponseBuilder().updateComponent(
"resultSelection");
getRequestCycle().getResponseBuilder().updateComponent(
"targetSelection");
if (getCounter() == null) {
setCounter(0);
} else {
Integer counter = getCounter();
counter++;
setCounter(counter);
}
}
@EventListener(elements = "resultSelection", events = "onchange",
submitForm = "testFormSingle", async = true)
public void adjustTargetModel(BrowserEvent event) {
System.out.println("adjustTargetModel called. Counter = "
+ getCounter());
// update TargetSeleections
fillTargetModel();
getRequestCycle().getResponseBuilder().updateComponent(
"targetSelection");
//
getRequestCycle().getResponseBuilder().updateComponent("output");
getRequestCycle().getResponseBuilder().updateComponent("updateMe");
getRequestCycle().getResponseBuilder().updateComponent("updateBool");
//
getRequestCycle().getResponseBuilder().updateComponent("myFavoriteDiv");
if (getCounter() == null) {
setCounter(0);
} else {
Integer counter = getCounter();
counter++;
setCounter(counter);
}
}
@EventListener(elements = "targetSelection", events = "onchange",
submitForm = "testFormSingle", async = true)
public void adjustOutput() {
System.out.println("adjustOutput called. Counter = " +
getCounter());
// update TargetSeleections
if (getTarget() == null) {
setOutput(null);
setOutBool(false);
} else {
setOutput(getTarget().toString());
setOutBool(Target.RI1.equals(getTarget()));
}
//
getRequestCycle().getResponseBuilder().updateComponent("output");
getRequestCycle().getResponseBuilder().updateComponent("updateMe");
getRequestCycle().getResponseBuilder().updateComponent("updateBool");
//
getRequestCycle().getResponseBuilder().updateComponent("myFavoriteDiv");
if (getCounter() == null) {
setCounter(0);
} else {
Integer counter = getCounter();
counter++;
setCounter(counter);
}
}
public void button(IRequestCycle cycle) {
System.out.println("Button has been pressed");
if (getCounter() == null) {
setCounter(0);
} else {
Integer counter = getCounter();
counter++;
setCounter(counter);
}
// should only update the data
return;
}
public String[] getUpdateComponentsSingle() {
List<String> componentList = new ArrayList<String>();
componentList.add("resultSelection");
componentList.add("targetSelection");
componentList.add("output");
componentList.add("updateMe");
componentList.add("outBool");
componentList.add("updateBool");
return componentList.toArray(new String[componentList.size()]);
}
// Iterator used
@Persist
public abstract Integer getCounter();
public abstract void setCounter(Integer counter);
public abstract IPropertySelectionModel getResultModel();
public abstract void setResultModel(IPropertySelectionModel model);
public abstract IPropertySelectionModel getTargetModel();
public abstract void setTargetModel(IPropertySelectionModel model);
@Persist
public abstract Test getTest();
public abstract void setTest(Test test);
@Persist
public abstract Result getResult();
public abstract void setResult(Result test);
public abstract Target getTarget();
public abstract void setTarget(Target target);
public abstract String getOutput();
public abstract void setOutput(String output);
public abstract boolean getOutBool();
public abstract void setOutBool(boolean bool);
}
The page-file only contains the class-definition.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]