SAP-docs / btp-integration-suite

Markdown source for the Integration Suite documentation. Enables feedback and contributions to improve the documentation.
Creative Commons Attribution 4.0 International
9 stars 13 forks source link

com.sap.cloud.adk.archetype-adapter-component-reuse #39

Closed ottfro1 closed 1 month ago

ottfro1 commented 5 months ago

Issue description

We want to use the https://cxf.apache.org/docs/openapifeature.html

Hence we want ot use the https://camel.apache.org/components/4.0.x/cxfrs-component.html https://camel.apache.org/components/4.0.x/dataformats/jaxb-dataformat.html

When we use the archetype com.sap.cloud.adk.archetype-adapter-component-reuse for

org.apache.camel camel-cxf ${camel.version} We hit error : **Build failed: Dependency libs/spring-aop-5.3.23.jar is not a valid OSGi bundle** I guess this will be a very common error and it would be good if sap had a documented solution. There are more spring components with the same problem spring-beans, spring-context, spring-core, spring-expression, spring-jcl, spring-tx and a bunch of more components We think the solution should be to use maven org.apache.felix maven-bundle-plugin but so fare we have failed to make it work. You may be able to use this mehtod https://help.sap.com/docs/integration-suite/sap-integration-suite/create-osgi-bundle?locale=en-US but then the point with using archetype and maven is lost - the process has massive amount of manual work. A description of how to setup an IDE with java would be good. SAP should have at least one proven to work IDE with one proven to work java. When trying this I used NWDS 7.5 sp28 and the bundled maven in eclipse using sap java SE 1.8 in NWDS "new maven project" and Group Id se.mycompany.nip.cloud.adk ArtifactId CIApacheCXF adapterName : ApacheCXF adapterId : camel-cxf ApacheCXFID adapterVendor : org.apache.camel adapterVersion : 1.0.0 ### Feedback Type (Optional) content gaps ### Page Title on SAP Help Portal (prefilled) Develop Adapters Using Archetype ### Page URL on SAP Help Portal (prefilled) https://help.sap.com/docs/integration-suite/sap-integration-suite/develop-adapters-using-archetype
SrutiSagaram commented 5 months ago

Hi @ottfro1 Thank you for your feedback, we are looking into it and will get back to you.

ottfro1 commented 5 months ago

in the pom.xml

2.3.0 3.14.7
ottfro1 commented 5 months ago

We also tested using Eclipse Version: 2023-06 (4.28.0) Build id: 20230608-1333

But then we get error [ERROR] Failed to execute goal com.sap.cloud.adk:com.sap.cloud.adk.build.archive:2.3.0:generate-cmdERROR on project CIApacheCXF: Execution generate-metadata of goal com.sap.cloud.adk:com.sap.cloud.adk.build.archive:2.3.0:generate-cmd failed: A required class was missing while executing com.sap.cloud.adk:com.sap.cloud.adk.build.archive:2.3.0:generate-cmd: javax/xml/bind/JAXBException [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>com.sap.cloud.adk:com.sap.cloud.adk.build.archive:2.3.0 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/C:/Users/O1706/.m2/repository/com/sap/cloud/adk/com.sap.cloud.adk.build.archive/2.3.0/com.sap.cloud.adk.build.archive-2.3.0.jar [ERROR] urls[1] = file:/C:/Users/O1706/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/4.0.1/jakarta.xml.bind-api-4.0.1.jar [ERROR] urls[2] = file:/C:/Users/O1706/.m2/repository/jakarta/activation/jakarta.activation-api/2.1.2/jakarta.activation-api-2.1.2.jar [ERROR] urls[3] = file:/C:/Users/O1706/.m2/repository/org/apache/aries/subsystem/org.apache.aries.subsystem.api/1.1.0/org.apache.aries.subsystem.api-1.1.0.jar [ERROR] urls[4] = file:/C:/Users/O1706/.m2/repository/org/apache/aries/org.apache.aries.util/1.1.0/org.apache.aries.util-1.1.0.jar [ERROR] urls[5] = file:/C:/Users/O1706/.m2/repository/org/ow2/asm/asm/6.2.1/asm-6.2.1.jar [ERROR] urls[6] = file:/C:/Users/O1706/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar [ERROR] urls[7] = file:/C:/Users/O1706/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] [ERROR]  [ERROR] ----------------------------------------------------- [ERROR] : javax.xml.bind.JAXBException [ERROR] -> [Help 1]

A possible solution is to add dependency but we could not make it work

  <!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>4.0.1</version>
</dependency>

We think the archetype should have the necessary dependencies from start.

ottfro1 commented 5 months ago

SAP Business Application Studio - is that a possible IDE?

ottfro1 commented 5 months ago

https://tools.hana.ondemand.com/#cloudintegration

The adapter development process using Eclipse plugin has been deprecated

We tested eclipse oxygen - the same error : Build failed: Dependency libs/spring-aop-5.3.23.jar is not a valid OSGi bundle

creating a project - maven project or adapter project?

ottfro1 commented 5 months ago

oxygene is from 2018 - obsolete and outdated?

ottfro1 commented 5 months ago

oxygene is from 2018 - obsolete and outdated?

ottfro1 commented 5 months ago

oxygene is from 2018 - obsolete and outdated?

HarshitaSuryavanshi commented 4 months ago

Hi @ottfro1, You can follow this blog: https://community.sap.com/t5/technology-blogs-by-sap/sap-cpi-adapter-development-consuming-an-external-jar-into-an-adapter/ba-p/13382631
to use an external service which is non-osgi.

We are in process of updating our Help portal documentation.

ottfro1 commented 4 months ago

Hi @ottfro1, You can follow this blog: https://community.sap.com/t5/technology-blogs-by-sap/sap-cpi-adapter-development-consuming-an-external-jar-into-an-adapter/ba-p/13382631 to use an external service which is non-osgi.

We are in process of updating our Help portal documentation.

Hi Harshita, thanks for the link, unfortunately we have not been able make the linked solution work for the "reuse archetype" scenario. I think SAP should fix the "reuse archetype" so non-osgi ar packed/bundled automatically. At least there should be a clear path to the solution documented.

HarshitaSuryavanshi commented 1 month ago

The topic is updated: https://help.sap.com/docs/integration-suite/sap-integration-suite/create-osgi-bundle?locale=en-US&state=DRAFT&version=DEV