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

Error creating bean with name 'pluginManager' defined in ServletContext resource #1112

Closed
jakkarth opened this issue Jun 11, 2019 · 6 comments

Comments

@jakkarth
Copy link
Contributor

Using version 0.8.7-hotfix1, Tomcat 7.0.94

I'm seeing a crash on startup:

tomcat_1 | 2019-06-11 22:21:42,904 [localhost-startStop-1] ERROR context.ContextLoader - Context initialization failed
tomcat_1 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
tomcat_1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
tomcat_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
tomcat_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
tomcat_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
tomcat_1 | at java.lang.Thread.run(Thread.java:748)
tomcat_1 | Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object

Application is not accessible.

@jmiranda
Copy link
Member

Thanks. This is a build issue I've seen in the past, but have no idea why it happens. I'll check the war file and rebuild if necessary. I should be able to get this done tonight or early tomorrow.

I'll also try to add a validation step (similar to the one in this bash script) to our CI pipeline to avoid this in the future. https://github.com/openboxes/openboxes-docker/blob/master/openboxes-run.sh

@jmiranda
Copy link
Member

@jakkarth Actually, this is not a Grails build error. I downloaded the openboxes.war from the Release page and found that the applicationContext.xml is, in fact, there.

$ jar -xvf openboxes.war | grep applicationContext
 inflated: WEB-INF/applicationContext.xml

I think this is the error one encounters when you're using a version of Tomcat compiled with Java 8 or when you're running Java 8 on your machine. However, this seems odd since you're using docker and should be pointing to the right images. Has anything changed in your environment recently?

@jakkarth
Copy link
Contributor Author

I did upgrade to a new version of Tomcat 7, but it's 7.0.94, still a 7 version just like I was running before. I've just rolled back to 7.0.93 and it works again. Rolling forward to 7.0.94 results in the error returning. I'm not well versed enough in Tomcat to understand what the differences are.

@jmiranda
Copy link
Member

Yeah it depends on who is maintaining that docker image, I guess. I see on Docker Hub (https://hub.docker.com/_/tomcat) that the same image was tagged as 7.0.94-jdk8, 7.0-jdk8, 7-jdk8, 7.0.94, 7.0, 7 (7/jdk8/Dockerfile). So I think it's safe to say that one is compiled with jdk8. Try 7.0.94-jdk7 to see if that fixes it.

@jmiranda
Copy link
Member

Maybe this one 7.0.94-jre7-alpine?

@jakkarth
Copy link
Contributor Author

7.0.94-jre7-alpine seems to work ok. I didn't realize that the tomcat version wasn't tied to the jre version, but I guess that makes sense. I'll stick with this and keep an eye on the jre version in the future. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants