axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Philippe HAUTIN (JIRA)" <>
Subject [jira] Created: (AXIS2-3947) EJB provider run only once
Date Mon, 28 Jul 2008 10:15:31 GMT
EJB provider run only once

                 Key: AXIS2-3947
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: rpc
    Affects Versions: 1.3, 1.4
         Environment: Weblogic 10.0MP1 (
JDK 1.5.0_15-b04
Windows XP SP2, Solaris 10
            Reporter: Jean-Philippe HAUTIN
            Priority: Blocker

I made a simple web service towards an EJB using Axis2 1.3, following the tutorial at this

It works fine once (the first run) but when I try to run it a second time in a row, I have
this response in SOAP UI
<soapenv:Envelope xmlns:soapenv="">
         <faultstring>object is not an instance of declaring class</faultstring>
            <Exception>org.apache.axis2.AxisFault: object is not an instance of declaring
            at org.apache.axis2.AxisFault.makeFault(
            at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(
            at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(
            at org.apache.axis2.receivers.AbstractMessageReceiver.receive(
            at org.apache.axis2.engine.AxisEngine.receive(
            at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
            at org.apache.axis2.transport.http.AxisServlet.doPost(
            at javax.servlet.http.HttpServlet.service(
            at javax.servlet.http.HttpServlet.service(
            at weblogic.servlet.internal.StubSecurityHelper$
            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
            at weblogic.servlet.internal.ServletStubImpl.execute(
            at weblogic.servlet.internal.ServletStubImpl.execute(
            at weblogic.servlet.internal.WebAppServletContext$
            at Source)
            at weblogic.servlet.internal.WebAppServletContext.securedExecute(
            at weblogic.servlet.internal.WebAppServletContext.execute(
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(
            at java.lang.reflect.Method.invoke(
            at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(
            at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(
            ... 19 more</Exception>

I investigated a bit. I found out a problem within the « caching system » used to prevent
introspection to resolve which Java method/class to call.

Here is a simple of org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic()

            Object obj = getTheImplementationObject(inMessage);
            Class ImplClass = obj.getClass();
            AxisOperation op = inMessage.getOperationContext().getAxisOperation();
            method = (Method)(op.getParameterValue("myMethod"));
            AxisService service = inMessage.getAxisService();
            OMElement methodElement = inMessage.getEnvelope().getBody().getFirstElement();
            AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            String messageNameSpace = null;
            if (method == null) {
                String methodName = op.getName().getLocalPart();
                Method[] methods = ImplClass.getMethods();
                for (int i = 0; i < methods.length; i++) {
                    if (methods[i].getName().equals(methodName)) {
                        method = methods[i];
                        op.addParameter("myMethod", method);
                if (method == null) {
                    throw new AxisFault("No such method '" + methodName +
                            "' in class " + ImplClass.getName());

The first time, everything is fine, "obj" is new, "method" is null and is fill correctly with
loop made of ImplClass.getMethods();. During the second call, "obj" is a new instance but
"method" comes from "op" and is the one from the previous call. But it doesn't match "obj".
"method" is related to the previous instance of "obj" instanciated from the previous call.
It seems that the saving of "obj" in the ServiceContext class didn't work properly.

The quick fix is to comment the line method = (Method)(op.getParameterValue("myMethod"));
but that implies to launch the introspection framework at every call. It may be time consuming.

I tested it with Axis2 1.3 and 1.4 too and it doesn't work any better

I make a unit Test Eclipse workspaces with 2 projects :
-  project "ejbModuleWebService" is the project with a very simple EJB,
- project WebServiceEJB contains the web service definition. 

We have the bug on Weblogic 10, I didn't test it on another application server.

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:
For additional commands, e-mail:

View raw message