Angular2 and Karma Issue - karma-jasmine

I have a problem with tests - when running multiple tests one of them fails, but when I isolate them and run one at the time, they all pass. Tests are basic placeholders (I'm working on seed project) and typically look like this:
import {inject, injectAsync, TestComponentBuilder, beforeEachProviders} from 'angular2/testing'
import {describe, ddescribe, it, iit, expect} from 'angular2/testing'
import {provide} from 'angular2/core'
import {PeopleComponent} from './people.component'
describe('PeopleComponent', () => {
beforeEachProviders(() => []);
it('should ...', injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb.createAsync(PeopleComponent).then((fixture) => {
fixture.detectChanges();
});
}));
});
When I change describe to ddescribe in any of the tests, they pass. I can't figure out why. Any ideas?
Full Error trace is below:
Chrome 47.0.2526 (Windows 10 0.0.0) DebugDirective should compile in component template FAILED
Failed: The selector "#root0" did not match any elements
Error: The selector "#root0" did not match any elements
at new BaseException (C:/~/node_modules/angular2/bundles/angular2.dev.js:8080:21)
at DomRenderer_.createRootHostView (C:/~/node_modules/angular2/bundles/angular2.dev.js:15248:15)
at AppViewManager_.createRootHostView (C:/~/node_modules/angular2/bundles/angular2.dev.js:11265:52)
at C:/~/node_modules/angular2/bundles/angular2.dev.js:14531:46
at Zone.run (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:138:17)
at Zone.run (C:/~/node_modules/angular2/bundles/testing.dev.js:2544:30)
at zoneBoundFn (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$$internal$$tryCatch (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1511:16)
at lib$es6$promise$$internal$$invokeCallback (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1523:17)
at lib$es6$promise$$internal$$publish (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1494:11)
at C:/~/node_modules/angular2/bundles/angular2-polyfills.js:243:5
at microtask (C:/~/node_modules/angular2/bundles/testing.dev.js:2557:15)
at Zone.run (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:138:17)
at Zone.run (C:/~/node_modules/angular2/bundles/testing.dev.js:2544:30)
at zoneBoundFn (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$asap$$flush (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1305:9)
Failed: Cannot read property 'hostView' of undefined
TypeError: Cannot read property 'hostView' of undefined
at new ComponentFixture_ (C:/~/node_modules/angular2/bundles/testing.dev.js:2047:97)
at C:/~/node_modules/angular2/bundles/testing.dev.js:2145:16
at Zone.run (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:138:17)
at Zone.run (C:/~/node_modules/angular2/bundles/testing.dev.js:2544:30)
at zoneBoundFn (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$$internal$$tryCatch (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1511:16)
at lib$es6$promise$$internal$$invokeCallback (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1523:17)
at lib$es6$promise$$internal$$publish (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1494:11)
at C:/~/node_modules/angular2/bundles/angular2-polyfills.js:243:5
at microtask (C:/~/node_modules/angular2/bundles/testing.dev.js:2557:15)
at Zone.run (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:138:17)
at Zone.run (C:/~/node_modules/angular2/bundles/testing.dev.js:2544:30)
at zoneBoundFn (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$asap$$flush (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1305:9)
Failed: Cannot read property 'detectChanges' of undefined
TypeError: Cannot read property 'detectChanges' of undefined
at C:/~/dist/scripts/core/components/people/people.component.spec.js:17:32
at C:/~/dist/scripts/core/components/people/people.component.spec.js:17:32
at Zone.run (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:138:17)
at Zone.run (C:/~/node_modules/angular2/bundles/testing.dev.js:2544:30)
at zoneBoundFn (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$$internal$$tryCatch (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1511:16)
at lib$es6$promise$$internal$$invokeCallback (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1523:17)
at lib$es6$promise$$internal$$publish (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1494:11)
at C:/~/node_modules/angular2/bundles/angular2-polyfills.js:243:5
at microtask (C:/~/node_modules/angular2/bundles/testing.dev.js:2557:15)
at Zone.run (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:138:17)
at Zone.run (C:/~/node_modules/angular2/bundles/testing.dev.js:2544:30)
at zoneBoundFn (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$asap$$flush (C:/~/node_modules/angular2/bundles/angular2-polyfills.js:1305:9)
Chrome 47.0.2526 (Windows 10 0.0.0): Executed 16 of 16 (1 FAILED) (0.396 secs / 0.167 secs)

Related

#RabbitListener throw java.lang.IllegalArgumentException: Exchange name required; binding queue xxx

I try to use #RabbitListener to create and bind exchange and queue automatically, but it throw the exception.
2023-02-19 16:56:58.040 ERROR 23348 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'certificateApplyEventHandler' defined in file [E:\codes\trace-platform\supervise\core\target\classes\tp\adapter\event\handler\CertificateApplyEventHandler.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Exchange name required; binding queue EnterpriseCertificateApplyEvent
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at tp.TracePlatformApplication.main(TracePlatformApplication.java:11) ~[classes/:na]
Caused by: java.lang.IllegalArgumentException: Exchange name required; binding queue EnterpriseCertificateApplyEvent
at org.springframework.util.Assert.isTrue(Assert.java:136) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.declareExchangeAndBinding(RabbitListenerAnnotationBeanPostProcessor.java:651) ~[spring-rabbit-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.registerBeansForDeclaration(RabbitListenerAnnotationBeanPostProcessor.java:620) ~[spring-rabbit-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.resolveQueues(RabbitListenerAnnotationBeanPostProcessor.java:582) ~[spring-rabbit-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.processListener(RabbitListenerAnnotationBeanPostProcessor.java:430) ~[spring-rabbit-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.processMultiMethodListeners(RabbitListenerAnnotationBeanPostProcessor.java:381) ~[spring-rabbit-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.postProcessAfterInitialization(RabbitListenerAnnotationBeanPostProcessor.java:299) ~[spring-rabbit-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:431) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1807) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
... 15 common frames omitted
my code is
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import tp.application.SuperviseService;
import tp.core.event.DomainEventHandler;
import javax.annotation.Resource;
/**
* #author jh
* #date 2023/2/16 23:04
*/
#Component
#RabbitListener(bindings = #QueueBinding(
exchange = #Exchange(name = "trace_exchange"),
value = #Queue(value = "trace_queue")
))
public class CertificateApplyEventHandler implements DomainEventHandler<EnterpriseCertificateApplyEvent> {
private static final Logger LOGGER = LoggerFactory.getLogger(CertificateApplyEventHandler.class);
#Resource
SuperviseService superviseService;
#Override
#RabbitHandler
public void onApplicationEvent(EnterpriseCertificateApplyEvent event) {
superviseService.onCertificateApply(event);
}
}
When I debug into the rabbit register code, I found the Annotation #Queue and #Exchange didn't work.
the string of rabitListener bean is:
#org.springframework.amqp.rabbit.annotation.RabbitListener(ackMode=, admin=, autoStartup=, bindings=[#org.springframework.amqp.rabbit.annotation.QueueBinding(admins=[], arguments=[], declare=true, exchange=#org.springframework.amqp.rabbit.annotation.Exchange(admins=[], arguments=[], autoDelete=false, declare=true, delayed=false, durable=true, ignoreDeclarationExceptions=false, internal=false, name=, type=direct, value=), ignoreDeclarationExceptions=false, key=[], value=#org.springframework.amqp.rabbit.annotation.Queue(admins=[], arguments=[], autoDelete=, declare=true, durable=, exclusive=, ignoreDeclarationExceptions=false, name=EnterpriseCertificateApplyEvent, value=EnterpriseCertificateApplyEvent))], concurrency=, containerFactory=, errorHandler=, exclusive=false, executor=, group=, id=, priority=, queues=[], queuesToDeclare=[], returnExceptions=)
Why the name and value I set gone?
maybe it is IDEA cache problem.
I run mvn clean and then rerun, it works.

How can i over come expo error while running on a device?

am having this error after build expo app with EAS. when i run the app using expo start --dev-client i get this error
Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
I tried re-building but still i am getting the same error. Any assistance?
TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNCWebView.isFileUploadSupported')
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\#react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError
at node_modules\metro-runtime\src\polyfills\require.js:null in guardedLoadModule
at http://192.168.0.100:8081/node_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&app=com.futuredesigns.cityfoods&modulesOnly=false&runModule=true:null in global code
Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\#react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in callFunctionReturnFlushedQueue

Spring WebFlux with OpenApi /Swagger Specification (Code Generation) File not Found

I already have the generated code in my spring webflux project, but when a run, its throw me an exception that "openapi.yaml" file does not exists. I searched this file and he is in the resource folder of the generated project(generated by openapi). As you can see, HomeController get this file with the classpath:/openapi.yaml in the Resource attribute declaration.
I'm just making this question because this is an error of a generated class, and i dont know if this should happen or not.
The resource declaration
#Value("classpath:/openapi.yaml")
private Resource openapi;
HomeController class
package org.openapitools.configuration;
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.Charset;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
/**
* Home redirection to OpenAPI api documentation
*/
#Controller
public class HomeController {
private static YAMLMapper yamlMapper = new YAMLMapper();
#Value("classpath:/openapi.yaml")
private Resource openapi;
#Bean
public String openapiContent() throws IOException {
try(InputStream is = openapi.getInputStream()) {
return StreamUtils.copyToString(is, Charset.defaultCharset());
}
}
#GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
#ResponseBody
public String openapiYaml() throws IOException {
return openapiContent();
}
#GetMapping(value = "/openapi.json", produces = "application/json")
#ResponseBody
public Object openapiJson() throws IOException {
return yamlMapper.readValue(openapiContent(), Object.class);
}
#Bean
RouterFunction<ServerResponse> index() {
return route(
GET("/"),
req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui/index.html?url=../openapi.json")).build()
);
}
}
The error recivied.
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-10-16 00:23:12.728 ERROR 30601 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openapiContent' defined in class path resource [org/openapitools/configuration/HomeController.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.String]: Factory method 'openapiContent' threw exception; nested exception is java.io.FileNotFoundException: class path resource [openapi.yaml] cannot be opened because it does not exist
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:483) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:62) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at com.gabriel.forum.ForumApplication.main(ForumApplication.java:10) ~[main/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.String]: Factory method 'openapiContent' threw exception; nested exception is java.io.FileNotFoundException: class path resource [openapi.yaml] cannot be opened because it does not exist
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.String]: Factory method 'openapiContent' threw exception; nested exception is java.io.FileNotFoundException: class path resource [openapi.yaml] cannot be opened because it does not exist
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
... 20 common frames omitted
Caused by: java.io.FileNotFoundException: class path resource [openapi.yaml] cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource [openapi.yaml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.openapitools.configuration.HomeController.openapiContent(HomeController.java:36) ~[main/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
... 21 common frames omitted
> Task :ForumApplication.main() FAILED
Execution failed for task ':ForumApplication.main()'.
> Process 'command '/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
The resource folder and the project structure.
I found a solution.
Just add a config option in your build.gralde or pom.xml "interfaceOnly": "true".
That configuration will generate only the interfaces and classes that you declared in the inputSpec file, and the HomeController will no longer exists to seek the openapi.yml file.
That solution is only for spring webflux projects.
Heres is the config options in gradle syntax:
configOptions = [
dateLibrary: "java8",
reactive: "true",
"interfaceOnly": "true"
]
Maven syntax:
<configOptions>
<reactive>true</reactive>
<java8>true</java8>
<interfaceOnly>true</interfaceOnly>
</configOptions>

Why is ignite failing to deserialize a GridClosureProcessor object?

I know a similar stack has been posted by others. My question is "it looks like Ignite is trying to deserialize a GridClosureProcessor (or a closure from it?) . If so, why is it doing that? I am trying to root cause this issue but none of my code is in the stack except MyCallable mentioned at the top (not actually in the stack).
No cache puts are happening in this code path unless they are internal. I mention this because of a comment on another post that "Unknown pair" can be caused by a cache put of the wrong type.
I am focusing on
Failed to deserialize object
[typeName=org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2]
Here's the rest.
[2019-04-08 22:20:23,724][ERROR][pub-#63][GridJobWorker] Failed to
initialize job
[jobId=800890ff961-7ff6a786-9d4d-43d8-91a0-70225c5e3a4a,
ses=GridJobSessionImpl [ses=GridTaskSessionImpl
[taskName=com.obfucorp.aa.project.core.jobs.MyCallable,
dep=GridDeployment [ts=1554761996013, depMode=SHARED,
clsLdr=sun.misc.Launcher$AppClassLoader#764c12b6,
clsLdrId=730290ff961-8d93b961-09f2-48c3-bd2f-49db31aae61e, userVer=0,
loc=true,
sampleClsName=o.a.i.i.processors.cache.GridCacheProcessor$RemovedItemsCleanupTask$1,
pendingUndeploy=false, undeployed=false, usage=1],
taskClsName=com.obfucorp.aa.project.core.jobs.MyCallable,
sesId=700890ff961-7ff6a786-9d4d-43d8-91a0-70225c5e3a4a,
startTime=1554762023663, endTime=9223372036854775807,
taskNodeId=7ff6a786-9d4d-43d8-91a0-70225c5e3a4a,
clsLdr=sun.misc.Launcher$AppClassLoader#764c12b6, closed=false,
cpSpi=null, failSpi=null, loadSpi=null, usage=1, fullSup=false,
internal=false, topPred=null,
subjId=7ff6a786-9d4d-43d8-91a0-70225c5e3a4a, mapFut=IgniteFuture
[orig=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null,
hash=314803578]], execName=null],
jobId=800890ff961-7ff6a786-9d4d-43d8-91a0-70225c5e3a4a]] class
org.apache.ignite.IgniteCheckedException: Failed to deserialize object
[typeName=org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2]
at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:9908)
at
org.apache.ignite.internal.processors.job.GridJobWorker.initialize(GridJobWorker.java:438)
at
org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1117)
at
org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1921)
at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at
org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by: class
org.apache.ignite.binary.BinaryObjectException: Failed to deserialize
object
[typeName=org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2]
at
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:875)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1762)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1714)
at
org.apache.ignite.internal.binary.GridBinaryMarshaller.deserialize(GridBinaryMarshaller.java:310)
at
org.apache.ignite.internal.binary.BinaryMarshaller.unmarshal0(BinaryMarshaller.java:99)
at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:82)
at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:9902)
... 10 more Caused by: class
org.apache.ignite.binary.BinaryInvalidTypeException: Unknown pair
[platformId=0, typeId=-1409390795] at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:696)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1755)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1714)
at
org.apache.ignite.internal.binary.BinaryUtils.doReadObject(BinaryUtils.java:1799)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.readObject(BinaryReaderExImpl.java:1329)
at
org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.readBinary(GridClosureProcessor.java:1872)
at
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:834)
... 16 more Caused by: java.lang.ClassNotFoundException: Unknown pair
[platformId=0, typeId=-1409390795] at
org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:385)
at
org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:335)
at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:687)
... 22 more
update - wanted to note this is happening a fresh deployment. There are no old files or persisted anything around. All classes are either pulled from even or freshly compiled. ty.
Pavel, here is the (Scala) code (redacted)
object MyCallable {
type FooList = Array[Foo]
}
class MyCallable(cacheName: String) extends IgniteCallable[FooList] with Serializable with LazyLogging {
#IgniteInstanceResource
private var ignite: Ignite = _
override def call(): FooList = {
logger.debug("callable called.");
val fooCache = ignite.getOrCreateCache[String, Foo](cacheName)
val qry = new ScanQuery[String, Foo]()
qry.setLocal(true)
val cursor = fooCache.query(qry)
val ret = cursor.iterator().asScala.map(e => e.getValue).toArray
logger.info("load status array: {}", ret.mkString)
return ret
}
#IgniteInstanceResource
def setIgnite(ignite: Ignite): Unit = {
this.ignite = ignite
}
}
Caused by: class org.apache.ignite.binary.BinaryInvalidTypeException: Unknown pair [platformId=0, typeId=-1409390795]
Seems like you have lost your marshaller cache (marshaller/ dir).
You can do ignite.marshaller().marshal(new WhateverTypeIsCausingThis()); once to make this error go away.

Why google play services lib error occurring while uploading logcat file

Can anyone please tell me why that Google Play services lib error is occurring. This is my logcat file:
01-20 19:11:56.505: D/dalvikvm(32169): open_cached_dex_file : /data/app/info.androidhive.googlemapsv2-2.apk /data/dalvik-cache/data#app#info.androidhive.googlemapsv2-2.apk#classes.dex
01-20 19:11:56.526: D/dalvikvm(32169): DexOpt: couldn't find static field Lcom/google/android/gms/R$styleable;.MapAttrs_liteMode
01-20 19:11:56.526: W/dalvikvm(32169): VFY: unable to resolve static field 1484 (MapAttrs_liteMode) in Lcom/google/android/gms/R$styleable;
01-20 19:11:56.526: D/dalvikvm(32169): VFY: replacing opcode 0x60 at 0x00af
01-20 19:11:56.527: D/dalvikvm(32169): DexOpt: couldn't find static field Lcom/google/android/gms/R$styleable;.MapAttrs_liteMode
01-20 19:11:56.527: I/dalvikvm(32169): DexOpt: unable to optimize static field ref 0x05cc at 0xb7 in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes
01-20 19:11:56.527: D/dalvikvm(32169): DexOpt: couldn't find static field Lcom/google/android/gms/R$styleable;.MapAttrs_uiMapToolbar
01-20 19:11:56.527: I/dalvikvm(32169): DexOpt: unable to optimize static field ref 0x05cf at 0xc0 in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes
01-20 19:11:56.527: D/dalvikvm(32169): DexOpt: couldn't find static field Lcom/google/android/gms/R$styleable;.MapAttrs_uiMapToolbar
01-20 19:11:56.527: I/dalvikvm(32169): DexOpt: unable to optimize static field ref 0x05cf at 0xc8 in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes
01-20 19:11:56.527: D/dalvikvm(32169): DexOpt: couldn't find static field Lcom/google/android/gms/R$styleable;.MapAttrs_ambientEnabled
01-20 19:11:56.527: I/dalvikvm(32169): DexOpt: unable to optimize static field ref 0x05c6 at 0xd1 in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes
01-20 19:11:56.527: D/dalvikvm(32169): DexOpt: couldn't find static field Lcom/google/android/gms/R$styleable;.MapAttrs_ambientEnabled
01-20 19:11:56.527: I/dalvikvm(32169): DexOpt: unable to optimize static field ref 0x05c6 at 0xd9 in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes
01-20 19:11:56.527: D/AndroidRuntime(32169): Shutting down VM
01-20 19:11:56.527: W/dalvikvm(32169): threadid=1: thread exiting with uncaught exception (group=0x414299a8)
01-20 19:11:56.527: E/test(32169): Exception
01-20 19:11:56.530: E/AndroidRuntime(32169): FATAL EXCEPTION: main
01-20 19:11:56.530: E/AndroidRuntime(32169): java.lang.NoSuchFieldError: com.google.android.gms.R$styleable.MapAttrs_liteMode
01-20 19:11:56.530: E/AndroidRuntime(32169): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
01-20 19:11:56.530: E/AndroidRuntime(32169): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.Activity.onCreateView(Activity.java:4794)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-20 19:11:56.530: E/AndroidRuntime(32169): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:280)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.Activity.setContentView(Activity.java:1899)
01-20 19:11:56.530: E/AndroidRuntime(32169): at info.androidhive.googlemapsv2.MainActivity.onCreate(MainActivity.java:38)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.Activity.performCreate(Activity.java:5182)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.ActivityThread.access$600(ActivityThread.java:156)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.os.Handler.dispatchMessage(Handler.java:99)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.os.Looper.loop(Looper.java:153)
01-20 19:11:56.530: E/AndroidRuntime(32169): at android.app.ActivityThread.main(ActivityThread.java:5299)
01-20 19:11:56.530: E/AndroidRuntime(32169): at java.lang.reflect.Method.invokeNative(Native Method)
01-20 19:11:56.530: E/AndroidRuntime(32169): at java.lang.reflect.Method.invoke(Method.java:511)
01-20 19:11:56.530: E/AndroidRuntime(32169): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
01-20 19:11:56.530: E/AndroidRuntime(32169): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
01-20 19:11:56.530: E/AndroidRuntime(32169): at dalvik.system.NativeStart.main(Native Method)`
Updating your Google Repository to version 15 via the SDK Manager should resolve the issues and eliminate the needs for the workarounds. A project clean is required.
Android SDK
This is also mentioned in issue 7432.