Murad,
I've noted in the past that when launching applications using jsrvany
(another Java-NT Service tool) the context ClassLoader for the main
thread isn't set leading to ClassNotFoundException's.
What does Thread.currentThread().getContextClassLoader() return for you?
Is it the same when launching via javaserv as launching from the command
line?
If you find the class loader is null I'd suspect javaserv has similar
problems to jsrvany. Before your stopper.start() in the code below what
happens if you set the class loader explicitly as follows:
ClassLoader cl = ClassLoader.getSystemClassLoader();
stopper.setContextClassLoader(cl);
Regards,
Calvin.
----- Original Message -----
From: "Meghani, Murad" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 31, 2001 4:42 AM
Subject: Stopping JOnAS.
> Hi:
> I am having a small dillema when trying to stop JOnAS. The scenerios
are as
> follows:
> 1. I am running JOnAS as a Server from the command line where I am
setting
> the CLASSPATH to %JONAS_ROOT%\lib\JEREMIE_jonas.jar and sending the
> following to the JVM
> -Djava.naming.factory.initial=org.objectweb.jeremie.libs.services.regi
stry.j
> ndi.JRMIInitialContextFactory
> (I am running JEREMIE!). It runs fine and when I do CTRL-C it stops
JOnAS
> perfectly.
>
> 2. In this scenerio I am running the JOnAS as an NT Service using the
> javaserv (http://www.kcmultimedia.com/javaserv/). The wrapper class I
have
> written utilizes the same server class in the above scenerio. When I
try to
> stop the JOnAS service I get the following error:
>
> javax.naming.NoInitialContextException: Cannot instatiate class:
> org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextF
> actory [Root exception is java.lang.ClassNotFoundException:
>
org/objectweb/jeremie/libs/services/registry/jndi/JRMIInitialContextFact
ory]
>
> I have checked to ensure that the CLASSPATH and the
> java.naming.factory.initial are correctly set and sent to the JVM.
>
> The stopping method code follows:
>
> public static void stopJOnAS(
> )
> {
> Log.getInstance().debug("Stop JOnAS...");
>
> // stop jonas from a new thread giving this method a chance
> // to complete before the main thread.
> Thread stoper = new Thread(){
> public void run() {
> String admName = JONAS_NAME + Adm.ADMNAME_SUFFIX;
> try
> {
> InitialContext initialContext = new InitialContext();
> AdmInterface admI = (AdmInterface)
> initialContext.lookup(admName);
> admI.stopServer();
> Log.getInstance().debug("JOnAS stopped.");
> }
> catch (Exception e)
> {
> System.err.println ("JonasServer.stopJOnAS : " + e);
> }
> }
> };
> stopper.start();
> }
>
> Any help in this will be highly appreciated.
>
> Thanks in advance.
>
> Murad Meghani
> Consultant
> Compuware Corporation
> 15305 Dallas Parkway, Suite 900
> Addison, Texas, 75001
> 972-960-0960 x1379
> www.compuware.com
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
>
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".