Building the old custom snap

I was not able to build the old custom snap , So I used the latest POM from demosnap and build the custom snap .

Now the build ran successfully . But all tests are failing with the same reason .

2018-08-07 15:31:49 ERROR SchemaRegistry:115 a- Unable to get schema: com-snaplogic-snap-template_2
com.google.common.util.concurrent.UncheckedExecutionException: com.snaplogic.api.ExecutionException: Unable to open schema file: ./jschema/src/test/resources/schema/com-snaplogic-snap-template_2.schema
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2207)
at com.google.common.cache.LocalCache.get(LocalCache.java:3953)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3957)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4875)
at com.snaplogic.schema.validator2.SchemaRegistry.lookup(SchemaRegistry.java:105)
at com.snaplogic.data.model.SnapDataFactory.loadSchema(SnapDataFactory.java:223)
at com.snaplogic.data.model.SnapDataFactory.loadSchema(SnapDataFactory.java:231)
at com.snaplogic.data.model.SnapDataFactory.createSnapDefinitionData(SnapDataFactory.java:116)
at com.snaplogic.snap.schema.SchemaService.describe(SchemaService.java:106)
at com.snaplogic.snap.test.harness.SnapExecutor.initFixtures(SnapExecutor.java:279)
at com.snaplogic.snap.test.harness.SnapExecutor.(SnapExecutor.java:253)
at com.snaplogic.snap.test.harness.SnapTestRunner.withSnapExecutor(SnapTestRunner.java:200)
at com.snaplogic.snap.test.harness.SnapTestRunner.methodBlock(SnapTestRunner.java:192)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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.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: com.snaplogic.api.ExecutionException: Unable to open schema file: ./jschema/src/test/resources/schema/com-snaplogic-snap-template_2.schema
at com.snaplogic.snap.schema.TestSchemaSource.lookupSchema(TestSchemaSource.java:56)
at com.snaplogic.schema.validator2.SchemaRegistry$1.load(SchemaRegistry.java:64)
at com.snaplogic.schema.validator2.SchemaRegistry$1.load(SchemaRegistry.java:61)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3542)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2323)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2286)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
… 32 more
Caused by: java.io.FileNotFoundException: .\jschema\src\test\resources\schema\com-snaplogic-snap-template_2.schema (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at com.snaplogic.snap.schema.TestSchemaSource.lookupSchema(TestSchemaSource.java:53)
… 38 more

And I can see logs , the schemas are generated but in the different location,

[WARNING] Run mvn clean before packaging. Directory still exist and may contain stale data: C:\Applications\REACT4\snaplogic-snappack\target\schema
[INFO] Initializing e-lang version: {initTime=2018-08-07T10:01:30.006Z, langVersion=4.0-tahoerc12}
[INFO] Found lint com.snaplogic.expression.methods.object.HasOwnProperty.INVALID_VALUE; ordinal=0
[INFO] Found lint com.snaplogic.expression.methods.object.HasOwnProperty.NULL_VALUE; ordinal=1
[INFO] Found lint com.snaplogic.expression.methods.date.DateMethod.JSON_FORMAT_ARG; ordinal=2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2
[INFO] Successfully compiled schema: com-snaplogic-snap-template_2

Development recommends that you try:

mvn -U clean install

Thanks @dmiller ! Yes, the -U should force the update of your dependencies. It could be that either the Snappack Installer dependency that you have in your local repository is not compatible, or platform dependencies, or (very likely due to what I now see in the Stack trace) the Platform Jschema dependency may be incompatible. If you build with -U and force all of the dependencies to be analyzed, and re-downloaded, that should hopefully resolve the issue.

Thanks all,
-Charlie

I still getting the same issue. I am attaching the POM pom.zip (3.2 KB)

If I get a custom snap which is working fine. I can use that as well. The code for demosnap looks like old dependencies.

Let me try building the demo snap https://github.com/SnapLogic/DemoSnapPack

I am getting build error .

so i updated <japi.version>4.9.0.M1</japi.version> , after that I am getting the same error

Harriesh, I recommend starting over. Rename your .m2 folder and your SNAP_HOME folder and reinstall. Also, make sure you follow the install instructions precisely at http://developer.snaplogic.com/#snap-maven-archetype (including versions numbers) . Initially, I made the mistake of trying to version-up the Maven Archetype Plugin version to 3+ and it messed me up; so I learned I needed to follow the documentation exact and install the recommended version 2.4 to resolve.

I hope this helps…

@robin made an update to the DemoSnapPack.

I used both https://github.com/SnapLogic/DemoSnapPack and Maven project generated from archetype. I am getting the same error during unit tests: Unable to get schema: com-snaplogic-snap-template_2, FileNotFoundException: .\jschema\src\test\resources\schema\com-snaplogic-snap-template_2.schema. There is no com-snaplogic-snap-template_2.schema in git project at this location, not in project generated from archetype. I use maven 3.5, since issue ARCHETYPE-519 in https://developer.snaplogic.com/#snap-maven-archetype was fixed, we do not have to use maven 2.4.

Just build your project without the tests. Something is changed I believe in the code or in the tests, that is why they are not completing properly. When you pack the snap pack just use:

mvn clean install -D skipTests=true

This will skip the tests.