08-07-2018 03:19 AM
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
09-27-2018 11:52 AM
I used both GitHub - SnapLogic/DemoSnapPack: A Snap Pack for demonstration and references purposes. This is the ... 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 Snap Development Documentation was fixed, we do not have to use maven 2.4.
10-16-2018 09:11 AM
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.
10-24-2022 07:57 AM
You can find Snap developer documentation at http://developer.snaplogic.com .
There is also the Snap Development Training course available through the SnapLogic Enterprise Automation Academy.