[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    Re: XmlBeans and DOM Listener
From:       harvero <robert.l.harvey.ii () gmail ! com>
Date:       2012-06-15 18:38:04
Message-ID: 34019849.post () talk ! nabble ! com
[Download RAW message or body]


Jacob,
Thank you. I have implemented this in my local projects (NetBeans Maven
Java). I can compile and run within my local projects.. However, when I
integrate my implementations into a NetBean module, I am getting a runtime
error associated with XmlObjectBase::generatedSetterHelperImpl. The error
that I am seeing is:

java.lang.NoSuchMethodError:
mynamespace.impl.MyDocumentImpl.generatedSetterHelperImpl(Lorg/apache/xmlbeans/XmlObject;Ljavax/xml/namespace/QName;IS)Lorg/apache/xmlbeans/XmlObject;
  at mynamespace.impl.MyDocumentImpl.setSomething(Unknown Source)

My hunch is I may be getting some kind of jar collision with my older jars.
However, I saw some threads on this that indicate this could be a 2.5 bug?

Any ideas?
Thanks,
Bob




Jacob Danner-2 wrote:
> 
> There was a good article related to this on IBM Developerworks that may
> help
> http://www.ibm.com/developerworks/xml/library/x-xmlbeanse/index.html
> Please let the list know if you are still having troubles.
> -jacobd
> 
> On Fri, Jun 8, 2012 at 12:59 PM, harvero <robert.l.harvey.ii@gmail.com>
> wrote:
> > 
> > I have an application UI that uses XmlBeans to parse an XML document and
> > display the parsed "XmlObjects" in a exploreresque treeview. XmlBeans
> > doesn't provide much support for eventing so I am grabbing the
> > "Document's"
> > DomNode to employ DOM's eventing support. From there, I am getting the
> > document's root element via getDocumentElement(). I then try to cast this
> > element to EventTarget so I can add to the interface my
> > org.w3c.dom.events.EventListener. However, a ClassCastException is
> > occurring
> > where the cast occurs from Element to EventTarget. Below is a snippet:
> > 
> > private void setupListener(final XmlObject xml) {
> > org.w3c.dom.Node domNode = xml.getDomNode();
> > Document document = (Document)domNode;
> > Element element = document.getDocumentElement();
> > EventTarget eventTarget = (EventTarget)element;
> > <----------------ClassCastException occurs here
> > eventTarget.addEventListener("DOMSubtreeModified",
> > new DfcXmlObjectListener(), true);
> > 
> > }
> > From what I have learned, XmlBeans does not implement the EventTarget in
> > it's DOM implementation. I've seen a few threads about adding Eventing to
> > an
> > XmlBean document, but thought that I would post here to gather if there
> > is
> > preferred solution by the XmlBean community.
> > 
> > Thank you,
> > V/R
> > Bob Harvey
> > 
> > 
> > --
> > View this message in context:
> > http://old.nabble.com/XmlBeans-and-DOM-Listener-tp33983653p33983653.html
> > Sent from the Xml Beans - Dev mailing list archive at Nabble.com.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: dev-help@xmlbeans.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
> 
> 
> 
-- 
View this message in context: \
http://old.nabble.com/XmlBeans-and-DOM-Listener-tp33983653p34019849.html Sent from \
the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic