NullpointerException in org.apache.axis2.deployment.util.Utils.loadHandler 
method
---------------------------------------------------------------------------------

                 Key: AXIS2-3565
                 URL: https://issues.apache.org/jira/browse/AXIS2-3565
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.3
         Environment: Windows XP, Running inside CLIF performance 
Tester.(http://clif.objectweb.org/)
            Reporter: Srikanth Seshadri


A Nullpointer Exception is thrown when initializing 
org.apache.axis2.client.ServiceClient. The stack trace is given below

=================================================================
org.apache.axis2.deployment.DeploymentException
        at org.apache.axis2.deployment.util.Utils.loadHandler(Utils.java:134)
        at 
org.apache.axis2.deployment.AxisConfigBuilder.processPhaseList(AxisConfigBuilder.java:405)
        at 
org.apache.axis2.deployment.AxisConfigBuilder.processPhaseOrders(AxisConfigBuilder.java:433)
        at 
org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:133)
        at 
org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615)
        at 
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115)
        at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
        at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180)
        at 
org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146)
        at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:139)
        at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:228)
        at 
org.objectweb.isac.plugin.webserviceloadinjector.SessionObject.doAdd(Unknown 
Source)
        at 
org.objectweb.isac.plugin.webserviceloadinjector.SessionObject.doSample(Unknown 
Source)
        at 
org.objectweb.clif.scenario.isac.engine.ExecutionThread.doWork(ExecutionThread.java:155)
        at 
org.objectweb.clif.scenario.isac.engine.ExecutionThread.run(ExecutionThread.java:251)
Caused by: java.lang.NullPointerException
        at org.apache.axis2.deployment.util.Utils.loadHandler(Utils.java:118)
        ... 14 more
=================================================================




>From the source code debugging I figured out that the exception is happening 
>on the following line in the 
>org.apache.axis2.deployment.util.Utils.loadHandler method...

=========================================
if(handlerClass.getPackage().getName().equals("org.apache.axis2.engine")){
                String name = handlerClass.getName();
                log.warn("Dispatcher " + name + " is now deprecated.");
                if(name.indexOf("InstanceDispatcher")!=-1) {
                    log.warn("Please remove the entry for " + 
handlerClass.getName() + "from axis2.xml");
                } else {
                    log.warn("Please edit axis2.xml " +
                            "and replace with the same class in 
org.apache.axis2.dispatchers package");
                }
            }
==============================================

The "getPackage" call in the "if" statement's condition can return null when 
the java.lang.Package object is not created by the class loader. This situation 
is valid as stated in this methods contract.

This is what exactly happens in case of CLIF class loader. Hence the null 
pointer exception. So check has to be introduced to validate the condition.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to