Getting java.lang.IllegalStateException: Resource resolver is already closed. error for JUNIT5 in aem servlet - aem

I am getting an exception when running a JUNIT5 code for a AEM servlet where the resource resolver is fecthed from AEM context and used, JUNIT gives proper response, but at the end am getting
javax.jcr.RepositoryException: Session is logged out / not live.java.lang.IllegalStateException: Resource resolver is already closed.
at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:202)

Related

Hi, I am currently upgrading wicket application from 1.5.3 to 6.30.0 but i am getting error and login page is not getting instantiated

org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.ecs.test.web.page.Login()'. An exception has been thrown during construction!
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194)
Caused by: java.lang.NoClassDefFoundError: javax/inject/Inject
at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.supportsField(AnnotProxyFieldValueFactory.java:324)
at org.apache.wicket.injection.Injector.findFields(Injector.java:148)
it might help tring to add Objenesis lib to your project dependencies. Wicket CI checks if this lib is available and if so, it's used to build proxy objects even if they don't provide a no args (i.e. Default) constructor.

Meet Error when run Spring MVC web application, " Servlet [mvc-dispatcher] in web application threw load() exception java.lang.ClassNotFoundException"

Hello I was trying to build a simple spring MVC project but when I am running my code I am getting: Hello I am new to spring and I was trying to build a simple spring MVC project but when I am running my code I am getting: Servlet [mvc-dispatcher] in web application threw load() exception java.lang.ClassNotFoundException
I run it in Eclipse + TomCAt 9.0
It sounds like you're missing some jar(s). Note the specific class that you're missing, then google the jar that it belongs in, download it and add it to your project.

Bean Creation Exception when I run Liferay module

I get Bean Creation Exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'counterHibernateSessionFactory' defined in class path resourc
e [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'counterData
Source' while setting bean property 'dataSource'; nested exception is org.spring
framework.beans.factory.BeanCreationException: Error creating bean with name 'co
unterDataSource' defined in class path resource [META-INF/counter-infrastructure
-spring.xml]: Cannot resolve reference to bean 'counterDataSourceImpl' while set
ting bean property 'targetDataSource';
I am trying to run a liferay module on a tomcat server.I use Eclipse Luna, tomcat server 8.0.32, liferay 7.0 ga3.I searched for helpful information, didn't find any to solve the problem.Thank you!
I solved this, the problem was that I didn't have Gradle IDE incorporated and also I was trying to run the module directly on my server, but firstly I had to build it with gradle.Now I am deploying my liferay modules on serves by going to the root path of the module and applying the command with blade cli: blade deploy.

BeanCreationException Vaadin

I'm trying to integrate Spring Boot Vaadin (https://github.com/peholmst/vaadin4spring) with Vaadin's Dashboard Demo Code (https://github.com/vaadin/dashboard-demo). The only thing modification I made was add the annotation "#VaadinUI" in the DashboardUI class. I checked in my code using the branch "integrate-vaadin-dashboard-demo-project".
I get the error message:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider.
I'm not really sure what the message means. Can somebody explain it and come up with a resolution to the error message?
Gist Error Output:
https://gist.github.com/anonymous/43d602c1105e00d4d7d6
Clone Url:
https://github.com/caritos/pangolin.git
Branch:
integrate-vaadin-dashboard-demo-project
You pack javax validation api 1.0 in your jar. This is the version the GWT compiler needs (when you build a widgetset). But spring-boot depends on version 1.1. Usually the problem is the other way around...

javax.servlet.ServletException: PWC1391: Servlet.init() for servlet <project>.webservice.ApplicationConfig threw exception

What could be the cause for this error while running my Java EE 6 app from embedded container using Eclipse?
HTTP Status 500 -
type Exception report
message
description: The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: PWC1391: Servlet.init() for servlet <project>.webservice.ApplicationConfig threw exception
root cause
com.sun.jersey.spi.inject.Errors$ErrorMessagesException
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.
Edit: Basically since I ran it successfully, I upgraded eclipse and made some changes in project (refactor/renaming variables) and svn repository setup.
Have you tried the suggestions Google produces when you search for PWC1391? Namely resolving potential version conflicts with the Jersey library (i.e. removing it from project).
Finally figured out that there were some libraries missing...including Glassfish 3.1.2 being the major one from "Web"'s "Java Build Path > Libraries".