commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Marc Borer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (VFS-369) Compilation error with newer versions of Jackrabbit
Date Wed, 06 Feb 2013 15:55:13 GMT

    [ https://issues.apache.org/jira/browse/VFS-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13572519#comment-13572519
] 

Jean-Marc Borer commented on VFS-369:
-------------------------------------

I've found the reason: Jackrabbit has an internal error. By looking at the logs I see:

06.02.2013 15:49:32 *ERROR* log: failed Webdav
java.lang.IllegalAccessError: tried to access field org.apache.jackrabbit.webdav.xml.DomUtil.BUILDER_FACTORY
from class org.apache.jackrabbit.webdav.simple.ResourceConfig
	at org.apache.jackrabbit.webdav.simple.ResourceConfig.parse(ResourceConfig.java:95)
	at org.apache.jackrabbit.webdav.simple.SimpleWebdavServlet.init(SimpleWebdavServlet.java:157)
	at javax.servlet.GenericServlet.init(GenericServlet.java:241)
	at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:431)
	at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:643)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.Server.doStart(Server.java:222)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.apache.commons.vfs2.provider.webdav.test.JackrabbitMain.run(JackrabbitMain.java:243)
	at org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase.startJackrabbit(WebdavProviderTestCase.java:265)
	at org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase.setUpClass(WebdavProviderTestCase.java:242)
	at org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase.access$100(WebdavProviderTestCase.java:55)
	at org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase$1.setUp(WebdavProviderTestCase.java:277)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.extensions.TestSetup.run(TestSetup.java:27)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	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:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

This is exactly what makes VFS compilation fail when you use the code from 1.5.2 and try to
run it with 2.5.3.

To fix the issue we will have to find out a way to make the standalone jackrabbit server use
jackrabbit-webdav version 1.5.2 instead of 2.5.3. Then the tests will pass.

                
> Compilation error with newer versions of Jackrabbit
> ---------------------------------------------------
>
>                 Key: VFS-369
>                 URL: https://issues.apache.org/jira/browse/VFS-369
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Cedric Nanni
>         Attachments: vfs-369-JR-2.5.3.diff, VFS-369.patch
>
>
> When I try to compile VFS on my computer I've got compilation errors due maybe because
I use a more recent version of jackrabbit. I patched the code and now it compiles.
> diff -rupN original//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java
patched//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java
> --- original//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java	2011-08-18
06:57:10.000000000 +0200
> +++ patched//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java	2011-10-24
20:35:41.000000000 +0200
> @@ -50,7 +50,7 @@ public final class ExceptionConverter
>          {
>              try
>              {
> -                Element error = davExc.toXml(DomUtil.BUILDER_FACTORY.newDocumentBuilder().newDocument());
> +                Element error = davExc.toXml(DomUtil.createDocument());
>                  if (DomUtil.matches(error, DavException.XML_ERROR, DavConstants.NAMESPACE))
>                  {
>                      if (DomUtil.hasChildElement(error, "exception", null))
> diff -rupN original//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java patched//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
> --- original//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java	2011-08-18
06:57:10.000000000 +0200
> +++ patched//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java	2011-10-24
20:35:41.000000000 +0200
> @@ -292,19 +292,17 @@ public class WebdavFileObject extends Ht
>              URLFileName fileName = (URLFileName) getName();
>              DavPropertySet properties = getProperties(fileName, PropFindMethod.PROPFIND_ALL_PROP,
>                      new DavPropertyNameSet(), false);
> -            @SuppressWarnings("unchecked") // iterator() is documented to return DavProperty
instances
> -            Iterator<DavProperty> iter = properties.iterator();
> +            Iterator iter = properties.iterator();
>              while (iter.hasNext())
>              {
> -                DavProperty property = iter.next();
> +                DavProperty property = (DavProperty)iter.next();
>                  attributes.put(property.getName().toString(), property.getValue());
>              }
>              properties = getPropertyNames(fileName);
> -            @SuppressWarnings("unchecked") // iterator() is documented to return DavProperty
instances
> -            Iterator<DavProperty> iter2 = properties.iterator();
> +            Iterator iter2 = properties.iterator();
>              while (iter2.hasNext())
>              {
> -                DavProperty property = iter2.next();
> +                DavProperty property = (DavProperty)iter2.next();
>                  if (!attributes.containsKey(property.getName().getName()))
>                  {
>                      property = getProperty(fileName, property.getName());

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message