You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Nelson A. Perez" <ne...@yahoo.com> on 2006/02/13 21:17:26 UTC

Re: CGLIB Related error (Full Code)

Hi Aaron,


 Thanks for your reply. You are right, it seems not to
be a CGLIB-related issue. Anyway, here is the full
code for the project I am working on:



********************************************************************************************************



package mytask;

import java.lang.*;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.kernel.jmx.JMXUtil;
//import EDU.oswego.cs.dl.util.concurrent.*;
import
org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;


/**
 * Class MyGBean
 */

public class MyGBean implements GBeanLifecycle {
     
    private static Log log =
LogFactory.getLog(MyGBean.class);
    private static final GBeanInfo GBEAN_INFO;
    private final ObjectName objectName;              
          	    
    private MyThreadPool Pool;
   	private APrinterGBean APrinter;
    private BPrinterGBean BPrinter;   
    private boolean started = false;
                      
    static {
    	        
		GBeanInfoBuilder infoFactory =
GBeanInfoBuilder.createStatic (MyGBean.class,
NameFactory.GERONIMO_SERVICE);
		
        // attributes
        infoFactory.addAttribute("objectName",
String.class, false);               
                
        // references           
       
infoFactory.addReference("Pool",MyThreadPool.class,NameFactory.GERONIMO_SERVICE);
       
infoFactory.addReference("APrinter",APrinterGBean.class,NameFactory.GERONIMO_SERVICE);
       
infoFactory.addReference("BPrinter",BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
 
         
                               
        // operations               
        infoFactory.addOperation("runPrinterA");
        infoFactory.addOperation("runPrinterB");
        infoFactory.addOperation("stopPrinters");
        //infoFactory.addOperation("getPool");
                
        infoFactory.setConstructor(new
String[]{"objectName"});               
               
        //pool = new PooledExecutor(10);              
 
        GBEAN_INFO = infoFactory.getBeanInfo();
    }


	public void setPool( MyThreadPool Pool  ) {
        this.Pool = Pool;              
    }
   
 	public void setAPrinter( APrinterGBean APrinter ) {
        this.APrinter = APrinter;              
    }
    
    public void setBPrinter( BPrinterGBean BPrinter )
{
        this.BPrinter = BPrinter;              
    }      
    

    /**
     * Constructor MyGBean
     *
     * @param name
     @param objectName
     */
     public MyGBean(String objectName ) {    	
        this.objectName =
JMXUtil.getObjectName(objectName);                    
                          
    }
    
    /**
     * Method doFail
     */
    public void doFail() {
    	System.out.println( objectName + "  failed");
        log.info("My GBean has failed");
    }

    /**
     * Method doStart
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStart() throws WaitingException,
Exception {
    	started = true;
    	System.out.println("GBean: " + objectName + " has
started");
        log.info("My GBean has started");
        log.info(objectName);
        log.info( "bean1 = " + APrinter);
        log.info( "bean2 = " + BPrinter);  	
        log.info( "bean3 = " + Pool);
        runPrinterA();
        runPrinterB();                                
                                                      
                       
        //log.info( "Pool size is = " +
pool.getPoolSize() );       
    }


    /**
     * Method doStop
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStop() throws WaitingException,
Exception {    	
        log.info("MyGBean has stopped");   
        
    }

    public void stopPrinters(){
    	started = false; //this will stop the printers   
	
    	log.info("stopPrinters invocation!!!");
    }

   

    /**
     * @return Returns the thread pool.
     */    
           
    /*public MyThreadPool getPool() {
        return Pool;
    }*/ 
  
    public void runPrinterA(){
	//Run printer A in its own thread
								
		/*try{						
			pool.execute( new Runnable() {
            	public void run() {
                	while (started) {                    
                  
                			APrinter.print(); 
                	}	
            	}
        	});
		}catch(java.lang.InterruptedException e ){
			System.out.println("I/O exception while running
thread");
		}*/	
		        
    }
    
    
    public void runPrinterB(){
	//Run printer B in its own thread	
	
	  /*try{
						
			pool.execute( new Runnable() {
            	public void run() {
                	while (started) {                    
                  
                			BPrinter.print(); 
                	}	
            	}
        	});
	  }catch(java.lang.InterruptedException e ){
			System.out.println("I/O exception while running
thread");
	  }	*/
							
    }


     /**
     * Method getGBeanInfo
     *
     * @return
     */
    public static GBeanInfo getGBeanInfo() {
        return GBEAN_INFO;
    }
 

}	

********************************************************************************************************

package mytask;

import java.lang.*;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.geronimo.pool.ThreadPool;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.kernel.jmx.JMXUtil;
import EDU.oswego.cs.dl.util.concurrent.*;
import
org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;


/**
 * Class MyThreadPool
 */

public class MyThreadPool implements GBeanLifecycle {
     
    private static Log log =
LogFactory.getLog(MyGBean.class);
    private static final GBeanInfo GBEAN_INFO;
    private final ObjectName objectName;              
       
    static private PooledExecutor threadPool;
   	//private APrinterGBean APrinter;
    //private BPrinterGBean BPrinter;       
                      
    static {
    	        
		GBeanInfoBuilder infoFactory =
GBeanInfoBuilder.createStatic (MyThreadPool.class,
NameFactory.GERONIMO_SERVICE);
		
        // attributes
        infoFactory.addAttribute("objectName",
String.class, false);
                       
        // references           
       
//infoFactory.addReference("APrinter",APrinterGBean.class,NameFactory.GERONIMO_SERVICE);
       
//infoFactory.addReference("BPrinter",BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
         
                               
        // operations               
        //infoFactory.addOperation("run");        
        //infoFactory.addOperation("stop");
        //infoFactory.addOperation("getThreadPool");
                
        infoFactory.setConstructor(new
String[]{"objectName"});               
                
        threadPool = new PooledExecutor(10);          
     
        
        GBEAN_INFO = infoFactory.getBeanInfo();
    }

   
 	/*public void setAPrinter( APrinterGBean APrinter )
{
        this.APrinter = APrinter;              
    }
    
    public void setBPrinter( BPrinterGBean BPrinter )
{
        this.BPrinter = BPrinter;              
    }*/      

  
    /**
     * Constructor MyThreadPool
     *
     * @param name
     @param objectName
     */
     public MyThreadPool(String objectName ) {    	
        this.objectName =
JMXUtil.getObjectName(objectName);                    
                          
    }
    
    
    /**
     * @return Returns the thread pool.
     */          
    /*public PooledExecutor getThreadPool() {
        return threadPool;
    }*/ 
    
    /**
     * Method doFail
     */
    public void doFail() {
    	System.out.println( objectName + "  failed");
        log.info("MyThreadPool has failed");
    }

  	/**
     * Method doStop
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStop() throws WaitingException,
Exception {    	
        log.info("MyThreadPool has stopped");   
        
    }

    /**
     * Method doStart
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStart() throws WaitingException,
Exception {    	
    	System.out.println("GBean: " + objectName + " has
started");
        log.info("MyThreadPool has started");
        log.info(objectName);
        //log.info( "bean1 = " + APrinter);
        //log.info( "bean2 = " + BPrinter);  	    
        log.info( "Pool size is = " +
threadPool.getPoolSize() );        
        //run();                 
    }

	/*public void run(){
		
	}

	public void stop(){
		
	}*/

  /**
     * Method getGBeanInfo
     *
     * @return
     */
    public static GBeanInfo getGBeanInfo() {
        return GBEAN_INFO;
    }

}


********************************************************************************************************


package mytask;

import java.lang.*;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.kernel.jmx.JMXUtil;
import
org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;

/**
 * Class APrinterGBean
 */

public class APrinterGBean implements GBeanLifecycle {
     
    private static Log log =
LogFactory.getLog(APrinterGBean.class);
    private static final GBeanInfo GBEAN_INFO;
    private final ObjectName objectName;
    
        
    static {
        GBeanInfoBuilder infoFactory =
GBeanInfoBuilder.createStatic(APrinterGBean.class,
NameFactory.GERONIMO_SERVICE);
                
        // attributes
        infoFactory.addAttribute("objectName",
String.class, false);        

        // operations        
        infoFactory.addOperation("print");
        infoFactory.setConstructor(new
String[]{"objectName"});
        GBEAN_INFO = infoFactory.getBeanInfo();
    }


    /**
     * Constructor APrinterGBean
     *
     * @param name
     @param objectName
     */
    public APrinterGBean(String objectName) {
        this.objectName =
JMXUtil.getObjectName(objectName);        
    }

    public APrinterGBean( ) {
        this.objectName = null;        
    }


    /**
     * Method doFail
     */
    public void doFail() {
    	System.out.println( objectName + "  failed");
        log.info("APrinterGBean has failed");
    }

    /**
     * Method doStart
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStart() throws WaitingException,
Exception {    	
    	System.out.println("GBean: " + objectName + " has
started");
        log.info("APrinterGBean has started");
        log.info(objectName);        
    }

    /**
     * Method doStop
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStop() throws WaitingException,
Exception {
        log.info("APrinterGBean has stopped");
    }

    /**
     * Method getGBeanInfo
     *
     * @return
     */
    public static GBeanInfo getGBeanInfo() {
        return GBEAN_INFO;
    }
    /**
     * @return Returns the thread pool.
     */
  
    
    public void print( ){
	      
        for( int i=0; i < 10; i++ ){
			System.out.println("***APrinter***");
			//log.info("***APrinter***");
  	    } 
    }
       

}




********************************************************************************************************

package mytask;

import java.lang.*;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.kernel.jmx.JMXUtil;
import
org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;

/**
 * Class BPrinterGBean
 */

public class BPrinterGBean implements GBeanLifecycle {
     
    private static Log log =
LogFactory.getLog(BPrinterGBean.class);
    private static final GBeanInfo GBEAN_INFO;
    private final ObjectName objectName;
    
        
    static {
        GBeanInfoBuilder infoFactory =
GBeanInfoBuilder.createStatic(BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);

        // attributes
        infoFactory.addAttribute("objectName",
String.class, false);        

        // operations        
        infoFactory.addOperation("print");
        infoFactory.setConstructor(new
String[]{"objectName"});
        GBEAN_INFO = infoFactory.getBeanInfo();
    }


    /**
     * Constructor BPrinterGBean
     *
     * @param name
     @param objectName
     */
    public BPrinterGBean(String objectName) {
        this.objectName =
JMXUtil.getObjectName(objectName);                
    }
    
    public BPrinterGBean( ) {
        this.objectName = null;        
    }

    /**
     * Method doFail
     */
    public void doFail() {
    	System.out.println( objectName + "  failed");
        log.info("BPrinterGBean has failed");
    }

    /**
     * Method doStart
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStart() throws WaitingException,
Exception {
    	System.out.println("GBean: " +objectName + " has
started");
        log.info("BPrinterGBean has started");
        log.info(objectName);       
    }

    /**
     * Method doStop
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStop() throws WaitingException,
Exception {
        log.info("BPrinterGBean has stopped");
    }

    /**
     * Method getGBeanInfo
     *
     * @return
     */
    public static GBeanInfo getGBeanInfo() {
        return GBEAN_INFO;
    }
    /**
     * @return Returns the thread pool.
     */
  
    
    public void print(){
	      
        for( int i=0; i < 10; i++){
			System.out.println("**********BPrinter**********");
			//log.info("***BPrinter***");
  	    } 
    }
       

}



********************************************************************************************************

package mytask;

import java.lang.*;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.kernel.jmx.JMXUtil;
import EDU.oswego.cs.dl.util.concurrent.*;
import
org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;

/**
 * Class PrintStopper
 */

public class PrintStopper implements GBeanLifecycle {
     
    private static Log log =
LogFactory.getLog(PrintStopper.class);
    private static final GBeanInfo GBEAN_INFO;
    private final ObjectName objectName;              
    //private APrinterGBean APrinter;
    //private BPrinterGBean BPrinter;  
        
    static {
        GBeanInfoBuilder infoFactory =
GBeanInfoBuilder.createStatic(PrintStopper.class,NameFactory.GERONIMO_SERVICE);
                                                
        // attributes
        infoFactory.addAttribute("objectName",
String.class, false);        
                          
        // references           
       
//infoFactory.addReference("APrinter",APrinterGBean.class,NameFactory.GERONIMO_SERVICE);
       
//infoFactory.addReference("BPrinter",BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
         

        // operations                
        infoFactory.addOperation("timeout");
        infoFactory.addOperation("stopPrinters");     
  
        infoFactory.setConstructor(new
String[]{"objectName"});
        GBEAN_INFO = infoFactory.getBeanInfo();
    }
 
 
 	/*public void setAPrinter( APrinterGBean APrinter )
{
        this.APrinter = APrinter;              
    }
    
    public void setBPrinter( BPrinterGBean BPrinter )
{
        this.BPrinter = BPrinter;              
    }*/
    

    /**
     * Constructor PrintStopper
     *
     * @param name
     @param objectName
     */
    public PrintStopper(String objectName) {
        this.objectName =
JMXUtil.getObjectName(objectName);                   
    }


    /**
     * Method doFail
     */
    public void doFail() {
    	System.out.println( objectName + "  failed");
        log.info("PrintStopper has failed");
    }


    /**
     * Method doStart
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStart() throws WaitingException,
Exception {
    	System.out.println("GBean: " + objectName + " has
started");
        log.info("...GBean PrintStopper has
started...");
        log.info(objectName);        
        //log.info( "bean1 = " + APrinter);
        //log.info( "bean2 = " + BPrinter);
        timeout();
        stopPrinters();
    }


    /**
     * Method doStop
     *
     * @throws WaitingException
     * @throws Exception
     */
    public void doStop() throws WaitingException,
Exception {
        log.info("PrintStopper has stopped");
    }

    
    public void timeout(){
    	
    	long a = 0;
    	long b = 1;
    	long val = 1500;
    	    	
    	for(int i=0; i < val; i++){
    	  a = a + 1;
    	  b = a + 1;    		
    	  
    	}
    
    }

     /**
     * @return Returns the thread pool.
     */  
 	public void stopPrinters( ){	    
 	 	
 		/*try{
 			APrinter.doStop();
 			BPrinter.doStop();
 		} catch(org.apache.geronimo.gbean.WaitingException
e1){
 			 			
 		} catch(java.lang.Exception e2){
 			
 		}*/
 		
   	            
    }


    /**
     * Method getGBeanInfo
     *
     * @return
     */
    public static GBeanInfo getGBeanInfo() {
        return GBEAN_INFO;
    }         
       
}



******************************CONFIGURATION
PLAN*******************************************************************

<?xml version="1.0" encoding="UTF-8"?>
	
<configuration
	  
xmlns="http://geronimo.apache.org/xml/ns/deployment"
	   configId="mytask/Task"
	   >
	 
		<dependency>		
			<groupId>samples</groupId>
	    	<artifactId>mytask</artifactId>
	    	<version>1.0</version>  	    	
		</dependency>		    			
	     	    	      
	     	    	      
	    <gbean name="MTP" class="mytask.MyThreadPool"> 
    	
    	<!--	<reference name="APrinter">
				<name>gbean1</name> 				
			 </reference>    
						 
			<reference name="BPrinter" > 				
				<name>gbean2</name>
			</reference> 		-->		
    	
    	</gbean>     	    	       	    	     	    
    	
    	<gbean name="gbean1"
class="mytask.APrinterGBean"> </gbean>                
   
    	
        <gbean name="gbean2"
class="mytask.BPrinterGBean"> </gbean>                
  
    	                       	
		<!-- <gbean name="PoolExecutor"
class="EDU.oswego.cs.dl.util.concurrent.PooledExecutor">
            <attribute
name="maxPoolSize">15</attribute>        	
    	</gbean> -->
    		 
		<gbean name="MyGBean" class="mytask.MyGBean">
				
			<reference name="Pool">				
				<name>MTP</name>				
			</reference> 	
									
			<reference name="APrinter">
				<name>gbean1</name> 				
			 </reference>    
						 
			<reference name="BPrinter" > 				
				<name>gbean2</name>
			</reference> 		
													        					    		    		
   		</gbean>    	
   		   		   		
   		<!--
   		 <gbean name="PrintStopper"
class="mytask.PrintStopper" >
   		 	
   		 	<reference name="APrinter">
				<name>gbean1</name> 				
			 </reference>    
						 
			<reference name="BPrinter" > 				
				<name>gbean2</name>
			</reference> 									        			    		 
			 
   		 </gbean> -->
   		   		   		   			       		    		    	    	
									 	
</configuration>
	
	
	

********************************************************************************************************


This code compiles and gets deployed. However, it is
not working properly as MyGBean gets into the FAILED
state. If I remove the reference to MyThreadPool
on MyGBean, then it is fine. When deploying I get:

11:17:32,671 INFO  [MyGBean] MyThreadPool has started
11:17:32,671 INFO  [MyGBean]
geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=MTP
11:17:32,671 INFO  [MyGBean] Pool size is = 0
11:17:32,671 INFO  [BPrinterGBean] BPrinterGBean has
started
11:17:32,671 INFO  [BPrinterGBean]
geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=gbean2
11:17:32,687 ERROR [GBeanInstanceState] Error while
starting; GBean is now in the FAILED state:
objectName="geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=MyGBean"
java.lang.IllegalArgumentException: Cannot find
matching method/constructor
	at
mytask.MyThreadPool$$EnhancerByCGLIB$$2147a7b3$$FastClassByCGLIB$$35db5520.newInstance(<generated>)
	at
net.sf.cglib.reflect.FastClass.newInstance(FastClass.java:91)
	at
org.apache.geronimo.kernel.basic.BasicProxyManager$ManagedProxyFactory.createProxy(BasicProxyManager.java:211)
	at
org.apache.geronimo.kernel.basic.BasicProxyManager.createProxy(BasicProxyManager.java:108)
	at
org.apache.geronimo.gbean.runtime.GBeanSingleReference.start(GBeanSingleReference.java:79)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:863)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:325)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:110)
	at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:132)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:537)
	at
org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:208)
	at
org.apache.geronimo.kernel.config.Configuration.startRecursiveGBeans(Configuration.java:315)
	at
org.apache.geronimo.kernel.config.Configuration$$FastClassByCGLIB$$7f4b4a9b.invoke(<generated>)
	at
net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
	at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:173)
	at
org.apache.geronimo.kernel.config.ConfigurationManagerImpl.start(ConfigurationManagerImpl.java:142)
	at
org.apache.geronimo.kernel.config.ConfigurationManagerImpl$$FastClassByCGLIB$$fbed85d2.invoke(<generated>)
	at
net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
	at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
	at
org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:125)
	at
org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$$1cccefc9.invoke(<generated>)
	at
net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
	at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
	at
org.apache.geronimo.kernel.jmx.MBeanServerDelegate.invoke(MBeanServerDelegate.java:117)
	at
mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java:219)
	at
sun.reflect.GeneratedMethodAccessor171.invoke(Unknown
Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at
mx4j.remote.rmi.RMIConnectionProxy.invoke(RMIConnectionProxy.java:34)
	at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.chain(RMIConnectionSubjectInvoker.java:99)
	at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionSubjectInvoker.java:31)
	at
mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjectInvoker.java:90)
	at java.security.AccessController.doPrivileged(Native
Method)
	at javax.security.auth.Subject.doAsPrivileged(Unknown
Source)
	at
mx4j.remote.MX4JRemoteUtils.subjectInvoke(MX4JRemoteUtils.java:163)
	at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.subjectInvoke(RMIConnectionSubjectInvoker.java:86)
	at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubjectInvoker.java:80)
	at $Proxy0.invoke(Unknown Source)
	at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:221)
	at
sun.reflect.GeneratedMethodAccessor171.invoke(Unknown
Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at sun.rmi.server.UnicastServerRef.dispatch(Unknown
Source)
	at sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native
Method)
	at sun.rmi.transport.Transport.serviceCall(Unknown
Source)
	at
sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown
Source)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
	at java.lang.Thread.run(Unknown Source)
11:17:32,890 INFO  [APrinterGBean] APrinterGBean has
started
11:17:32,890 INFO  [APrinterGBean]
geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=gbean1





********************************************************************************************************


I am taking this project seriously.

Thanks in advance,
NP.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: CGLIB Related error (Full Code)

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Can you try adding an empty constructor to each class?  I think I
recall an issue where a GBean class needs either an empty constructor
or a management interface under some circumstances.

Thanks,
    Aaron

On 2/13/06, Nelson A. Perez <ne...@yahoo.com> wrote:
> Hi Aaron,
>
>
>  Thanks for your reply. You are right, it seems not to
> be a CGLIB-related issue. Anyway, here is the full
> code for the project I am working on:
>
>
>
> ********************************************************************************************************
>
>
>
> package mytask;
>
> import java.lang.*;
> import javax.management.ObjectName;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import org.apache.geronimo.gbean.GBeanInfo;
> import org.apache.geronimo.gbean.GBeanInfoBuilder;
> import org.apache.geronimo.gbean.GBeanLifecycle;
> import org.apache.geronimo.gbean.WaitingException;
> import org.apache.geronimo.kernel.jmx.JMXUtil;
> //import EDU.oswego.cs.dl.util.concurrent.*;
> import
> org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
>
>
> /**
>  * Class MyGBean
>  */
>
> public class MyGBean implements GBeanLifecycle {
>
>     private static Log log =
> LogFactory.getLog(MyGBean.class);
>     private static final GBeanInfo GBEAN_INFO;
>     private final ObjectName objectName;
>
>     private MyThreadPool Pool;
>         private APrinterGBean APrinter;
>     private BPrinterGBean BPrinter;
>     private boolean started = false;
>
>     static {
>
>                 GBeanInfoBuilder infoFactory =
> GBeanInfoBuilder.createStatic (MyGBean.class,
> NameFactory.GERONIMO_SERVICE);
>
>         // attributes
>         infoFactory.addAttribute("objectName",
> String.class, false);
>
>         // references
>
> infoFactory.addReference("Pool",MyThreadPool.class,NameFactory.GERONIMO_SERVICE);
>
> infoFactory.addReference("APrinter",APrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
> infoFactory.addReference("BPrinter",BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
>
>
>         // operations
>         infoFactory.addOperation("runPrinterA");
>         infoFactory.addOperation("runPrinterB");
>         infoFactory.addOperation("stopPrinters");
>         //infoFactory.addOperation("getPool");
>
>         infoFactory.setConstructor(new
> String[]{"objectName"});
>
>         //pool = new PooledExecutor(10);
>
>         GBEAN_INFO = infoFactory.getBeanInfo();
>     }
>
>
>         public void setPool( MyThreadPool Pool  ) {
>         this.Pool = Pool;
>     }
>
>         public void setAPrinter( APrinterGBean APrinter ) {
>         this.APrinter = APrinter;
>     }
>
>     public void setBPrinter( BPrinterGBean BPrinter )
> {
>         this.BPrinter = BPrinter;
>     }
>
>
>     /**
>      * Constructor MyGBean
>      *
>      * @param name
>      @param objectName
>      */
>      public MyGBean(String objectName ) {
>         this.objectName =
> JMXUtil.getObjectName(objectName);
>
>     }
>
>     /**
>      * Method doFail
>      */
>     public void doFail() {
>         System.out.println( objectName + "  failed");
>         log.info("My GBean has failed");
>     }
>
>     /**
>      * Method doStart
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStart() throws WaitingException,
> Exception {
>         started = true;
>         System.out.println("GBean: " + objectName + " has
> started");
>         log.info("My GBean has started");
>         log.info(objectName);
>         log.info( "bean1 = " + APrinter);
>         log.info( "bean2 = " + BPrinter);
>         log.info( "bean3 = " + Pool);
>         runPrinterA();
>         runPrinterB();
>
>
>         //log.info( "Pool size is = " +
> pool.getPoolSize() );
>     }
>
>
>     /**
>      * Method doStop
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStop() throws WaitingException,
> Exception {
>         log.info("MyGBean has stopped");
>
>     }
>
>     public void stopPrinters(){
>         started = false; //this will stop the printers
>
>         log.info("stopPrinters invocation!!!");
>     }
>
>
>
>     /**
>      * @return Returns the thread pool.
>      */
>
>     /*public MyThreadPool getPool() {
>         return Pool;
>     }*/
>
>     public void runPrinterA(){
>         //Run printer A in its own thread
>
>                 /*try{
>                         pool.execute( new Runnable() {
>                 public void run() {
>                         while (started) {
>
>                                         APrinter.print();
>                         }
>                 }
>                 });
>                 }catch(java.lang.InterruptedException e ){
>                         System.out.println("I/O exception while running
> thread");
>                 }*/
>
>     }
>
>
>     public void runPrinterB(){
>         //Run printer B in its own thread
>
>           /*try{
>
>                         pool.execute( new Runnable() {
>                 public void run() {
>                         while (started) {
>
>                                         BPrinter.print();
>                         }
>                 }
>                 });
>           }catch(java.lang.InterruptedException e ){
>                         System.out.println("I/O exception while running
> thread");
>           }     */
>
>     }
>
>
>      /**
>      * Method getGBeanInfo
>      *
>      * @return
>      */
>     public static GBeanInfo getGBeanInfo() {
>         return GBEAN_INFO;
>     }
>
>
> }
>
> ********************************************************************************************************
>
> package mytask;
>
> import java.lang.*;
> import javax.management.ObjectName;
> import org.apache.commons.logging.Log;
> import org.apache.geronimo.pool.ThreadPool;
> import org.apache.commons.logging.LogFactory;
> import org.apache.geronimo.gbean.GBeanInfo;
> import org.apache.geronimo.gbean.GBeanInfoBuilder;
> import org.apache.geronimo.gbean.GBeanLifecycle;
> import org.apache.geronimo.gbean.WaitingException;
> import org.apache.geronimo.kernel.jmx.JMXUtil;
> import EDU.oswego.cs.dl.util.concurrent.*;
> import
> org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
>
>
> /**
>  * Class MyThreadPool
>  */
>
> public class MyThreadPool implements GBeanLifecycle {
>
>     private static Log log =
> LogFactory.getLog(MyGBean.class);
>     private static final GBeanInfo GBEAN_INFO;
>     private final ObjectName objectName;
>
>     static private PooledExecutor threadPool;
>         //private APrinterGBean APrinter;
>     //private BPrinterGBean BPrinter;
>
>     static {
>
>                 GBeanInfoBuilder infoFactory =
> GBeanInfoBuilder.createStatic (MyThreadPool.class,
> NameFactory.GERONIMO_SERVICE);
>
>         // attributes
>         infoFactory.addAttribute("objectName",
> String.class, false);
>
>         // references
>
> //infoFactory.addReference("APrinter",APrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
> //infoFactory.addReference("BPrinter",BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
>
>         // operations
>         //infoFactory.addOperation("run");
>         //infoFactory.addOperation("stop");
>         //infoFactory.addOperation("getThreadPool");
>
>         infoFactory.setConstructor(new
> String[]{"objectName"});
>
>         threadPool = new PooledExecutor(10);
>
>
>         GBEAN_INFO = infoFactory.getBeanInfo();
>     }
>
>
>         /*public void setAPrinter( APrinterGBean APrinter )
> {
>         this.APrinter = APrinter;
>     }
>
>     public void setBPrinter( BPrinterGBean BPrinter )
> {
>         this.BPrinter = BPrinter;
>     }*/
>
>
>     /**
>      * Constructor MyThreadPool
>      *
>      * @param name
>      @param objectName
>      */
>      public MyThreadPool(String objectName ) {
>         this.objectName =
> JMXUtil.getObjectName(objectName);
>
>     }
>
>
>     /**
>      * @return Returns the thread pool.
>      */
>     /*public PooledExecutor getThreadPool() {
>         return threadPool;
>     }*/
>
>     /**
>      * Method doFail
>      */
>     public void doFail() {
>         System.out.println( objectName + "  failed");
>         log.info("MyThreadPool has failed");
>     }
>
>         /**
>      * Method doStop
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStop() throws WaitingException,
> Exception {
>         log.info("MyThreadPool has stopped");
>
>     }
>
>     /**
>      * Method doStart
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStart() throws WaitingException,
> Exception {
>         System.out.println("GBean: " + objectName + " has
> started");
>         log.info("MyThreadPool has started");
>         log.info(objectName);
>         //log.info( "bean1 = " + APrinter);
>         //log.info( "bean2 = " + BPrinter);
>         log.info( "Pool size is = " +
> threadPool.getPoolSize() );
>         //run();
>     }
>
>         /*public void run(){
>
>         }
>
>         public void stop(){
>
>         }*/
>
>   /**
>      * Method getGBeanInfo
>      *
>      * @return
>      */
>     public static GBeanInfo getGBeanInfo() {
>         return GBEAN_INFO;
>     }
>
> }
>
>
> ********************************************************************************************************
>
>
> package mytask;
>
> import java.lang.*;
> import javax.management.ObjectName;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import org.apache.geronimo.gbean.GBeanInfo;
> import org.apache.geronimo.gbean.GBeanInfoBuilder;
> import org.apache.geronimo.gbean.GBeanLifecycle;
> import org.apache.geronimo.gbean.WaitingException;
> import org.apache.geronimo.kernel.jmx.JMXUtil;
> import
> org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
>
> /**
>  * Class APrinterGBean
>  */
>
> public class APrinterGBean implements GBeanLifecycle {
>
>     private static Log log =
> LogFactory.getLog(APrinterGBean.class);
>     private static final GBeanInfo GBEAN_INFO;
>     private final ObjectName objectName;
>
>
>     static {
>         GBeanInfoBuilder infoFactory =
> GBeanInfoBuilder.createStatic(APrinterGBean.class,
> NameFactory.GERONIMO_SERVICE);
>
>         // attributes
>         infoFactory.addAttribute("objectName",
> String.class, false);
>
>         // operations
>         infoFactory.addOperation("print");
>         infoFactory.setConstructor(new
> String[]{"objectName"});
>         GBEAN_INFO = infoFactory.getBeanInfo();
>     }
>
>
>     /**
>      * Constructor APrinterGBean
>      *
>      * @param name
>      @param objectName
>      */
>     public APrinterGBean(String objectName) {
>         this.objectName =
> JMXUtil.getObjectName(objectName);
>     }
>
>     public APrinterGBean( ) {
>         this.objectName = null;
>     }
>
>
>     /**
>      * Method doFail
>      */
>     public void doFail() {
>         System.out.println( objectName + "  failed");
>         log.info("APrinterGBean has failed");
>     }
>
>     /**
>      * Method doStart
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStart() throws WaitingException,
> Exception {
>         System.out.println("GBean: " + objectName + " has
> started");
>         log.info("APrinterGBean has started");
>         log.info(objectName);
>     }
>
>     /**
>      * Method doStop
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStop() throws WaitingException,
> Exception {
>         log.info("APrinterGBean has stopped");
>     }
>
>     /**
>      * Method getGBeanInfo
>      *
>      * @return
>      */
>     public static GBeanInfo getGBeanInfo() {
>         return GBEAN_INFO;
>     }
>     /**
>      * @return Returns the thread pool.
>      */
>
>
>     public void print( ){
>
>         for( int i=0; i < 10; i++ ){
>                         System.out.println("***APrinter***");
>                         //log.info("***APrinter***");
>             }
>     }
>
>
> }
>
>
>
>
> ********************************************************************************************************
>
> package mytask;
>
> import java.lang.*;
> import javax.management.ObjectName;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import org.apache.geronimo.gbean.GBeanInfo;
> import org.apache.geronimo.gbean.GBeanInfoBuilder;
> import org.apache.geronimo.gbean.GBeanLifecycle;
> import org.apache.geronimo.gbean.WaitingException;
> import org.apache.geronimo.kernel.jmx.JMXUtil;
> import
> org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
>
> /**
>  * Class BPrinterGBean
>  */
>
> public class BPrinterGBean implements GBeanLifecycle {
>
>     private static Log log =
> LogFactory.getLog(BPrinterGBean.class);
>     private static final GBeanInfo GBEAN_INFO;
>     private final ObjectName objectName;
>
>
>     static {
>         GBeanInfoBuilder infoFactory =
> GBeanInfoBuilder.createStatic(BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
>         // attributes
>         infoFactory.addAttribute("objectName",
> String.class, false);
>
>         // operations
>         infoFactory.addOperation("print");
>         infoFactory.setConstructor(new
> String[]{"objectName"});
>         GBEAN_INFO = infoFactory.getBeanInfo();
>     }
>
>
>     /**
>      * Constructor BPrinterGBean
>      *
>      * @param name
>      @param objectName
>      */
>     public BPrinterGBean(String objectName) {
>         this.objectName =
> JMXUtil.getObjectName(objectName);
>     }
>
>     public BPrinterGBean( ) {
>         this.objectName = null;
>     }
>
>     /**
>      * Method doFail
>      */
>     public void doFail() {
>         System.out.println( objectName + "  failed");
>         log.info("BPrinterGBean has failed");
>     }
>
>     /**
>      * Method doStart
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStart() throws WaitingException,
> Exception {
>         System.out.println("GBean: " +objectName + " has
> started");
>         log.info("BPrinterGBean has started");
>         log.info(objectName);
>     }
>
>     /**
>      * Method doStop
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStop() throws WaitingException,
> Exception {
>         log.info("BPrinterGBean has stopped");
>     }
>
>     /**
>      * Method getGBeanInfo
>      *
>      * @return
>      */
>     public static GBeanInfo getGBeanInfo() {
>         return GBEAN_INFO;
>     }
>     /**
>      * @return Returns the thread pool.
>      */
>
>
>     public void print(){
>
>         for( int i=0; i < 10; i++){
>                         System.out.println("**********BPrinter**********");
>                         //log.info("***BPrinter***");
>             }
>     }
>
>
> }
>
>
>
> ********************************************************************************************************
>
> package mytask;
>
> import java.lang.*;
> import javax.management.ObjectName;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import org.apache.geronimo.gbean.GBeanInfo;
> import org.apache.geronimo.gbean.GBeanInfoBuilder;
> import org.apache.geronimo.gbean.GBeanLifecycle;
> import org.apache.geronimo.gbean.WaitingException;
> import org.apache.geronimo.kernel.jmx.JMXUtil;
> import EDU.oswego.cs.dl.util.concurrent.*;
> import
> org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
>
> /**
>  * Class PrintStopper
>  */
>
> public class PrintStopper implements GBeanLifecycle {
>
>     private static Log log =
> LogFactory.getLog(PrintStopper.class);
>     private static final GBeanInfo GBEAN_INFO;
>     private final ObjectName objectName;
>     //private APrinterGBean APrinter;
>     //private BPrinterGBean BPrinter;
>
>     static {
>         GBeanInfoBuilder infoFactory =
> GBeanInfoBuilder.createStatic(PrintStopper.class,NameFactory.GERONIMO_SERVICE);
>
>         // attributes
>         infoFactory.addAttribute("objectName",
> String.class, false);
>
>         // references
>
> //infoFactory.addReference("APrinter",APrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
> //infoFactory.addReference("BPrinter",BPrinterGBean.class,NameFactory.GERONIMO_SERVICE);
>
>
>         // operations
>         infoFactory.addOperation("timeout");
>         infoFactory.addOperation("stopPrinters");
>
>         infoFactory.setConstructor(new
> String[]{"objectName"});
>         GBEAN_INFO = infoFactory.getBeanInfo();
>     }
>
>
>         /*public void setAPrinter( APrinterGBean APrinter )
> {
>         this.APrinter = APrinter;
>     }
>
>     public void setBPrinter( BPrinterGBean BPrinter )
> {
>         this.BPrinter = BPrinter;
>     }*/
>
>
>     /**
>      * Constructor PrintStopper
>      *
>      * @param name
>      @param objectName
>      */
>     public PrintStopper(String objectName) {
>         this.objectName =
> JMXUtil.getObjectName(objectName);
>     }
>
>
>     /**
>      * Method doFail
>      */
>     public void doFail() {
>         System.out.println( objectName + "  failed");
>         log.info("PrintStopper has failed");
>     }
>
>
>     /**
>      * Method doStart
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStart() throws WaitingException,
> Exception {
>         System.out.println("GBean: " + objectName + " has
> started");
>         log.info("...GBean PrintStopper has
> started...");
>         log.info(objectName);
>         //log.info( "bean1 = " + APrinter);
>         //log.info( "bean2 = " + BPrinter);
>         timeout();
>         stopPrinters();
>     }
>
>
>     /**
>      * Method doStop
>      *
>      * @throws WaitingException
>      * @throws Exception
>      */
>     public void doStop() throws WaitingException,
> Exception {
>         log.info("PrintStopper has stopped");
>     }
>
>
>     public void timeout(){
>
>         long a = 0;
>         long b = 1;
>         long val = 1500;
>
>         for(int i=0; i < val; i++){
>           a = a + 1;
>           b = a + 1;
>
>         }
>
>     }
>
>      /**
>      * @return Returns the thread pool.
>      */
>         public void stopPrinters( ){
>
>                 /*try{
>                         APrinter.doStop();
>                         BPrinter.doStop();
>                 } catch(org.apache.geronimo.gbean.WaitingException
> e1){
>
>                 } catch(java.lang.Exception e2){
>
>                 }*/
>
>
>     }
>
>
>     /**
>      * Method getGBeanInfo
>      *
>      * @return
>      */
>     public static GBeanInfo getGBeanInfo() {
>         return GBEAN_INFO;
>     }
>
> }
>
>
>
> ******************************CONFIGURATION
> PLAN*******************************************************************
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <configuration
>
> xmlns="http://geronimo.apache.org/xml/ns/deployment"
>            configId="mytask/Task"
>            >
>
>                 <dependency>
>                         <groupId>samples</groupId>
>                 <artifactId>mytask</artifactId>
>                 <version>1.0</version>
>                 </dependency>
>
>
>             <gbean name="MTP" class="mytask.MyThreadPool">
>
>         <!--    <reference name="APrinter">
>                                 <name>gbean1</name>
>                          </reference>
>
>                         <reference name="BPrinter" >
>                                 <name>gbean2</name>
>                         </reference>            -->
>
>         </gbean>
>
>         <gbean name="gbean1"
> class="mytask.APrinterGBean"> </gbean>
>
>
>         <gbean name="gbean2"
> class="mytask.BPrinterGBean"> </gbean>
>
>
>                 <!-- <gbean name="PoolExecutor"
> class="EDU.oswego.cs.dl.util.concurrent.PooledExecutor">
>             <attribute
> name="maxPoolSize">15</attribute>
>         </gbean> -->
>
>                 <gbean name="MyGBean" class="mytask.MyGBean">
>
>                         <reference name="Pool">
>                                 <name>MTP</name>
>                         </reference>
>
>                         <reference name="APrinter">
>                                 <name>gbean1</name>
>                          </reference>
>
>                         <reference name="BPrinter" >
>                                 <name>gbean2</name>
>                         </reference>
>
>                 </gbean>
>
>                 <!--
>                  <gbean name="PrintStopper"
> class="mytask.PrintStopper" >
>
>                         <reference name="APrinter">
>                                 <name>gbean1</name>
>                          </reference>
>
>                         <reference name="BPrinter" >
>                                 <name>gbean2</name>
>                         </reference>
>
>                  </gbean> -->
>
>
> </configuration>
>
>
>
>
> ********************************************************************************************************
>
>
> This code compiles and gets deployed. However, it is
> not working properly as MyGBean gets into the FAILED
> state. If I remove the reference to MyThreadPool
> on MyGBean, then it is fine. When deploying I get:
>
> 11:17:32,671 INFO  [MyGBean] MyThreadPool has started
> 11:17:32,671 INFO  [MyGBean]
> geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=MTP
> 11:17:32,671 INFO  [MyGBean] Pool size is = 0
> 11:17:32,671 INFO  [BPrinterGBean] BPrinterGBean has
> started
> 11:17:32,671 INFO  [BPrinterGBean]
> geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=gbean2
> 11:17:32,687 ERROR [GBeanInstanceState] Error while
> starting; GBean is now in the FAILED state:
> objectName="geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=MyGBean"
> java.lang.IllegalArgumentException: Cannot find
> matching method/constructor
>         at
> mytask.MyThreadPool$$EnhancerByCGLIB$$2147a7b3$$FastClassByCGLIB$$35db5520.newInstance(<generated>)
>         at
> net.sf.cglib.reflect.FastClass.newInstance(FastClass.java:91)
>         at
> org.apache.geronimo.kernel.basic.BasicProxyManager$ManagedProxyFactory.createProxy(BasicProxyManager.java:211)
>         at
> org.apache.geronimo.kernel.basic.BasicProxyManager.createProxy(BasicProxyManager.java:108)
>         at
> org.apache.geronimo.gbean.runtime.GBeanSingleReference.start(GBeanSingleReference.java:79)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:863)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:325)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:110)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:132)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:537)
>         at
> org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:208)
>         at
> org.apache.geronimo.kernel.config.Configuration.startRecursiveGBeans(Configuration.java:315)
>         at
> org.apache.geronimo.kernel.config.Configuration$$FastClassByCGLIB$$7f4b4a9b.invoke(<generated>)
>         at
> net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>         at
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
>         at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
>         at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
>         at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:173)
>         at
> org.apache.geronimo.kernel.config.ConfigurationManagerImpl.start(ConfigurationManagerImpl.java:142)
>         at
> org.apache.geronimo.kernel.config.ConfigurationManagerImpl$$FastClassByCGLIB$$fbed85d2.invoke(<generated>)
>         at
> net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>         at
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
>         at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
>         at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
>         at
> org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:125)
>         at
> org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$$1cccefc9.invoke(<generated>)
>         at
> net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>         at
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
>         at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
>         at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
>         at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
>         at
> org.apache.geronimo.kernel.jmx.MBeanServerDelegate.invoke(MBeanServerDelegate.java:117)
>         at
> mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java:219)
>         at
> sun.reflect.GeneratedMethodAccessor171.invoke(Unknown
> Source)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> mx4j.remote.rmi.RMIConnectionProxy.invoke(RMIConnectionProxy.java:34)
>         at
> mx4j.remote.rmi.RMIConnectionSubjectInvoker.chain(RMIConnectionSubjectInvoker.java:99)
>         at
> mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionSubjectInvoker.java:31)
>         at
> mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjectInvoker.java:90)
>         at java.security.AccessController.doPrivileged(Native
> Method)
>         at javax.security.auth.Subject.doAsPrivileged(Unknown
> Source)
>         at
> mx4j.remote.MX4JRemoteUtils.subjectInvoke(MX4JRemoteUtils.java:163)
>         at
> mx4j.remote.rmi.RMIConnectionSubjectInvoker.subjectInvoke(RMIConnectionSubjectInvoker.java:86)
>         at
> mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubjectInvoker.java:80)
>         at $Proxy0.invoke(Unknown Source)
>         at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:221)
>         at
> sun.reflect.GeneratedMethodAccessor171.invoke(Unknown
> Source)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at sun.rmi.server.UnicastServerRef.dispatch(Unknown
> Source)
>         at sun.rmi.transport.Transport$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native
> Method)
>         at sun.rmi.transport.Transport.serviceCall(Unknown
> Source)
>         at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown
> Source)
>         at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
> 11:17:32,890 INFO  [APrinterGBean] APrinterGBean has
> started
> 11:17:32,890 INFO  [APrinterGBean]
> geronimo.server:J2EEApplication=null,J2EEModule=mytask/Task,J2EEServer=geronimo,j2eeType=GBean,name=gbean1
>
>
>
>
>
> ********************************************************************************************************
>
>
> I am taking this project seriously.
>
> Thanks in advance,
> NP.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>