Ok. Some good news and some bad news. 

Tomcat 6.0.26 is now running as a Windows service. But I have a problem with
my application as follows:

SEVERE: Exception sending context initialized event to listener instance of
class visualRSS.initialisation.SchedulerContext_Listener
java.lang.NullPointerException
        at
visualRSS.initialisation.SchedulerContext_Listener.contextInitialized(Schedu
lerContext_Listener.java:59)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3972)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
91)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563
)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:519)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

The exception refers to the following code:

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.log4j.Logger;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerContext;
import org.quartz.impl.StdSchedulerFactory;
import visualRSS.database.Scheduler_Job_DB;
import visualRSS.entity_business_classes.Scheduler_Job;
import visualRSS.entity_misc_classes.SQLDateTime;
import visualRSS.scheduler.Poll_RSS_Feeds_ScheduleJob;
import visualRSS.scheduler.Update_Index_Page_Wordcloud_ScheduleJob;
import visualRSS.scheduler.Update_Visualisation_Recent_List_ScheduleJob;

public class SchedulerContext_Listener implements ServletContextListener {

    static final Logger logger =
Logger.getLogger(TestProgram_Listener.class.getName());

    Scheduler scheduler = null;
    ServletContext context = null;
    SchedulerContext schedulerContext = null;

    @Override
    public void contextInitialized(ServletContextEvent contextEvent) {
        JobDetail jd = null;
        CronTrigger ct = null;
        Scheduler_Job sj = null;
        SQLDateTime dateTimeNow = SQLDateTime.getSQLDateTimeNow();

        //
****************************************************************************
**************
        // ** GET SCHEDULER.
**
        //
****************************************************************************
**************

        try {
            scheduler = StdSchedulerFactory.getDefaultScheduler();
        }
        catch(Exception ex) {
            logger.error("Error getting scheduler at " + dateTimeNow + "\n",
ex);
        }

        //
****************************************************************************
**************
        // ** SUBMIT JOBS.
**
        //
****************************************************************************
**************

        // Poll_RSS_Feeds.
        try {
            sj = Scheduler_Job_DB.get(1);
            jd = new JobDetail(sj.getJobName(), Scheduler.DEFAULT_GROUP,
Poll_RSS_Feeds_ScheduleJob.class); // Requires class name to be hardcoded,
will not allow casting. Why?
            ct = new CronTrigger(sj.getJobQuartzTrigger(),
Scheduler.DEFAULT_GROUP, "" + sj.getJobQuartzCronExpression().trim() + "");
            scheduler.scheduleJob(jd, ct);
            System.out.println("Job " + sj.getJobName() + " submitted.");
        }
        catch(Exception ex){
            logger.error("Error submitting job " + sj.getJobName() + " at "
+ dateTimeNow + "\n", ex);
        }

Any suggestions would be welcome before I try to debug this. It does not
happen on a 32-bit seat.

-----Original Message-----
From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov] 
Sent: 17 Nov 2011 18 49
To: 'Tomcat Users List'
Subject: RE: Trying to get Tomcat 6 running as a Windows service

>-----Original Message-----
>From: app...@dsl.pipex.com [mailto:app...@dsl.pipex.com]
>Subject: Trying to get Tomcat 6 running as a Windows service
>
>Hello
>...  but I find that although
>Tomcat will start / stop via the batch files in the /bin folder, when 
>set as a Windows service, I get a message that:
>
>Windows could not start the service on the Local Computer.
>
>Have you any iseas at all?
>
>The Tomcat logs display nothing when the above happens.
>
>Martin O'Shea.
>

I run Windows 7.
I just downloaded Tomcat 6.0.26 from the archives, using this zip file:
http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0
.26-windows-x64.zip
I have the 64 bit Java sdk installed: jdk-6u29-windows-x64.exe  JAVA_HOME
environment variable is set.

When I issue from the command line:
 
service install Tomcat6 

... the service is created but not started.  When I start the service and
view http://localhost:8080 I get the Tomcat welcome page.

Perhaps you could try removing the windows service using:  

service remove Tomcat6  

and then try the install command a second time?

Leo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to