Jobrunr is not starting up in DEVELOPMENT env - kotlin

Jobrunr fails during startup in a micronaut application DEVELOPMENT environment. It works fine in local IDE. Below is the configuration:
jobrunr:
database:
type: sql
datasource: default
skip-create: true
table_prefix: 'jobrunr.'
background-job-server:
enabled: ${JOBRUNR_JOBS:false}
dashboard:
enabled: true
job-scheduler:
enabled: true
jobs:
retry-back-off-time-seed: 2
Below is the actual exception:
"stack_trace":"java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:143)
at org.jobrunr.micronaut.autoconfigure.JobRunrStarter.startup(JobRunrStarter.java:32)
at org.jobrunr.micronaut.autoconfigure.$JobRunrStarter$Definition$Exec.dispatch(Unknown Source)
at io.micronaut.context.AbstractExecutableMethodsDefinition$DispatchedExecutableMethod.invoke(AbstractExecutableMethodsDefinition.java:378)
at io.micronaut.context.DefaultBeanContext$BeanExecutionHandle.invoke(DefaultBeanContext.java:3807)
at io.micronaut.aop.chain.AdapterIntroduction.intercept(AdapterIntroduction.java:83)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:137)
at org.jobrunr.micronaut.autoconfigure.JobRunrStarter$ApplicationEventListener$startup1$Intercepted.onApplicationEvent(Unknown Source)
at io.micronaut.context.event.ApplicationEventPublisherFactory.notifyEventListeners(ApplicationEventPublisherFactory.java:262)
at io.micronaut.context.event.ApplicationEventPublisherFactory.access$200(ApplicationEventPublisherFactory.java:60)
at io.micronaut.context.event.ApplicationEventPublisherFactory$2.publishEvent(ApplicationEventPublisherFactory.java:229)
at io.micronaut.http.server.netty.NettyHttpServer.fireStartupEvents(NettyHttpServer.java:557)
at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:300)
at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:111)
at io.micronaut.runtime.Micronaut.lambda$start$2(Micronaut.java:78)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at io.micronaut.runtime.Micronaut.start(Micronaut.java:76)
at com.app.ApplicationKt.main(Application.kt:12)\n"
It seems like the injection is not happening well? I am using micronaut version 3.5.2, Kotlin version 1.6.21 and jobrunr version 5.1.6

Related

How to run a Lambda Docker with serverless offline

I would like to run serverless offline using a Lambda function that points to a Docker image.
When I try to run serverless offline, I am just receiving:
Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
* hello-function: sample-app3-dev-hello-function
If I try to access http://localhost:3002/hello, a 404 error is returned
serverless.yml
service: sample-app3
frameworkVersion: '3'
plugins:
- serverless-offline
provider:
name: aws
ecr:
images:
sampleapp3image:
path: ./app/
platform: linux/amd64
functions:
hello-function:
image:
name: sampleapp3image
events:
- httpApi:
path: /hello
method: GET
app/myfunction.py
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': 'Hello World!'
}
app/Dockerfile
FROM public.ecr.aws/lambda/python:3.9
COPY myfunction.py ./
CMD ["myfunction.lambda_handler"]
at the moment such functionality is not supported in serverless-offline plugin. There's an issue open where the discussion started around supporting this use case: https://github.com/dherault/serverless-offline/issues/1324

How to eliminate serverless framework error Template format error

Testing, learning serverless framework. I'm trying to deploy simple/basic state machine with two simple lambda functions.
Serverless definition as follows:
frameworkVersion: '2'
app: state-machine
org: macdrorepo
service: state-machine
plugins:
- serverless-python-requirements
- serverless-iam-roles-per-function
- serverless-step-functions
- serverless-pseudo-parameters
custom:
pythonRequirements:
dockerizePip: non-linux
slim: true
zip: true
provider:
name: aws
runtime: python3.8
region: eu-central-1
stage: ${opt:stage, 'testing'}
timeout: 30
package:
individually: true
exclude:
- node_modules/**
- .git/**
- .venv/**
functions:
processpurchase:
module: state-machine
memorySize: 128
stages:
- testing
- dev
handler: ProcessPurchase.process_purchase
processrefund:
module: state-machine
memorySize: 128
stages:
- testing
- dev
handler: ProcessRefund.process_refund
stepFunctions:
validate: true
stateMachines:
TransactionChoiceMachine:
name: ChoiceMachineTest-${self:provider.stage}
dependsOn: CustomIamRole
definition:
Comment: "Purchase refund choice"
StartAt: ProcessTransaction
States:
ProcessTransaction:
Type: Choice
Choices:
- Variable: "$.TransactionType"
StringEquals: PURCHASE
Next: PurchaseState
- Variable: "$.TransactionType"
StringEquals: REFUND
Next: RefundState
PurchaseState:
Type: Task
Resource:
Fn::GetAtt: [processpurchase, Arn]
End: true
RefundState:
Type: Task
Resource:
Fn::GetAtt: [processrefund, Arn]
End: true
During deploy, sls is saying my state machine definition is ok: State machine "TransactionChoiceMachine" definition is valid
My environment information:
Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.20.0
Framework Version: 2.14.0
Plugin Version: 4.1.2
SDK Version: 2.3.2
Components Version: 3.4.3
Setup SLS_DEBUG=* is not helping me much as I do not know js unfortunately.
After serverless deploy command, I'm getting error:
Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [CustomIamRole] in the Resources block of the template
Looks like you are referencing something called CustomIamRole in your state machine creation but I cannot see it being created anywhere in the yaml file. Either create the role and use it in creation or remove the depends on part.

selenide.open attempt throws NoSuchMethodError

I'm trying to simply navigate to google page:
String url = "https://www.google.com";
Selenide.open(url);
and the exact exception thrown is:
java.util.stream.Collector com.google.common.collect.ImmutableList.toImmutableList()'
java.lang.NoSuchMethodError: 'java.util.stream.Collector com.google.common.collect.ImmutableList.toImmutableList()'
at org.openqa.selenium.chrome.ChromeOptions.asMap(ChromeOptions.java:292)
at org.openqa.selenium.MutableCapabilities.merge(MutableCapabilities.java:73)
at com.codeborne.selenide.webdriver.MergeableCapabilities.<init>(MergeableCapabilities.java:19)
at ...
I use Chrome 86.0.4240.111 (64-bit) and selenide 5.15.1
The point is that selenide is not compatible with test-ng, at least with this version mentioned in gradle
testCompile group: 'org.testng', name: 'testng', version: '7.3.0'
compile group: 'com.codeborne', name: 'selenide', version: '5.15.1'
Removing test-ng solved the problem

Codeception - " Curl error thrown for http POST to /session with params:"

first of all, sorry for my poor english.
I have a problem with the test automation.
I am a beginner. I have virtual box instance with my app, where is set a standard address with VirtualBox outside (192.168.56.101). I connect netbeans with this instance, and i have project with my app on this. And the last thing - I'm trying to biuld test automation for it.
Unfortunately, I have a problem,. Test is created, selenium started, PhantomJs also started. I go to the project folder, "codecept run" and...
acceptance.suite config:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
- \Helper\Acceptance
- Db:
dsn: 'mysql:host=localhost;dbname=xxx'
user: 'root'
password: 'xxx'
dump: 'tests/_data/dump.sql'
populate: true
cleanup: false
reconnect: true
config:
WebDriver:
url: 'http://xxx.app/'
browser: chrome
host: '192.168.56.101'
port: 22
window_size: 'maximize'
env:
phantom:
modules:
config:
- WebDriver:
browser: 'phantomjs'
Please help.

MobileFirst push notification- poll not works

I try to run the next simple code example on my mobilefirst 6.3 studio, and it doesn't works. It do nothing.
What am I missing?
WL.Server.createEventSource({
name: 'PushEventSource1',
poll: {
interval: 3,
onPoll: "test1"
}
});
function test1() {
WL.Logger.info(new Date() + ": test!");
}
I deploy it successfully:
[2015-02-09 10:23:02] Starting adapter deployment on MobileFirst Server
[2015-02-09 10:23:02] Starting build of adapter: PushAdapter
[2015-02-09 10:23:02] Deploying adapter: PushAdapter
[2015-02-09 10:23:02] Server host: 10.0.0.177
[2015-02-09 10:23:02] Server port: 10080
[2015-02-09 10:23:03] Adapter build and deploy finished.
If by "not working" you mean that you do not see the log line in the server log, then make sure that in Eclipse, in the Servers view > Server Configuration > Logging section, the "Console log info" option is set to INFO.