Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8175177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:40:56+00:00 2026-06-06T22:40:56+00:00

I am trying to run Spring via Daemon service as stand alone application ofcourse.

  • 0

I am trying to run Spring via Daemon service as stand alone application ofcourse.

I have configured run.sh script and added to it all Spring jars framework.

Now i am trying to execute my starting point class from the Daemon classes this way:

Code:
public class FeedDaemon implements Daemon
{
public FeedDaemon()
{
}

protected final static Logger log = LoggerFactory.getLogger(FeedDaemon.class);
protected boolean shouldBeRunning = false;
protected ProviderFactory runner = null;

@Override
public void destroy()
{
    runner = null;
}

@Override
public void init(DaemonContext arg0) throws Exception
{
    runner = new ProviderFactory();
}

public void start() throws RuntimeError, ConfigError
{
    log.info("Starting daemon");
    runner.start();
}

public void stop() throws Exception
{
    log.info("Starting Shutting daemon ...");
    runner.stop();
}

}

Code:

package com.spring.test;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.spring.aspect.Spring3HelloWorld;
import com.spring.beans.ParkingCar.CarBean;
import com.spring.beans.ParkingCar.CarMaker;
import com.spring.beans.ParkingCar.FourWheelsVechile;
import com.spring.beans.ParkingCar.TwoWheelsVechile;
import com.spring.beans.ParkingCar.Vechile;
import com.spring.beans.ParkingCar.VechileDetails;
import com.spring.beans.calculator.CalculateNumbersHolderBean;
import com.spring.beans.calculator.CalculateStrategyBean;
import com.spring.beans.calculator.CalculatorBean;

public class Spring3HelloWorldTest
{

    static Logger logger = Logger.getLogger(Spring3HelloWorldTest.class);

    public static void execute()
    {
        try
        {   
            ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
            logger.debug("3");


            Vechile fourWheelsVechile = (FourWheelsVechile) context.getBean("Ambulance");
            fourWheelsVechile.drive();
            CarMaker carMaker = (CarMaker) context.getBean("carMaker");
            CarBean carBean = carMaker.createNewCar();
            carBean.driveCar();
        }
        catch (Throwable e)
        {
            logger.error(e);
        }

    }
}

And I get this error:

java.lang.reflect.InvocationTargetException
    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.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:164)
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
    at com.spring.runner.FeedDaemon.init(FeedDaemon.java:37)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 6 more
Cannot load daemon
Service exit with a return value of 3

thats my run.sh script:

export JAVA_HOME=/../
FIXGW=/../FIXGW
CLASSPATH=$FIXGW/lib/FeedHandler.jar:$FIXGW/lib/FixSpring.jar:$FIXGW/lib/org.springframework.web-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.web.struts-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.web.servlet-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.web.portlet-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.test-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.orm-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.jms-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.jdbc-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.context.support-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.aspects-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.transaction-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.oxm-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.instrument-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.instrument.tomcat-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.expression-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.core-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.context-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.beans-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.asm-sources-3.1.1.RELEASE.jar:$FIXGW/lib/org.springframework.aop-sources-3.1.1.RELEASE.jar:$FIXGW/lib/commons-daemon-1.0.3.jar

cd $FIXGW
/../jsvc -user fox \
-XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:SurvivorRatio=16 \
-Dlog4j.configuration=file:$FIXGW/conf/log4j.properties \
-outfile /dev/null \
-errfile $FIXGW/logs/error.log \
-verbose -classpath $CLASSPATH \
com.spring.runner.FeedDaemon

Any idea?

thanks,
ray.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:40:58+00:00Added an answer on June 6, 2026 at 10:40 pm

    spring jars are not in classpath. Check this my answer. Add all libraries in classpath via command line(ofcourse in your shell script).

    Well I see your problem now. You have source files in classpath. Those are mentioned as org.springframework.web.servlet-sources-3.1.1.RELEASE.jar while compiled jars are mentioned as org.springframework.web.servlet-3.1.1.RELEASE.jar

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run my web application using Spring, Hibernate and Apache Tiles. It
I'm trying to run a command via command prompt from an ASP.Net web application.
When trying to run my perl script via cmd prompt my json string is
I'm trying to run tests for my webapp. I've used Spring and Hibernate for
Trying to run my program in FreeBSD OS, I have the following results: $
I am trying to add to my application some icons via the code. When
I'm trying to run a webmethod via a jQuery which will query an SQL
I'm trying to run R using Java. I have R installed on my Mac
I am trying to access textalertapp.com via HTTP Post request from my android application.
I have an application where I am rendering a SSRS report via the SOAP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.