掲示板

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

7年前 に Damien Guillermet によって更新されました。

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

Junior Member 投稿: 44 参加年月日: 15/07/09 最新の投稿
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
7年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14918 参加年月日: 06/09/02 最新の投稿
Check in gogo what the status is. Likely it is not "started". Start the component and see what it reports.
7年前 に Damien Guillermet によって更新されました。

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

Junior Member 投稿: 44 参加年月日: 15/07/09 最新の投稿
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)"
7年前 に Damien Guillermet によって更新されました。

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

Junior Member 投稿: 44 参加年月日: 15/07/09 最新の投稿
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>