axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David L. Cole" <DLC...@cmsenergy.com>
Subject EJB Provider - Illegal Access Exception
Date Tue, 19 Feb 2002 00:30:08 GMT
Hi all,

I am trying to deploy a service which access an EJB for which I am getting
an IllegalAccessException at
EJBProvider.getServiceClass(EJBProvider.java:208). This is happening as a
result of using reflection to get a
handle to the RemoteInterface. Has anybody seen this error before?


  protected Class getServiceClass(MessageContext msgContext, String
beanJndiName) throws Exception {
        Handler serviceHandler = msgContext.getServiceHandler();

       // Get the EJB Home object from JNDI
       Object ejbHome = getEJBHome(msgContext, beanJndiName);

        String homeName = (String) getStrOption(homeInterfaceNameOption,
                                                serviceHandler);
        if (homeName == null)
            throw new AxisFault(
                    JavaUtils.getMessage("noOption00",
                                         homeInterfaceNameOption,
                                         msgContext.getTargetService()));

       // Load the Home class name given in the config file
       Class homeClass = msgContext.getClassLoader().loadClass(homeName);

       // Make sure the object we got back from JNDI is the same type
       // as the what is specified in the config file
       Object ehome = javax.rmi.PortableRemoteObject.narrow(ejbHome,
homeClass);

       // Invoke the getEJBMetaData method of the ejbHome class without
actually
       // touching any EJB classes (i.e. no cast to EJBHome)
       Method getEJBMetaData =
               homeClass.getMethod("getEJBMetaData", empty_class_array);
       Object metaData =
               getEJBMetaData.invoke(ehome, empty_object_array);
       Method getRemoteInterfaceClass =
               metaData.getClass().getMethod("getRemoteInterfaceClass",
                                             empty_class_array);
       Class interfaceClass =
//LINE 208
               (Class) getRemoteInterfaceClass.invoke(metaData,
                                                      empty_object_array);

       // got it, return it
       return interfaceClass;

    }

AxisFault
  faultCode: http://xml.apache.org/axis/:Server.userException
  faultString: java.lang.IllegalAccessException
  faultActor: null
  faultDetail:
           stackTrace: java.lang.IllegalAccessException
           at java.lang.reflect.Method.invoke(Native Method)
           at
org.apache.axis.providers.java.EJBProvider.getServiceClass(EJBProvider.java:208)

           at
org.apache.axis.providers.java.JavaProvider.generateWSDL(JavaProvider.java:303)

           at
org.apache.axis.strategies.WSDLGenStrategy.visit(WSDLGenStrategy.java:72)
           at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:151)
           at
org.apache.axis.SimpleChain.generateWSDL(SimpleChain.java:137)
           at
org.apache.axis.server.AxisServer.generateWSDL(AxisServer.java:437)
           at
org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:267)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)

           at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)

           at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2456)

           at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)

           at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
           at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


Here is the service declaration in the .wsdd file

  <service name="UserManager" provider="java:EJB">
      <parameter name="beanJndiName" value="UserManager"/>
      <parameter name="homeInterfaceName" value
="com.itemxchange.users.ejb.UserManagerHome"/>
      <parameter name="allowedMethods" value="timedGetAllUsers
deleteUserById updateUser getUserById getAllUsers getUserByName addUser"/>
      <parameter name="jndiURL" value="t3://localhost:7001"/>
      <parameter name="jndiContextClass" value
="weblogic.jndi.WLInitialContextFactory"/>
  </service>


Mime
View raw message