Foros de discusión

Module login post action not started when servlet-api is added

Damien Guillermet, modificado hace 7 años.

Module login post action not started when servlet-api is added

Junior Member Mensajes: 44 Fecha de incorporación: 9/07/15 Mensajes recientes
Hello!

following the example of blade.lifecycle.loginpreaction I created a project with Maven.
Everything works fine when I do nothing special in processLifecycleEvent method: bundle is started as expected.

However when I add javax servlet and portlet api in Maven POM dependencies in order to use this code in previous method :
final User user = PortalUtil.getUser(lifecycleEvent.getRequest());

Then when I deploy my JAR in Liferay it seems to be processed by the AutoDeployScanner but nothing more is happening (no start, no error log).

Is anybody know what is going wrong here? emoticon

Best regards,
Damien.
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Module login post action not started when servlet-api is added

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Check in gogo what the status is. Likely it is not "started". Start the component and see what it reports.
Damien Guillermet, modificado hace 7 años.

RE: Module login post action not started when servlet-api is added

Junior Member Mensajes: 44 Fecha de incorporación: 9/07/15 Mensajes recientes
Hello David,

the module raised a BunbldeException. The cause is:
Unresolved requirement: Import-Package: com.liferay.portal.kernel.util; version="[7.16.0,8.0.0)"
.

I removed all com.liferay.portal.kernel.util.* import from my code. Changing the previous code line by :
final User user = (User) lifecycleEvent.getRequest().getSession().getAttribute("USER");
and it works. So it's a workaround but I don't know if it's the best solution?

Edit : I also have this issue when I invoke com.liferay.portal.kernel.theme.ThemeDisplay in my code :
Unresolved requirement: Import-Package: com.liferay.portal.kernel.theme; version="[1.1.0,2.0.0)"
Damien Guillermet, modificado hace 7 años.

RE: Module login post action not started when servlet-api is added

Junior Member Mensajes: 44 Fecha de incorporación: 9/07/15 Mensajes recientes
I figured out the problem so I post workaround for community:
I Maven POM the version of liferay portal kernel dependency has to be 2.0.0 (and not 2.X.0 even if 2.21.0 is currently available on Maven central repo).

So :

		<dependency>
		    <groupid>com.liferay.portal</groupid>
		    <artifactid>com.liferay.portal.kernel</artifactid>
		    <version>2.0.0</version>
		    <scope>provided</scope>
		</dependency>