Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute #213

Closed
SushanSuresh opened this Issue Feb 1, 2018 · 8 comments

Comments

4 participants
@SushanSuresh
Copy link

SushanSuresh commented Feb 1, 2018

Hi Team,

I am running cucumber report published as a pipeline step. I am getting this intermediate error

"Caused: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration"

I am unable to reproduce it manually, but some time this error pops up, even though there is no change in infrastructure (plugin version, O.S).

Could you please help to identify where it might be going wrong.

Thanks in advance.......

Pipeline Step

step([
$class : 'CucumberReportPublisher',
fileExcludePattern : "",
fileIncludePattern : "cucumber.json",
ignoreFailedTests : false,
jenkinsBasePath : '',
jsonReportDirectory : '',
missingFails : false,
parallelTesting : false,
pendingFails : false,
skippedFails : false,
undefinedFails : false,
])

Platform Details

Jenkins Version : 2.89
Cucumber Plugin Version : 3.10.1
O.S : Red Hat Enterprise Linux Server release 7.4 (Maipo) (x86_64)

@damianszczepanik

This comment has been minimized.

Copy link
Member

damianszczepanik commented Feb 4, 2018

Does it come from the plugin?

@SushanSuresh

This comment has been minimized.

Copy link
Author

SushanSuresh commented Feb 5, 2018

I suspect that, but I am not sure which other software this plugin is looking for to start the ".velocity.runtime.log.Log4JLogChute." So I thought of seeking the help here to understand the gap I have. whether it is with this plugin version or something else

@mstave

This comment has been minimized.

Copy link

mstave commented Feb 23, 2018

with 3.11.0 using a declarative pipeline with

 cucumber buildStatus: 'UNSTABLE', failedStepsNumber: 1, fileIncludePattern: "${args.cukeGlob}", jsonReportDirectory: '.', parallelTesting: true

seeing this error. The previous run of the job worked fine without changes to job. I ran the json through a validator and it looks fine.

17:20:42 [CucumberReport] Processing 1 json files:
17:20:42 [CucumberReport] /var/jenkins_home/jobs/ [ more path ]/cucumber-report.json
...

org.apache.velocity.exception.VelocityException: The specified logger class org.apache.velocity.runtime.log.Log4JLogChute does not implement the org.apache.velocity.runtime.log.LogChute interface.
    at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:181)
Caused: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
    at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:220)
    at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269)
    at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871)
Caused: org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
    at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:875)
    at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262)
    at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646)
    at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)
    at net.masterthought.cucumber.generators.AbstractPage.<init>(AbstractPage.java:52)
    at net.masterthought.cucumber.generators.ErrorPage.<init>(ErrorPage.java:18)
    at net.masterthought.cucumber.ReportBuilder.generateErrorPage(ReportBuilder.java:230)
    at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:103)
    at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:284)
    at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:219)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
    at hudson.security.ACL.impersonate(ACL.java:260)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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)
Finished: FAILURE
@damianszczepanik

This comment has been minimized.

Copy link
Member

damianszczepanik commented Feb 26, 2018

There is pull request for this damianszczepanik/cucumber-reporting#693

@mstave

This comment has been minimized.

Copy link

mstave commented Mar 20, 2018

@damianszczepanik do you know how we can get the PR merged? Is there a workaround?

@damianszczepanik

This comment has been minimized.

Copy link
Member

damianszczepanik commented Mar 21, 2018

take over and complete the PR

@aravinder111

This comment has been minimized.

Copy link

aravinder111 commented Apr 26, 2018

Hi @damianszczepanik
We built the plugin with fix damianszczepanik/cucumber-reporting#717 and started using, but we still see the same errors as mentioned by @mstave above. So the next release of plugin may not fix this issue.

From the stack trace I noticed that there is an exception in try block and while handling this exception on line 104, its throwing second exception trying to generateErrorPage here

In the initial PR by @AndyGee , he modified code to throw an exception and that's now sitting in PR damianszczepanik/cucumber-reporting#718. If the second exception(generateErrorPage) is fixed, we might be able to see the first exception thrown in error page.

Do you think if setting velocityEngine properties explicitly would solve the second exception ?

CC: @docwhat

@mstave

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.