Hi!

I still have the same problem even if I succeed to implement the MBean. You can see below what I did exactly;the bold line is the business logic I need within my startup class...
BUT, I got the same exception.. It seems the MBean does not help either... Is the same classloader used for the MBean and for my FrameworkManager class (this is the business logic I need to start as startup class)?
 

I attach as well the exception I got:

-3.0.0/server/default/deploy/user-service.xml
00:55:30,965 INFO  [STDOUT] %%%%%%%%%%%%%%%%%%%%% here is the start of MBean
00:55:30,995 INFO  [STDOUT] FrameworkManager::getInstance ENTRY
00:55:31,005 INFO  [STDOUT] FrameworkManager::FrameworkManager ENTRY
00:55:31,005 INFO  [STDOUT] FrameworkManager::establishVendor ENTRY
00:55:31,005 INFO  [STDOUT] FrameworkManager::establishVendor EXIT
00:55:31,005 INFO  [STDOUT] FrameworkManager::bootStrap ENTRY
00:55:31,015 INFO  [STDOUT] FrameworkManager::bootStrap frameworkDirectory is: C
:\_kkt\build
00:55:31,015 INFO  [STDOUT] FrameworkManager::bootStrap frameworkConfigDirectory
 is: C:\_kkt\config
00:55:31,035 INFO  [STDOUT] [FrameworkManager] 4 framework service(s) located
00:55:31,035 INFO  [STDOUT] inFileList[0] is: framework\config\ConfigService.cla
ss
00:55:31,035 INFO  [STDOUT] inFileList[0] post process is: framework.config.Conf
igService
00:55:31,035 INFO  [STDOUT] inFileList[1] is: framework\dbconnection\DbConnectio
nService.class
00:55:31,035 INFO  [STDOUT] inFileList[1] post process is: framework.dbconnectio
n.DbConnectionService
00:55:31,035 INFO  [STDOUT] inFileList[2] is: framework\jndi\JNDIService.class
00:55:31,035 INFO  [STDOUT] inFileList[2] post process is: framework.jndi.JNDISe
rvice
00:55:31,035 INFO  [STDOUT] inFileList[3] is: framework\logging\LogService.class

00:55:31,035 INFO  [STDOUT] inFileList[3] post process is: framework.logging.Log
Service
00:55:31,035 INFO  [STDOUT] location of logging was: 3
00:55:31,045 INFO  [STDOUT] [FrameworkManager] initializing service  0 : framewo
rk.logging.LogService
00:55:31,045 INFO  [STDOUT] #################### framework.logging.LogService
00:55:31,095 ERROR [MainDeployer] could not start deployment: file:/C:/jboss-3.0
.0/server/default/deploy/user-service.xml
java.lang.ExceptionInInitializerError:
java.lang.NullPointerException
        at org.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.jav
a:379)
        at org.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigur
ator.java:308)
        at org.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:25
2)
        at org.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:28
0)
        at org.log4j.Category.<clinit>(Category.java:108)
        at framework.logging.LogService.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:120)
        at framework.manager.FrameworkManager.bootStrap(Unknown Source)
        at framework.manager.FrameworkManager.<init>(Unknown Source)
        at framework.manager.FrameworkManager.getInstance(Unknown Source)
        at startup.Startup.start(Startup.java:24)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:894)
        at $Proxy6.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:340)

Here is the source code for the MBean
 

package startup;
public interface StartupMBean {

 //following are the service methods which needs to be implemented
 //and are called by the JBoss container
 //When server starts, first init is called and then start is called
 //write code in start to do implement any startup functionality
 public abstract void init() throws Exception;
 public abstract void start() throws Exception;

 //When server stops, first stop is called and then destroy is called
 //write code in stop to do implement any cleanup functionality
 public abstract void stop() throws Exception;
 public abstract void destroy() throws Exception;
}

package startup;
//import org.jboss.util.*; //from jboss.jar
import javax.management.*; //from jmxri.jar
import framework.manager.FrameworkManager;

public class Startup implements MBeanRegistration, StartupMBean {

 public Startup() {
 }
 //the ObjectName returned is important and is to be given exactly
 //in jboss.jcml file
 public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception {
   return new ObjectName(":service=Startup");
 }

 public void postRegister(java.lang.Boolean registrationDone) {}
 public void preDeregister() throws java.lang.Exception { }
 public void postDeregister() {}
 public void init() throws Exception { }

 public void start() throws Exception {
   //write custom code here to do implement any startup functionality
System.out.println("%%%%%%%%%%%%%%%%%%%%% here is the start of MBean");
FrameworkManager fm = FrameworkManager.getInstance();

 }
 public void stop() throws Exception {
   //write custom code here to do implement any cleanup functionality
 }
 public void destroy() throws Exception {}
 }

Thanks a lot,
 florin

Reply via email to