I think dependency conflict is related to slf4j. You need to exclude all
slf4j dependencies and use relevant opensaml dependency with slf4j.

To exclude transitivity dependencies you can explicitly declare the
immediate parent dependency and then exclude irrelevant dependencies from
it.

This will help -
http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

Thanks,
Krishantha.


On Fri, Jul 4, 2014 at 11:55 PM, Prasad Tissera <[email protected]> wrote:

> Hi Krishantha,
>
> I couldn't find a way to exclude a dependency from which inherits from
> parent pom. I doubt whether it is possible without editing parent pom.
> Since we couldn't edit the parent pom, only option I can think of is using
> opensaml.wso2:opensaml2:jar:2.4.1.wso2v1 which inherited from the parent
> pom. WDYT?
>
> Thanks.
>
>
> On Fri, Jul 4, 2014 at 5:43 PM, Krishantha Samaraweera <
> [email protected]> wrote:
>
>> I see another opensaml version in dependency tree. Can you exclude that
>> version and check.
>>
>> opensaml.wso2:opensaml2:jar:2.4.1.wso2v1
>>
>> Thanks,
>> Krishantha.
>>
>>
>> On Fri, Jul 4, 2014 at 5:35 PM, Prasad Tissera <[email protected]> wrote:
>>
>>> Attached the dependency-tree.
>>>
>>>
>>>  On Fri, Jul 4, 2014 at 5:18 PM, Prasad Tissera <[email protected]>
>>> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I get the following exception when trying to use Open SAML in
>>>> integration tests. I assume this should be dependency problem because it is
>>>> the same code used in saml2-sso-demo
>>>> (carbon/platform/branches/turing/products/is/5.1.0/modules/samples/saml2-sso-demo).
>>>>
>>>> org.apache.maven.surefire.util.SurefireReflectionException:
>>>> java.lang.reflect.InvocationTargetException; nested exception is
>>>> java.lang.reflect.InvocationTargetException: null
>>>> java.lang.reflect.InvocationTargetException
>>>>         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)
>>>> Caused by: java.lang.NoSuchMethodError:
>>>> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
>>>>         at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info
>>>> (SLF4JLocationAwareLog.java:159)
>>>>         at
>>>> org.wso2.carbon.automation.core.PlatformExecutionManager.onExecutionStart(PlatformExecutionManager.java:65)
>>>>         at org.testng.TestNG.runExecutionListeners(TestNG.java:1068)
>>>>         at org.testng.TestNG.run(TestNG.java:1015)
>>>>         at
>>>> org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
>>>>         at
>>>> org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
>>>>         at
>>>> org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
>>>>         ... 9 more
>>>>
>>>> AFAIK the above exception resulted by version conflicts in sl4j. Since
>>>> slf4j has been excluded from the dependencies, I am wondering why I am
>>>> getting the above exception.
>>>>
>>>> I added following dependencies to the IS integration tests pom.
>>>> (5.1.0/modules/integration/tests/pom.xml)
>>>>
>>>> <dependency>
>>>> <groupId>org.opensaml</groupId>
>>>>  <artifactId>opensaml</artifactId>
>>>> <version>2.2.3</version>
>>>> <exclusions>
>>>>  <exclusion>
>>>> <groupId>org.opensaml</groupId>
>>>> <artifactId>openws</artifactId>
>>>>  </exclusion>
>>>> <exclusion>
>>>> <groupId>jargs</groupId>
>>>>  <artifactId>jargs</artifactId>
>>>> </exclusion>
>>>> <exclusion>
>>>>  <groupId>xalan</groupId>
>>>> <artifactId>xalan</artifactId>
>>>> </exclusion>
>>>>  <exclusion>
>>>> <groupId>xerces</groupId>
>>>> <artifactId>xml-apis</artifactId>
>>>>  </exclusion>
>>>> </exclusions>
>>>> </dependency>
>>>>  <dependency>
>>>> <groupId>org.opensaml</groupId>
>>>> <artifactId>openws</artifactId>
>>>>  <version>1.4.2</version>
>>>> <exclusions>
>>>> <exclusion>
>>>>  <groupId>org.slf4j</groupId>
>>>> <artifactId>slf4j-api</artifactId>
>>>> </exclusion>
>>>>  <exclusion>
>>>> <groupId>org.slf4j</groupId>
>>>> <artifactId>log4j-over-slf4j</artifactId>
>>>>  </exclusion>
>>>> </exclusions>
>>>> </dependency>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Prasad Tissera
>>>> Software Engineer.
>>>> Mobile : +94777223444
>>>>
>>>
>>>
>>>
>>> --
>>> Prasad Tissera
>>> Software Engineer.
>>> Mobile : +94777223444
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Krishantha Samaraweera
>> Senior Technical Lead - Test Automation
>> Mobile: +94 77 7759918
>> WSO2, Inc.; http://wso2.com/
>> lean . enterprise . middlewear.
>>
>
>
>
> --
> Prasad Tissera
> Software Engineer.
> Mobile : +94777223444
>



-- 
Krishantha Samaraweera
Senior Technical Lead - Test Automation
Mobile: +94 77 7759918
WSO2, Inc.; http://wso2.com/
lean . enterprise . middlewear.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to