Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Micael Ericsson
Scheduler not sending jobs
September 21, 2017 7:26 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Hi Neil

I'll look into replacing on LiferayFacesContext. Thanks for the information.

Another problem has occured. I am not sure it't related to new versions of liferay faces libs but thats the only I have changed (I thinkemoticon).
I have a scheduler-portlet which triggers a send sms/email function. From 1st of september this portlet has stopped working. No new send jobs have been created since that date. Below is settings in liferay.portlet.xml.

Since we are one week from release date this has high prio for us. Can you see if anything with liferay faces built can affect scheduler event?

 1<portlet>
 2        <portlet-name>Utskick</portlet-name>
 3        <scheduler-entry>
 4          <scheduler-description>utskick-scheduler</scheduler-description>
 5          <scheduler-event-listener-class>se.trm.utskick.UtskickJob</scheduler-event-listener-class>
 6          <trigger>
 7            <!--simple>
 8                <simple-trigger-value>12</simple-trigger-value>
 9                <time-unit>hour</time-unit>
10            </simple-->
11            <!--
12            Se http://quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger för beskrivning av
13            syntaxen för det cronjob som Liferay använder.
14            Värdet nedan betyder var 10e minut 8-17
15            0 0/10 8-17 * * ?
16            -->
17            <cron>
18                <cron-trigger-value>0 0/10 8-17 * * ?</cron-trigger-value>
19            </cron>
20          </trigger>
21       </scheduler-entry>
22       <private-session-attributes>false</private-session-attributes>
23    </portlet>
Neil Griffin
RE: Scheduler not sending jobs
September 21, 2017 11:12 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Hi Micael,

I split the thread since this is technically a separate question.

Normally we try to focus on JSF specific issues in the Liferay Faces forum, but we would be happy to take a look -- please provide an SSCCE that would help us reproduce the issue (preferable a Maven-based project).

Thanks,

Neil
Micael Ericsson
RE: Scheduler not sending jobs
September 22, 2017 12:42 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Hi Neil

Portlet name is SchedulerTest. (Ignore old TestPortlet). I've been able to reproduce working scheduler and not working scheduler portlet, only by building with different versions of liferay faces libs.
Included zip has 3 versions of pom.xml:
  • pomR15.xml. Working version with older liferay faces libs (including special TRM-version)
  • REALEASEpom.xml. Version with release build of liferay faces. Not working.
  • SNAPSHOTpom.xml. Version with snapshot build of liferay faces. Not working.

Included is also special TRM-lib which is needed to build with pomR15. Current pom.xml is a copy of R15pom.xml - latest try.

Since I have today and monday before release I will build release with R15 setup. But I will continue to test and evaluate your suggestions and when it's working we will have another release.
Attachments: Root_scheduler_20170922.zip (81.3k), com.liferay.faces.bridge.impl-4.0.1-TRM.jar (483.4k)
Neil Griffin
RE: Scheduler not sending jobs
September 22, 2017 10:11 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Hi Micael,

Thank you for providing the reproducer. Note that I had to make the following changes in order to get SchedulerPortlet to build and deploy correctly:

- Added missing module to portlets/pom.xml which prevented the portlet from building:

<module>SchedulerTest</module>

- Added missing descriptor: portlets/SchedulerTest/src/main/webapp/WEB-INF/faces-config.xml

- Added missing dependency from portlets/SchedulerTest/pom.xml since PRIMEFACES_MOBILE renderKitId is specified:

<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
</dependency>

- Added missing XHTML file due to the following error on render:
15:36:54,526 ERROR [ExternalContextCompat_2_0_Impl:491] Status code 404: /views/utloggadIntro.xhtml Not Found in ExternalContext as a Resource

- Removed non-functioning util-slf4j.jar from src/main/webapp/WEB-INF/liferay-plugin-package.properties

- It its place, addeddependency in portlets/SchedulerTest/pom.xml which was preventing output of logger messages to the console:

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>

- Moved log4j.xml from incorrect src/test/resources to src/main/resources which was preventing output of logger messages to the console:

mv ./portlets/SchedulerTest/src/test/resources/log4j.xml portlets/SchedulerTest/src/main/resources

These changes can be found in the attached Root.zip archive.

I tried it with Liferay Portal 6.2.5 CE GA4 and I am happy to report that the scheduler worked correctly with the recently released Liferay Faces jars. emoticon

Note that I built it with the Java 1.8 JDK and ran with the Java 1.8 JRE. It also worked when I built it with the Java 1.7 JDK and ran with the Java 1.7 JRE.

Kind Regards,

Neil
Attachments: Root.zip (59.0k)
Micael Ericsson
RE: Scheduler not sending jobs
September 25, 2017 1:25 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Hi Neil

Thank you for taking the time to correct my sloppy work. I built SchedulerTest from NetBeans and it worked so I thought, wrongly, that the structure should hold. Time pressure of coming release I guessemoticon.

Testing your supplied Root-structure, building with maven, worked fine. Deploying and testing SchedulerTest also worked fine. Something strange here since this didn't work last time. It could be a NetBeans related problem since I had similar build problem with the "memory" issue.

But still my real scheduler portlet doesn't work. And that portlet is built with maven. This week is occupied with release and other stuff. The release will be done with last working version och liferay faces. This is unfortunately but there is no time to analyze, fix and test whats wrong at the moment. When I am back next wednesday I will compare real and test scheduler portlet in order to figure out whats wrong.

Regards,
Micael
Micael Ericsson
RE: Scheduler not sending jobs
November 6, 2017 3:47 AM
Answer

Micael Ericsson

Rank: Regular Member

Posts: 157

Join Date: December 11, 2012

Recent Posts

Hi Neil

Finally I had some time to look at this problem.
I compared working SchedularTest with not working Utskick portlet.
Pretty quick I noticed that configuration file faces-config.xml was missing in our Utskick portlet. Adding this fil, rebuilding and testing - now it's working. When this file disappeared or if it's never been there I don't. But it's working now so this issue can ble closed.

Thanks again for taking time to help me with test portlet.

Regards,
Micael
Neil Griffin
RE: Scheduler not sending jobs
November 6, 2017 7:23 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Hi Micael,

It was my pleasure to help. Thanks for letting us know that it is working for you now.

Kind Regards,

Neil

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!