Hi,

we use Axis2 1.4 (JDK 1.4) with Spring 2.0.8 on Weblogic 8.1. As described in 
http://ws.apache.org/axis2/1_4/spring.html the "ServiceLifeCycle" was 
configured like this:

        ClassLoader classLoader = service.getClassLoader();
        ClassPathXmlApplicationContext appCtx = new
            ClassPathXmlApplicationContext(new String[] {
                "my-application-context.xml"}, false);
        appCtx.setClassLoader(classLoader);
        appCtx.refresh();

In "my-application-context.xml" we add a Spring-Bean to access the ejb:

        <bean id="someService" 
class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
                <property name="proxyInterface" value="org.SomeService" />
                <property name="lookupOnStartup" value="false" />
                <property name="jndiName" value="SomeService"/>
                <property name="jndiTemplate">
                        <bean class="org.springframework.jndi.JndiTemplate">
                                <property name="environment">
                                        <props>
                                                <prop 
key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
                                                <prop 
key="java.naming.provider.url">t3://localhost:7001</prop>
                                                <prop 
key="java.naming.security.principal">username</prop>
                                                <prop 
key="java.naming.security.credentials">password</prop>
                                        </props>
                                </property>
                        </bean>
                </property>
        </bean>

By starting weblogic we get this exception:

... bean with name 'someService' defined in class path resource 
[my-application-context.xml]: Invocation of init method failed; nested 
exception is java.lang.IllegalArgumentException: interface org.SomeService is 
not visible from class loader
        at 
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:151)
        at 
org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:81)
        at 
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
        at 
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
        at 
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
        at 
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
        at 
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
        at 
org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
        at 
org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284)
        at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:82)
        at 
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:511)
        at 
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:431)
        at 
weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1099)
        at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at 
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at 
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:975)
        at 
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:954)
        at 
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:893)
        at 
weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3456)
        at 
weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3401)
        at 
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3382)
        at 
weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:6262)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:892)
        at 
weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2181)
        at 
weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2222)
        at 
weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2169)
        at 
weblogic.management.deploy.slave.SlaveDeployer$Application.setActivation(SlaveDeployer.java:3111)
        at 
weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:1769)
        at 
weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:352)
        at 
weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229)
        at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136)
        at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)

By moving the Jar with the EJB-Interface "org.SomeService" into 
"axis2.war/WEB-INF/lib", OR changing 
the "ServiceLifeCycle" to the following the error above is gone and it seems 
that all spring-beans are configured correctly:

        ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
        ClassLoader classLoader = service.getClassLoader();
        Thread.currentThread().setContextClassLoader(classLoader);
        ClassPathXmlApplicationContext appCtx =
            new ClassPathXmlApplicationContext(
                new String[]{"my-application-context.xml"}, false);
        appCtx.setClassLoader(classLoader);
        appCtx.refresh();
        Thread.currentThread().setContextClassLoader(contextCl);

But by calling the EJB from wihthin the Web-Service we get an 
IllegaleArgumentException with "type mismatch":

org.springframework.remoting.RemoteProxyFailureException: Invocation of RMI 
stub method failed: public abstract org.SomeOutputObject 
org.SomeService.someEjbMethode(org.SomeInputObject); nested exception is 
java.lang.IllegalArgumentException: argument type mismatch
Caused by: java.lang.IllegalArgumentException: argument type mismatch
        at 
jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
 Source)
        at 
java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown
 Source)
        at 
org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke(RmiClientInterceptorUtils.java:103)
        at 
org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:75)
        at 

Is this a generel class loader problem? Is there a workaround?

Thanks for reply!

Regards 

Mirwais
-- 
Dipl.-Inf. Mirwais Turjalei
Rieckhoffstr 14
21073 Hamburg
- Germany -
Tel.: +49 (0)40 24887533
Mobil: +49 (0)179 2273166
E-Mail: [EMAIL PROTECTED]


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

Reply via email to