[xwiki-users] NoSuchMethodError for injected DocumentAccessBridge
Hi, I'm writing a component that accesses the XWiki data model when document updates occur. I have a few questions, but will post distinct threads for them. I apologize for the clutter. I found the API for DocumentAccessBridge at http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-bridge/2.0/. My code looks like: @Requirement private DocumentAccessBridge _documentAccessBridge; public void myFun(String documentName) { String description = null; try { description = _documentAccessBridge.getProperty(documentName, "Main.MyClass", "description").toString(); } catch(Exception e) { e.printStackTrace(); } // ... } I expect this to get the description of the first object of type MyClass in the given document, but instead I get a NoSuchMethodError for the call to getProperty. I have xwiki-core-bridge-2.0.jar in my WEB-INF\lib directory; why might this happen? Thanks, David Breeden -- View this message in context: http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi David, On Wed, Oct 14, 2009 at 22:17, breeden <[email protected]> wrote:
Hi,
I'm writing a component that accesses the XWiki data model when document updates occur. I have a few questions, but will post distinct threads for them. I apologize for the clutter.
I found the API for DocumentAccessBridge at http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-bridge/2.0/. My code looks like:
@Requirement private DocumentAccessBridge _documentAccessBridge;
public void myFun(String documentName) {
String description = null; try { description = _documentAccessBridge.getProperty(documentName, "Main.MyClass", "description").toString(); } catch(Exception e) { e.printStackTrace(); }
// ... }
I expect this to get the description of the first object of type MyClass in the given document, but instead I get a NoSuchMethodError for the call to getProperty. I have xwiki-core-bridge-2.0.jar in my WEB-INF\lib directory; why might this happen?
Could you give use the whole stack trace error.
Thanks, David Breeden -- View this message in context: http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Here's what I get when I save a page with def myComponent = com.xpn.xwiki.web.Utils.getComponent(com.shai.xwiki.MyComponent.class); myComponent.myFun("Main.JohnDoe"); Detailed information: Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:238) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Wrapped Exception: java.lang.NoSuchMethodError: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at com.shai.xwiki.internal.DefaultMyComponent.announce(DefaultMyComponent.java:49) 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 org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at LoggingEventListener.onEvent(Script6.groovy:41) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:262) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:236) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1336) at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:176) at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:193) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Thanks! ~David tmortagne (via Nabble) wrote:
Hi David,
On Wed, Oct 14, 2009 at 22:17, breeden <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=0>> wrote:
Hi,
I'm writing a component that accesses the XWiki data model when
document
updates occur. I have a few questions, but will post distinct threads for them. I apologize for the clutter.
I found the API for DocumentAccessBridge at
http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-bridge/2.0/.
My code looks like:
@Requirement private DocumentAccessBridge _documentAccessBridge;
public void myFun(String documentName) {
String description = null; try { description = _documentAccessBridge.getProperty(documentName, "Main.MyClass", "description").toString(); } catch(Exception e) { e.printStackTrace(); }
// ... }
I expect this to get the description of the first object of type MyClass in the given document, but instead I get a NoSuchMethodError for the call to getProperty. I have xwiki-core-bridge-2.0.jar in my WEB-INF\lib directory; why might this happen?
Could you give use the whole stack trace error.
Thanks, David Breeden -- View this message in context:
http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3...
Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=1> http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne _______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=2> http://lists.xwiki.org/mailman/listinfo/users
------------------------------------------------------------------------ View message @ http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3...
To unsubscribe from NoSuchMethodError for injected DocumentAccessBridge, click here < (link removed) >.
-- View this message in context: http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, I have upgraded our company wiki to XWiki Enterprise 2.0.24043. There was a problem with the watch list notifications that I now know how to fix from a previous post. However when I fix it the new messages that get sent have 16 attachments in each one. (BTW, I am using MS Outlook 2007 to view my email). Oddly when viewing the source in the email, down at the bottom it explains how there should be no attachments because of some clever trick that is supposed to fool the plugin. My users aren't going to be very happy with the 16 attachments for every update, especially when they aren't even used in the message display. Is there any easy way to stop adding the attachments to the messages? This is the bottom of the email source. The images listed are the ones being attached: <!-- We want to be able to use attached images in the HTML part of the email but we don't want them to be listed as attachments. We use a little trick here to make the mailsender plugin consider that we use all the attached images in this mail even if we don't (some images are used very rarely). src='cid:groups.png' src='cid:metadata.gif' src='cid:dblist.png' src='cid:attach.gif' src='cid:date.png' src='cid:boolean.png' src='cid:textarea.png' src='cid:string.png' src='cid:space.gif' src='cid:document.gif' src='cid:dbtreelist.png' src='cid:wiki.gif' src='cid:number.png' src='cid:class.gif' src='cid:users.png' src='cid:staticlist.png' src='cid:levels.png' src='cid:password.png' src='cid:object.gif' --> TIA for any help, Regan Gill
Hi Regan, On Fri, Oct 16, 2009 at 12:20 AM, Regan Gill <[email protected]>wrote:
Hi,
I have upgraded our company wiki to XWiki Enterprise 2.0.24043. There was a problem with the watch list notifications that I now know how to fix from a previous post. However when I fix it the new messages that get sent have 16 attachments in each one. (BTW, I am using MS Outlook 2007 to view my email). Oddly when viewing the source in the email, down at the bottom it explains how there should be no attachments because of some clever trick that is supposed to fool the plugin.
Looks like Outlook is even cleverer ;-) Same thing with Gmail, I see all 16 attachments.
My users aren't going to be very happy with the 16 attachments for every update, especially when they aren't even used in the message display. Is there any easy way to stop adding the attachments to the messages?
Yes. The quick fix is to edit the "HTML" field located on http:// <server>/xwiki/bin/edit/XWiki/WatchListMessage?editor=object&classname=XWiki.Mail&object=0 and remove that code from the bottom of the field. You'll lose the globe, folder and nice images that show up when properties have been edited but that's pretty much it. Guillaume This is the bottom of the email source. The images listed are the ones
being attached: <!-- We want to be able to use attached images in the HTML part of the email but we don't want them to be listed as attachments. We use a little trick here to make the mailsender plugin consider that we use all the attached images in this mail even if we don't (some images are used very rarely).
src='cid:groups.png' src='cid:metadata.gif' src='cid:dblist.png' src='cid:attach.gif' src='cid:date.png' src='cid:boolean.png' src='cid:textarea.png' src='cid:string.png' src='cid:space.gif' src='cid:document.gif' src='cid:dbtreelist.png' src='cid:wiki.gif' src='cid:number.png' src='cid:class.gif' src='cid:users.png' src='cid:staticlist.png' src='cid:levels.png' src='cid:password.png' src='cid:object.gif' -->
TIA for any help, Regan Gill
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Guillaume Lerouge Product Manager - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
Hi David, This means you're using an API that doesn't exist in the jar version you're using. Note that this property was modified in rev 21806 recently to return an Object instead of a String. The API you're calling is returning a String which doesn't exist anymore. Can you show us line 49 of DefaultMyComponent.java? Can you also verify the version of the platform you're using and ensure you're using the same versions for all modules? Thanks -Vincent On Oct 15, 2009, at 7:31 PM, breeden wrote:
Here's what I get when I save a page with def myComponent = com .xpn.xwiki.web.Utils.getComponent(com.shai.xwiki.MyComponent.class); myComponent.myFun("Main.JohnDoe");
Detailed information:
Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/ String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/ String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:238) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org .apache .struts .action.RequestProcessor.processActionPerform(RequestProcessor.java: 431) at org .apache.struts.action.RequestProcessor.process(RequestProcessor.java: 236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java: 432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) at com .xpn .xwiki .wysiwyg .server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 295) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 387) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java: 68) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 295) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 387) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 417) at org .mortbay .jetty .handler .ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org .mortbay .jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 534) at org.mortbay.jetty.HttpConnection $RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 409) at org.mortbay.thread.QueuedThreadPool $PoolThread.run(QueuedThreadPool.java:520)
Wrapped Exception:
java.lang.NoSuchMethodError: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/ String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at com .shai .xwiki.internal.DefaultMyComponent.announce(DefaultMyComponent.java: 49) 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 org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite $PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java: 229) at org .codehaus .groovy .runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org .codehaus .groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java: 125) at LoggingEventListener.onEvent(Script6.groovy:41) at org .xwiki .observation .internal .DefaultObservationManager.notify(DefaultObservationManager.java:262) at org .xwiki .observation .internal .DefaultObservationManager.notify(DefaultObservationManager.java:236) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1336) at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:176) at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:193) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org .apache .struts .action.RequestProcessor.processActionPerform(RequestProcessor.java: 431) at org .apache.struts.action.RequestProcessor.process(RequestProcessor.java: 236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java: 432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) at com .xpn .xwiki .wysiwyg .server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 295) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 387) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java: 68) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 295) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 387) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 417) at org .mortbay .jetty .handler .ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org .mortbay .jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 534) at org.mortbay.jetty.HttpConnection $RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 409) at org.mortbay.thread.QueuedThreadPool $PoolThread.run(QueuedThreadPool.java:520)
Thanks! ~David
tmortagne (via Nabble) wrote:
Hi David,
On Wed, Oct 14, 2009 at 22:17, breeden <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=0>> wrote:
Hi,
I'm writing a component that accesses the XWiki data model when
document
updates occur. I have a few questions, but will post distinct threads for them. I apologize for the clutter.
I found the API for DocumentAccessBridge at
http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-bridge/2.0/ .
My code looks like:
@Requirement private DocumentAccessBridge _documentAccessBridge;
public void myFun(String documentName) {
String description = null; try { description = _documentAccessBridge.getProperty(documentName, "Main.MyClass", "description").toString(); } catch(Exception e) { e.printStackTrace(); }
// ... }
I expect this to get the description of the first object of type MyClass in the given document, but instead I get a NoSuchMethodError for the call to getProperty. I have xwiki-core-bridge-2.0.jar in my WEB-INF\lib directory; why might this happen?
Could you give use the whole stack trace error.
Thanks, David Breeden
On Thu, Oct 15, 2009 at 19:31, breeden <[email protected]> wrote:
Here's what I get when I save a page with def myComponent = com.xpn.xwiki.web.Utils.getComponent(com.shai.xwiki.MyComponent.class); myComponent.myFun("Main.JohnDoe");
Detailed information:
Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
You component expects Object getProperty(String documentName, String propertyName); but it's String getProperty(String documentName, String propertyName); since 2.0 (maybe 2.0RC1 or RC2 i don't remember). Maybe you built this component with an older version of the api.
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:238) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Wrapped Exception:
java.lang.NoSuchMethodError: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at com.shai.xwiki.internal.DefaultMyComponent.announce(DefaultMyComponent.java:49) 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 org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at LoggingEventListener.onEvent(Script6.groovy:41) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:262) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:236) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1336) at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:176) at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:193) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Thanks! ~David
tmortagne (via Nabble) wrote:
Hi David,
On Wed, Oct 14, 2009 at 22:17, breeden <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=0>> wrote:
Hi,
I'm writing a component that accesses the XWiki data model when
document
updates occur. I have a few questions, but will post distinct threads for them. I apologize for the clutter.
I found the API for DocumentAccessBridge at
http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-bridge/2.0/.
My code looks like:
@Requirement private DocumentAccessBridge _documentAccessBridge;
public void myFun(String documentName) {
String description = null; try { description = _documentAccessBridge.getProperty(documentName, "Main.MyClass", "description").toString(); } catch(Exception e) { e.printStackTrace(); }
// ... }
I expect this to get the description of the first object of type MyClass in the given document, but instead I get a NoSuchMethodError for the call to getProperty. I have xwiki-core-bridge-2.0.jar in my WEB-INF\lib directory; why might this happen?
Could you give use the whole stack trace error.
Thanks, David Breeden -- View this message in context:
http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3...
Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=1> http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne _______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=2> http://lists.xwiki.org/mailman/listinfo/users
------------------------------------------------------------------------ View message @ http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3...
To unsubscribe from NoSuchMethodError for injected DocumentAccessBridge, click here < (link removed) >.
-- View this message in context: http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Ahh, ok. My platform is 2.0.24043 but the POM for my component was using xwiki-core-component and xwiki-core-bridge v1.8-SNAPSHOT (that tutorial archetype... :-)). I set xwiki-core-component to v1.9 and xwiki-core-bridge to v2.0 and it's working. Thank you! ~David Breeden tmortagne wrote:
On Thu, Oct 15, 2009 at 19:31, breeden <[email protected]> wrote:
Here's what I get when I save a page with def myComponent = com.xpn.xwiki.web.Utils.getComponent(com.shai.xwiki.MyComponent.class); myComponent.myFun("Main.JohnDoe");
Detailed information:
Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception Wrapped Exception: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
You component expects
Object getProperty(String documentName, String propertyName);
but it's
String getProperty(String documentName, String propertyName);
since 2.0 (maybe 2.0RC1 or RC2 i don't remember).
Maybe you built this component with an older version of the api.
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:238) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Wrapped Exception:
java.lang.NoSuchMethodError: org.xwiki.bridge.DocumentAccessBridge.getProperty(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at com.shai.xwiki.internal.DefaultMyComponent.announce(DefaultMyComponent.java:49) 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 org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at LoggingEventListener.onEvent(Script6.groovy:41) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:262) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:236) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1336) at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:176) at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:193) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:109) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Thanks! ~David
tmortagne (via Nabble) wrote:
Hi David,
On Wed, Oct 14, 2009 at 22:17, breeden <[hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=0>> wrote:
Hi,
I'm writing a component that accesses the XWiki data model when
document
updates occur. I have a few questions, but will post distinct threads for them. I apologize for the clutter.
I found the API for DocumentAccessBridge at
http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-bridge/2.0/.
My code looks like:
@Requirement private DocumentAccessBridge _documentAccessBridge;
public void myFun(String documentName) {
String description = null; try { description = _documentAccessBridge.getProperty(documentName, "Main.MyClass", "description").toString(); } catch(Exception e) { e.printStackTrace(); }
// ... }
I expect this to get the description of the first object of type MyClass in the given document, but instead I get a NoSuchMethodError for the call to getProperty. I have xwiki-core-bridge-2.0.jar in my WEB-INF\lib directory; why might this happen?
Could you give use the whole stack trace error.
Thanks, David Breeden -- View this message in context:
http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3...
Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=1> http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne _______________________________________________ users mailing list [hidden email] <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3829043&i=2> http://lists.xwiki.org/mailman/listinfo/users
------------------------------------------------------------------------ View message @ http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3...
To unsubscribe from NoSuchMethodError for injected DocumentAccessBridge, click here < (link removed) >.
-- View this message in context: http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://n2.nabble.com/NoSuchMethodError-for-injected-DocumentAccessBridge-tp3... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 10/16/2009 08:37 PM, breeden wrote:
Ahh, ok. My platform is 2.0.24043 but the POM for my component was using xwiki-core-component and xwiki-core-bridge v1.8-SNAPSHOT (that tutorial archetype... :-)). I set xwiki-core-component to v1.9 and xwiki-core-bridge to v2.0 and it's working.
Why 1.9 and not 2.0? -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu wrote:
On 10/16/2009 08:37 PM, breeden wrote:
Ahh, ok. My platform is 2.0.24043 but the POM for my component was using xwiki-core-component and xwiki-core-bridge v1.8-SNAPSHOT (that tutorial archetype... :-)). I set xwiki-core-component to v1.9 and xwiki-core-bridge to v2.0 and it's working.
Why 1.9 and not 2.0?
With 2.0 I get "Missing artifact org.xwiki.platform:xwiki-core-component:jar:2.0:compile"
On Tue, Oct 20, 2009 at 19:25, David Breeden <[email protected]> wrote:
Sergiu Dumitriu wrote:
On 10/16/2009 08:37 PM, breeden wrote:
Ahh, ok. My platform is 2.0.24043 but the POM for my component was using xwiki-core-component and xwiki-core-bridge v1.8-SNAPSHOT (that tutorial archetype... :-)). I set xwiki-core-component to v1.9 and xwiki-core-bridge to v2.0 and it's working.
Why 1.9 and not 2.0?
With 2.0 I get "Missing artifact org.xwiki.platform:xwiki-core-component:jar:2.0:compile"
It's because the name changed: there is now: - xwiki-core-component-api for the api - xwiki-core-component-default for the default implementation in your case simpley change for xwiki-core-component-api
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
participants (7)
-
breeden -
David Breeden -
Guillaume Lerouge -
Regan Gill -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol