-
Bug
-
Resolution: Done
-
Medium
-
Frankfurt Release
-
None
-
Policy 5/26-6/5
I just renamed the naming policy to JSON and it was looking for yaml. It could not find it, dumped an exception but then hung in a loop afterward.
The work around is obviously to ensure the name of the policy is correct and "findable". But the api should not hang in the case it is not found. Just print the exception and continue to load.
2020-04-13 11:28:51,788 policy-api [main] ERROR o.o.policy.api.main.startstop.Main - Preloading policy types into DB failed
org.onap.policy.api.main.exception.PolicyApiException: org.onap.policy.api.main.exception.PolicyApiException: Preloading entity cannot be found: policies/sdnc.policy.naming.input.tosca.json
at org.onap.policy.api.main.startstop.ApiDatabaseInitializer.initializeApiDatabase(ApiDatabaseInitializer.java:83)
at org.onap.policy.api.main.startstop.Main.<init>(Main.java:83)
at org.onap.policy.api.main.rest.TestApiRestServer.setupParameters(TestApiRestServer.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:377)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:138)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:465)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:451)
Caused by: org.onap.policy.api.main.exception.PolicyApiException: Preloading entity cannot be found: policies/sdnc.policy.naming.input.tosca.json
at org.onap.policy.api.main.startstop.ApiDatabaseInitializer.preloadServiceTemplate(ApiDatabaseInitializer.java:94)
at org.onap.policy.api.main.startstop.ApiDatabaseInitializer.initializeApiDatabase(ApiDatabaseInitializer.java:80)
... 22 common frames omitted
2020-04-13 11:29:52,138 policy-api [main] WARN o.o.p.c.utils.network.NetworkUtil - localhost:56906 closed = retries=60 interval=1000