icfnext / prosper

A Spock-based integration testing library for prosperous AEM development.
Other
28 stars 19 forks source link

groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider(org.apache.jackrabbit.core.XASessionImpl, null, null) #4

Closed jblack10101 closed 10 years ago

jblack10101 commented 10 years ago

I'm having an issue running a basic ProsperSpec with version 0.12.0. Here's my spec:

package my.prosper.test.package
import com.citytechinc.aem.prosper.specs.ProsperSpec
class ProsperTest extends ProsperSpec {
    def "test"() {
        expect:
        1 == 1
    }
}

and here's the output (including the error) that I get:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/162423/.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/162423/.m2/repository/org/slf4j/slf4j-nop/1.6.4/slf4j-nop-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
544 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - Starting repository...
552 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem initialized at path C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\repository
1070 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem initialized at path C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\version
3750 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - initializing workspace 'default'...
3751 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem initialized at path C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\default
5859 [main] INFO org.apache.jackrabbit.core.query.lucene.SearchIndex - Index initialized: C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository/repository/index Version: 3
5930 [main] INFO org.apache.jackrabbit.core.query.lucene.SearchIndex - Index initialized: C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\default/index Version: 3
5932 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - workspace 'default' initialized
5955 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - SecurityManager = class org.apache.jackrabbit.core.DefaultSecurityManager
5956 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - initializing workspace 'security'...
5958 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSystem - LocalFileSystem initialized at path C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\security
6235 [main] INFO org.apache.jackrabbit.core.query.lucene.SearchIndex - Index initialized: C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\security/index Version: 3
6236 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - workspace 'security' initialized
6238 [main] INFO org.apache.jackrabbit.core.DefaultSecurityManager - init: use Repository Login-Configuration for Jackrabbit
6353 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - Repository started (5809ms)
6354 [main] INFO org.apache.jackrabbit.core.TransientRepository - Transient repository initialized
6541 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session opened
6684 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session opened
7698 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session closed
7712 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session opened
7729 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session opened
7778 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session closed

groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider(org.apache.jackrabbit.core.XASessionImpl, null, null)
    at com.citytechinc.aem.prosper.mocks.resource.MockResourceResolver.<init>(MockResourceResolver.groovy:32)
    at com.citytechinc.aem.prosper.specs.ProsperSpec.setupSpec(ProsperSpec.groovy:68)

8272 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session closed
8280 [Thread-4] INFO org.apache.jackrabbit.core.TransientRepository - Session closed
8280 [Thread-4] INFO org.apache.jackrabbit.core.RepositoryImpl - Shutting down repository...
8287 [Thread-4] INFO org.apache.jackrabbit.core.query.lucene.SearchIndex - Index closed: C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository/repository/index
8287 [Thread-4] INFO org.apache.jackrabbit.core.RepositoryImpl - shutting down workspace 'default'...
8288 [Thread-4] INFO org.apache.jackrabbit.core.observation.ObservationDispatcher - Notification of EventListeners stopped.
8291 [Thread-4] INFO org.apache.jackrabbit.core.query.lucene.SearchIndex - Index closed: C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\default/index
8353 [Thread-4] INFO org.apache.jackrabbit.core.util.db.DerbyConnectionHelper - Database 'C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\default/db' shutdown.
8361 [Thread-4] INFO org.apache.jackrabbit.core.RepositoryImpl - workspace 'default' has been shutdown
8361 [Thread-4] INFO org.apache.jackrabbit.core.RepositoryImpl - shutting down workspace 'security'...
8361 [Thread-4] INFO org.apache.jackrabbit.core.observation.ObservationDispatcher - Notification of EventListeners stopped.
8364 [Thread-4] INFO org.apache.jackrabbit.core.query.lucene.SearchIndex - Index closed: C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\security/index
8407 [Thread-4] INFO org.apache.jackrabbit.core.util.db.DerbyConnectionHelper - Database 'C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository\workspaces\security/db' shutdown.
8408 [Thread-4] INFO org.apache.jackrabbit.core.RepositoryImpl - workspace 'security' has been shutdown
8449 [Thread-4] INFO org.apache.jackrabbit.core.util.db.DerbyConnectionHelper - Database 'C:\ws\wcm-platform-camd-digital-on-air\bundle\target\repository/version/db' shutdown.
8489 [Thread-4] INFO org.apache.jackrabbit.core.RepositoryImpl - Repository has been shutdown
8490 [Thread-4] INFO org.apache.jackrabbit.core.TransientRepository - Transient repository shut down
markdaugherty commented 10 years ago

Can you email your project's pom.xml to me, mdaugherty@citytechinc.com?

That constructor error will occur if there is an earlier version of the Sling JCR Resource dependency in the classpath; however, Prosper itself inherits from our aem-parent project which specifies all the required AEM6 dependencies. Perhaps if your project is defining a newer version of this dependency, that could be causing this runtime issue, but I'd like to inspect the pom to be certain. Thanks!

jblack10101 commented 10 years ago

Ah ok, I missed the part about the latest version requiring AEM 6. We're still on AEM 5.6.1, so I tried version 0.9.0 and it works fine. Thanks for the help!