deepy / sonar-crowd

GNU Lesser General Public License v3.0
32 stars 37 forks source link

Upgrading to Sonar 7.1 latest plugin now fails #11

Closed mdiskin closed 6 years ago

mdiskin commented 6 years ago

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.<clinit>(MultiThreadedHttpConnectionManager.java:70) at com.atlassian.crowd.integration.rest.service.RestExecutor.<init>(RestExecutor.java:53) at com.atlassian.crowd.integration.rest.service.RestCrowdClient.<init>(RestCrowdClient.java:85) at com.atlassian.crowd.integration.rest.service.factory.RestCrowdClientFactory.newInstance(RestCrowdClientFactory.java:26) at org.sonar.plugins.crowd.CrowdRealm.createCrowdClient(CrowdRealm.java:82) at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:92) at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)

This seems to be within the atlassian side on a dependency: `

com.atlassian.crowd
        <artifactId>crowd-integration-client-rest</artifactId>
        <version>2.7.2</version>
        <exclusions>
            <!-- Provided by Sonar -->
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>`

Where you previously excluded those logging artifacts but maybe they where loaded by sonar and now they are not.

kuhnroyal commented 6 years ago

I fixed this by adding org.slf4j:jcl-over-slf4j to the pom and rebuilding myself.

SimonWaters commented 6 years ago

We built from the Codecrafters fork for 7.1, which worked first time, but had some changes which we don't completely understand, which we assume related to API changes in Sonar.

kuhnroyal commented 6 years ago

@SimonWaters Yea you are right, I also updated the minimum Sonar-API to 7.1 and fixed most deprecations.

MatthewBenbrook commented 6 years ago

My workaround was to add commons-logging-1.1.3.jar to the sonar server in /lib/common. This is excluded from the dependencies as it is "provided", but in 7.1 it's not provided.

larkoie commented 6 years ago

Hi guys, I did what @MatthewBenbrook said and Sonarqube 7.1 could start with the Crowd plugin but I can't authenticate through it. In the logs I get the following error : DEBUG web[AWQW75R7H9GvbZxIAAAj][auth.event] login failure [cause|Expected one result (or null) to be returned by selectOne(), but found: 2][method|FORM][provider|REALM|Crowd][IP|127.0.0.1|10.10.11.119, 10.10.11.161][login|my_user_id] Any thoughts? Thanks

julienlancelot commented 6 years ago

@larkoie this issue may be linked to https://jira.sonarsource.com/browse/SONAR-10532, if at least one email is used by more than one user. It's fixed in SonarQube 7.2

larkoie commented 6 years ago

@julienlancelot Nice catch, I had two users with the same email on this staging instance. After removing one of the user it worked. Thanks for the quick help!

julienlancelot commented 6 years ago

@larkoie You're welcome, I'm glad to have been able to help you !

deepy commented 6 years ago

I've built a 2.1 based mostly on the changes from @kuhnroyal, thank you for providing the basis to continue on!

I've tested it on 6.7 and 7.2 and made an announcement at the forums, hopefully we'll soon see crowd in the marketplace again :-)

https://github.com/deepy/sonar-crowd/releases/tag/2.1

https://community.sonarsource.com/t/new-release-crowd-plugin-2-1/1929