You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Bill Mooney <av...@yahoo.com> on 2012/10/02 06:17:33 UTC

exception when parsing bxml

I am upgrading a pivot 1.5 application to version 2.0.2 and I am getting the following exception when trying to to start the application. Just for background, I have updated the wtkx file so that xmlns:wtkx="http://pivot.apache.org/wtkx" now looks like xmlns:bxml="http://pivot.apache.org/bxml" and I have changed any references of the wtkx namespace to bxml.  The problem looks like occurring on the following line in my bxml file:

<PushButton bxml:id="aButton" styles="@styles/some_button.json">


It appears that the URL refererence isn't being resolved before the value is being set. Any ideas on how to fix this?

Thanks
-Bill

java.lang.IllegalArgumentException: Unable to coerce java.net.URL to class org.apache.pivot.wtk.Component$StyleDictionary.
at org.apache.pivot.beans.BeanAdapter.coerce(BeanAdapter.java:933)
at org.apache.pivot.beans.BeanAdapter.put(BeanAdapter.java:289)
at org.apache.pivot.beans.BeanAdapter.put(BeanAdapter.java:46)
at org.apache.pivot.beans.BXMLSerializer.processEndElement(BXMLSerializer.java:1117)
at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:448)
at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:630)
at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:585)
at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:546)
at com.geiger.priorityplus.PriorityPlus.startup(PriorityPlus.java:116)
at org.apache.pivot.wtk.BrowserApplicationContext$HostApplet$StartCallback.run(BrowserApplicationContext.java:196)
at org.apache.pivot.wtk.ApplicationContext$QueuedCallback.run(ApplicationContext.java:1557)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Re: exception when parsing bxml

Posted by Sandro Martini <sa...@gmail.com>.
Hi Bill,
if I remember well, this is a feature that has been removed (or better
changed) from 1.5.x to 2.0.x, look here:

https://cwiki.apache.org/PIVOT/major-feature-changes-between-15x-and-20.html

so now you should use "Named styles", as seen here:
https://issues.apache.org/jira/browse/PIVOT-553
and in your bxml do something like this (from issue page):

<bxml:define>
    <bxml:include bxml:id="testStyles" src="test_styles.json"/>
</bxml:define>

<Label text="Bold Green Label" styles="$testStyles.boldGreenLabel"/>


Otherwise, under examples/.../styles/  there is even a sample showing this ...
To simplify your tests, in attach I put a sample eclipse launch
configuration for running it ... with the stylesheet argument.


Tell us fo you need more info.

Bye,
Sandro