Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Regarding integration CXF webservice with AEM6.0

Avatar

Level 3

Hi All,

I am facing below issue while integrating AEM 6.0 and CXF webservice.

25.11.2015 19:34:45.913 *ERROR* [qtp293256189-213] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision com.basco.aem.basco-b2c-core [632.0] because it is exposed to package 'javax.servlet' from bundle revisions cxf-dosgi-ri-singlebundle-distribution [628.0] and org.apache.felix.http.servlet-api [29.0] via two dependency chains.

Chain 1:
  com.basco.aem.basco-b2c-core [632.0]
    import: (osgi.wiring.package=javax.servlet)
     |
    export: osgi.wiring.package=javax.servlet
  cxf-dosgi-ri-singlebundle-distribution [628.0]

Chain 2:
  com.basco.aem.basco-b2c-core [632.0]
    import: (&(osgi.wiring.package=com.basco.aem.commerce.hybris.api)(version>=0.0.0)(!(version>=1.0.0)))
     |
    export: osgi.wiring.package=com.basco.aem.commerce.hybris.api; uses:=com.adobe.cq.commerce.api
  com.basco.aem.basco-b2c-commerce [631.0]
    import: (&(osgi.wiring.package=com.adobe.cq.commerce.api)(version>=1.2.0)(!(version>=2.0.0)))
     |
    export: osgi.wiring.package=com.adobe.cq.commerce.api; uses:=javax.servlet.http
  com.adobe.cq.commerce.cq-commerce-core [407.0]
    import: (osgi.wiring.package=javax.servlet.http)
     |
    export: osgi.wiring.package=javax.servlet.http; uses:=javax.servlet
    export: osgi.wiring.package=javax.servlet
  org.apache.felix.http.servlet-api [29.0])

Could you please help me how to resolve this issue.

It would be great if some one respond fastly.

 

Thanks,
Venkatesham G

1 Accepted Solution

Avatar

Correct answer by
Level 10

The best way to use web services in AEM is to use CFX to create create Java proxy classes that consume the given SOAP stack (the WSDL). Then test those proxy classes outside of AEM. Then once you know that the proxy classes and you client code works, then wrap the Java proxy classes into AEM OSGi bundle.

I just tested our example and it works perfectly in AEM 6:

Also - be sure to modify the sling props file as discussed in this article:

Creating Adobe CQ bundles using Apache CXF that consume web service

View solution in original post

3 Replies

Avatar

Level 10

Did you follow our AEM example on how to successfully create Java proxy classes that consume a SOAP stack using CFX? 

Avatar

Level 3

Hi,

I am using dynamic wsdl binding not creating java proxy classess manually.

Here my code: The below  code is working fine in standalone.

        JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
        Client client = factory.createClient(new URL("service?wsdl"));
        List<Object> list = new ArrayList<Object>();
        list.add("D3106BF7-B7F3-4C10-82EB-B2D1ADE400A8");
        list.add("Briggs Engine");
        list.add(BigDecimal.valueOf(35.3141670227));
        list.add(BigDecimal.valueOf(-119.0795440674));
        list.add(Integer.valueOf(1000));
        list.add(Boolean.FALSE);
        Object[] res = client.invoke("xxx_method", list.toArray());
        System.out.println("==>>"+res[0]);

so for this i deployed cxf osgi distribution bundle along with above code component bundle.

Please guide me how to resolve this issue.

 

Thanks,

Venkatesham

Avatar

Correct answer by
Level 10

The best way to use web services in AEM is to use CFX to create create Java proxy classes that consume the given SOAP stack (the WSDL). Then test those proxy classes outside of AEM. Then once you know that the proxy classes and you client code works, then wrap the Java proxy classes into AEM OSGi bundle.

I just tested our example and it works perfectly in AEM 6:

Also - be sure to modify the sling props file as discussed in this article:

Creating Adobe CQ bundles using Apache CXF that consume web service