IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Wildfly/JBoss Java Discussion :

EJB3 - JBoss et client "lourd"


Sujet :

Wildfly/JBoss Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    ego
    ego est déconnecté
    Rédacteur

    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juillet 2004
    Messages
    1 883
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Architecte de système d'information
    Secteur : Finance

    Informations forums :
    Inscription : Juillet 2004
    Messages : 1 883
    Billets dans le blog
    2
    Par défaut EJB3 - JBoss et client "lourd"
    Bonjour,

    j'ai un EJB3 Session Stateless sous JBoss 5.
    Comment faire pour avoir les stubs pour mon client Swing ? Le "ejb-client.jar" que je connaissait en EJB2. On fait comment maintenant ? (avec ant ce serait mieux).
    En fait, j'ai fait un essai en créant un jar avec l'interface "@Remote" implémentée par mon EJB mais j'ai l'exception suivante Spring (et je ne sais finalement d'où vient le problème)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    org.springframework.remoting.RemoteProxyFailureException: No matching RMI stub method found for: public abstract java.lang.String com.bnpp.echo.services.EchoService.echo(java.lang.String); nested exception is java.lang.NoSuchMethodException: javax.naming.Reference.echo(java.lang.String)
    	at org.springframework.remoting.rmi.RmiClientInterceptorUtils.invokeRemoteMethod(RmiClientInterceptorUtils.java:120)
    	at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:98)
    	at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invokeInContext(AbstractRemoteSlsbInvokerInterceptor.java:137)
    	at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(AbstractSlsbInvokerInterceptor.java:188)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    	at $Proxy0.echo(Unknown Source)
    	at com.bnpp.test.echo.TestEcho.testService(TestEcho.java:20)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at junit.framework.TestCase.runTest(TestCase.java:164)
    	at junit.framework.TestCase.runBare(TestCase.java:130)
    	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
    	at junit.framework.TestResult$1.protect(TestResult.java:106)
    	at junit.framework.TestResult.runProtected(TestResult.java:124)
    	at junit.framework.TestResult.run(TestResult.java:109)
    	at junit.framework.TestCase.run(TestCase.java:120)
    	at junit.framework.TestSuite.runTest(TestSuite.java:230)
    	at junit.framework.TestSuite.run(TestSuite.java:225)
    	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: java.lang.NoSuchMethodException: javax.naming.Reference.echo(java.lang.String)
    	at java.lang.Class.getMethod(Class.java:1581)
    	at org.springframework.remoting.rmi.RmiClientInterceptorUtils.invokeRemoteMethod(RmiClientInterceptorUtils.java:112)
    	... 26 more
    Merci d'avance

    Voici qq éléments

    Le applicationContext.xml de mon client
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <?xml version="1.0" encoding="UTF-8" ?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
     
     
    	<bean id="echoService"
    		class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
    		<property name="jndiName" value="ejb/Echo" />
    		<property name="businessInterface" value="com.bnpp.echo.services.EchoService" />
     
    		<property name="jndiEnvironment">
    			<props>
    				<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
    				<prop key="java.naming.provider.url">localhost</prop>
    			</props>
    		</property>
     
     
    	</bean>
    </beans>

  2. #2
    ego
    ego est déconnecté
    Rédacteur

    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juillet 2004
    Messages
    1 883
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Architecte de système d'information
    Secteur : Finance

    Informations forums :
    Inscription : Juillet 2004
    Messages : 1 883
    Billets dans le blog
    2
    Par défaut
    bon, il suffisait que mon cerveau se remette en marche
    tout va bien, juste un petit problème de références de jars :-(

  3. #3
    Membre Expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Par défaut
    Bonjour,
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    tout va bien, juste un petit problème de références de jars :-(
    Peux tu être plus explicite sur ce que tu as fait pour resoudre ton pb, car j'ai le même pb sous jonas, voila mon applicationContext.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:jee="http://www.springframework.org/schema/jee"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd
               http://www.springframework.org/schema/jee 
               http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
     
     
    	<bean id="genericService" class="fr.msw.ejb.service.GenericService">		
    		<property name="genericFacade" ref="genericFacade"></property>		 
    	</bean>
     
     
    	<!-- Bean d'acces au Contexte -->	
    	<bean id="applicationContextHolder"	class="fr.msw.spring.ApplicationContextHolder" />
     
     
    	<!-- Generic Facade accedé dans les managed Beans -->
    	<bean id="genericFacade" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
    		<property name="jndiEnvironment" ref="JNDIEnvironment" />
      		<property name="jndiName" value="genericFacadeStateless"/>
      		<property name="businessInterface" value="fr.msw.ejb3.session.facade.GenericFacade"/>
      		<property name="lookupHomeOnStartup" value="true"/>  		
    	</bean>
     
    	<!-- Configuration JNDI -->
    	<bean id="JNDIEnvironment" class="java.util.Hashtable">
    	<constructor-arg>
    		<map>
    			<entry key="java.naming.factory.initial">
    				<value>com.sun.jndi.rmi.registry.RegistryContextFactory</value><!--JNDI look-up service-->
    			</entry>
    			<entry key="java.naming.provider.url">
    				<value>rmi://myServer@:1099/</value>
    			</entry>
    			<entry key="java.naming.factory.url.pkgs">
    				<value>org.objectweb.jonas.naming</value>
    			</entry>
    		</map>
    	</constructor-arg>
      </bean>
     
     
     
     
     
    </beans>

+ Répondre à la discussion
Cette discussion est résolue.

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo