cancel
Showing results for 
Search instead for 
Did you mean: 

Error when building APM on SAP Web IDE Full stack

former_member516423
Participant
0 Kudos

Hi,

1. I've tried to do the Deep dive 12.

When I build the Java module, it generates the error.

This is CDS 2.3.2, Compiler 1.0.30, Home: node_modules/@sap/cds
Compiled 'srv/my-service.cds' to  
srv/src/main/resources/edmx/CrudService.xml  
srv/src/main/resources/edmx/csn.json
[ERROR] ENOENT: no such file or directory, scandir '/home/vcap/app/.java-buildpack/tomcat/temp/builder/sap.java.maven/builds/build-6476755901837354415/bp_test/db/src/gen'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my.app@1.0.0 build: `cds build --clean`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the my.app@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vcap/app/META-INF/cache/8.9.1/.npm/_logs/2018-08-15T05_35_30_240Z-debug.log[ERROR] 
Command execution failed.org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)	
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)	
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)	
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804)	
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)	
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)	
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)	
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)	
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)	
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)	
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)	
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)	
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)	
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)	
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)	
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)	
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)	
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)	
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)	
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)	
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
at java.lang.reflect.Method.invoke(Method.java:498)	
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)	
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)	
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)	
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356

Here is the POM file which is generated by the template

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">;
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.sap.cloud.servicesdk.prov</groupId>
		<artifactId>projects-parent-odatav2</artifactId>
		<version>1.17.1</version>
	</parent>
	<artifactId>srv</artifactId>
	<groupId>com.company.bp_test</groupId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<name>srv</name>
	<properties>
		<packageName>com.company.bp_test</packageName>
	</properties>
	<build>
		<finalName>${project.artifactId}-${project.version}</finalName>
		<plugins >
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.6.0</version>
				<executions>
					<execution>
						<id>npm install(initialize)</id>
						<goals>
							<goal>exec</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<executable>npm</executable>
							<workingDirectory>${project.basedir}/../</workingDirectory>
							<arguments>
								<argument>install</argument>
							</arguments>
						</configuration>
					</execution>
					<execution>
						<id>npm run build cds</id>
						<goals>
							<goal>exec</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<!--assuming npm is in the $PATH-->
							<executable>npm</executable>
							<workingDirectory>${project.basedir}/../</workingDirectory>
							<arguments>
								<argument>run</argument>
								<argument>build</argument>
							</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
	</build>
	<profiles>
		<profile>
			<activation>
				<property>
					<name>devmode</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-war-plugin</artifactId>
						<version>3.0.0</version>
						<configuration>
							<webResources combine.children="append">
								<resource>
									<directory>${project.build.sourceDirectory}</directory>
									<targetPath>sources</targetPath>
								</resource>
							</webResources>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>

Does anyone know how to resolve it?

Regards,

Tri

Accepted Solutions (1)

Accepted Solutions (1)

christoph_pohl
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Tri,

do you see a chance to attach the ZIP export of your MTA project from WebIDE (provided there are no sensitive data inside)?

Does this happen all the time for every for every SAP CP Business Application Project you create from scratch using the wizard?

Best,

Christoph

former_member516423
Participant
0 Kudos

Hi Christoph,

I've attached the ZIP export. Please follow the link. Attachment

This happens to every Business Application project I create from scratch using the wizard this week.

Regards,

Tri

christoph_pohl
Product and Topic Expert
Product and Topic Expert

Your example MTA has a db module, which is not registered in your mta.yaml. Hence WebIDE does not know about it but CDS build still tries to access it. Please follow the last steps in the Appendix of the above mentioned blog post (https://blogs.sap.com/2018/06/05/deep-dive-9-use-the-sap-s4hana-cloud-sdk-in-the-application-programming-model-for-sap-cloud-platform/# ) and remove the db folder from your MTA project's source. Then srv will build again.

former_member516423
Participant
0 Kudos

Hi christoph.pohl,

Thank you. I'm able to build and run the module alone. I've noticed some behaviours.

The $skip, $top and $orderby do not work properly.

For example:

a. https://<host>/odata/v2/CrudService/BusinessPartner?$top=1&$skip=1

The service doesn't return any data.

b. https://<host>/odata/v2/CrudService/BusinessPartner?$top=2&$skip=1

If $skip < $top like in this case, it returns only one record, not 2 records.

How can I resolve this issue because it will affect the pagination?

c. https://<host>/odata/v2/CrudService/BusinessPartner?$orderby=BusinessPartner desc

The returned data is not sorted by the criteria.

I've run these operations directly with /sap/opu/odata/sap/API_BUSINESS_PARTNER and it returns correct data.

Thanks

Tri

Answers (0)