You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by johanp <ca...@live.se> on 2008/07/29 15:31:13 UTC

JSR181 pojo remote EJB3


Hi ,

Trying to publish Jboss EJB3 remote session bean with SMX JSR181 and raw
HTTP soap. It does not work with Spring JNDI classes ??

tia/Johan

======== s a m p l e c o d e ==========
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
	xmlns:ki="http://ki/kiejb/1.0">  
<jsr181:endpoint annotations="none" service="ki:K" 
	endpoint="K"
        serviceInterface="ki.K">
  <jsr181:pojo>
    <bean
class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
      <property name="lookupHomeOnStartup" value="false"/>
      <property name="jndiName" value="KBean/remote"/>
      <property name="businessInterface" value="ki.K"/>
      <property name="jndiTemplate">
          <ref bean="jndiTemplate" />
      </property>
    </bean>
  </jsr181:pojo>                 
</jsr181:endpoint>  
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop
key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>            
            <prop
key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</prop>
            <prop key="java.naming.provider.url">localhost</prop>
        </props>
    </property>
</bean>
</beans>

@Remote
public interface K {
   String ping();
}

//@SecurityDomain("KSP")
@Stateless
public class KBean implements K {
    //@PermitAll or @RolesAllowed("admin") or @RolesAllowed({"admin",
"nonadmin"})
    //@TransactionAttribute(TransactionAttributeType.REQUIRED)
    public String ping() {
        return "";
    }
}

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:ki="http://ki/kiejb/1.0">                
<http:endpoint service="ki:K"
                 endpoint="KPort"
                 targetService="ki:K"
                 role="consumer" 
                 locationURI="http://0.0.0.0:8192/KService/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="true" />                                 
</beans>

11:53:34,426 INFO  [STDOUT] ERROR - DefaultFaultHandler            - Fault
occur
red!
org.codehaus.xfire.XFireRuntimeException: Error invoking 'ki.K.ping()'.
Nested exception is j
ava.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInv
oker.java:54)
        at
org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessa
ge(ServiceInvocationHandler.java:322)
        at
org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(Ser
viceInvocationHandler.java:86)
        at
org.codehaus.xfire.service.binding.ServiceInvocationHandler.execute(S
erviceInvocationHandler.java:134)
        at
org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(Se
rviceInvocationHandler.java:109)
        at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at
org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoin
t.java:64)
        at
org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.
java:38)
        at
org.apache.servicemix.jsr181.Jsr181ExchangeProcessor.process(Jsr181Ex
changeProcessor.java:114)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:490)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:172)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchMethodError:
org.springframework.jndi.JndiTemplate.re
leaseContext(Ljavax/naming/Context;)V
        at
org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(
AbstractSlsbInvokerInterceptor.java:191)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:166)
        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:204)
        at $Proxy157.ping(Unknown Source)
        ... 23 more
-- 
View this message in context: http://www.nabble.com/JSR181-pojo-remote-EJB3-tp18712205p18712205.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.