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 :

JBoss 4.2.3 javax.naming.NameNotFoundException: Bean not bound


Sujet :

Wildfly/JBoss Java

  1. #1
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    19
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 19
    Points : 15
    Points
    15
    Par défaut JBoss 4.2.3 javax.naming.NameNotFoundException: Bean not bound
    Bonjour à tous,

    je crée une application web avec des EJB3 et du coté présentation JSF1.2/Facelet et donc des Managed Beans.
    J'utilise JBOSS 4.2.3 comme serveur d'application.

    J'ai un problème récurrent et que je ne parviens pas à résoudre malgré mon écumage des forums: la fameuse erreur "javax.naming.NameNotFoundException: TirrageBean not bound" où TirrageBean est le nom de mon EJB.

    log JBoss:

    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    20:34:43,821 INFO  [Server] Starting JBoss (MX MicroKernel)...
    20:34:43,826 INFO  [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)
    20:34:43,828 INFO  [Server] Home Dir: /home/nvitale/Bureau/jboss-4.2.3.GA
    20:34:43,828 INFO  [Server] Home URL: file:/home/nvitale/Bureau/jboss-4.2.3.GA/
    20:34:43,829 INFO  [Server] Patch URL: null
    20:34:43,829 INFO  [Server] Server Name: default
    20:34:43,829 INFO  [Server] Server Home Dir: /home/nvitale/Bureau/jboss-4.2.3.GA/server/default
    20:34:43,829 INFO  [Server] Server Home URL: file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/
    20:34:43,829 INFO  [Server] Server Log Dir: /home/nvitale/Bureau/jboss-4.2.3.GA/server/default/log
    20:34:43,830 INFO  [Server] Server Temp Dir: /home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp
    20:34:43,830 INFO  [Server] Root Deployment Filename: jboss-service.xml
    20:34:44,784 INFO  [ServerInfo] Java version: 1.6.0_07,Sun Microsystems Inc.
    20:34:44,785 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 10.0-b23,Sun Microsystems Inc.
    20:34:44,785 INFO  [ServerInfo] OS-System: Linux 2.6.24-22-generic,i386
    20:34:45,507 INFO  [Server] Core system initialized
    20:34:49,488 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083/
    20:34:49,492 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
    20:34:50,513 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
    20:34:50,513 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
    20:34:50,807 INFO  [TransactionManagerService] Starting recovery manager
    20:34:51,441 INFO  [TransactionManagerService] Recovery manager started
    20:34:51,441 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
    20:34:55,476 INFO  [EJB3Deployer] Starting java:comp multiplexer
    20:34:59,152 INFO  [NativeServerConfig] JBoss Web Services - Native
    20:34:59,152 INFO  [NativeServerConfig] jbossws-3.0.1-native-2.0.4.GA (build=200803312044)
    20:35:00,658 INFO  [Embedded] Catalina naming disabled
    20:35:01,257 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/../lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib
    20:35:01,372 INFO  [Http11Protocol] Initialisation de Coyote HTTP/1.1 sur http-127.0.0.1-8080
    20:35:01,373 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
    20:35:01,373 INFO  [Catalina] Initialization processed in 714 ms
    20:35:01,373 INFO  [StandardService] Démarrage du service jboss.web
    20:35:01,384 INFO  [StandardEngine] Starting Servlet Engine: JBossWeb/2.0.1.GA
    20:35:01,444 INFO  [Catalina] Server startup in 71 ms
    20:35:01,862 INFO  [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jboss-web.deployer/ROOT.war/
    20:35:03,120 INFO  [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
    20:35:03,322 INFO  [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../deploy/jbossws.sar/jbossws-context.war/
    20:35:04,266 INFO  [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    20:35:05,227 INFO  [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
    20:35:05,776 INFO  [MailService] Mail Service bound to java:/Mail
    20:35:05,994 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
    20:35:06,035 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
    20:35:06,074 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
    20:35:06,143 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
    20:35:06,225 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
    20:35:06,255 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
    20:35:06,367 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/quartz-ra.rar
    20:35:06,377 INFO  [QuartzResourceAdapter] start quartz!!!
    20:35:06,455 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
    20:35:06,493 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
    20:35:06,497 INFO  [RAMJobStore] RAMJobStore initialized.
    20:35:06,497 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
    20:35:06,497 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
    20:35:06,498 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
    20:35:08,534 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
    20:35:08,981 INFO  [A] Bound to JNDI name: queue/A
    20:35:08,983 INFO  [B] Bound to JNDI name: queue/B
    20:35:08,985 INFO  [C] Bound to JNDI name: queue/C
    20:35:08,986 INFO  [D] Bound to JNDI name: queue/D
    20:35:08,988 INFO  [ex] Bound to JNDI name: queue/ex
    20:35:09,017 INFO  [testTopic] Bound to JNDI name: topic/testTopic
    20:35:09,019 INFO  [securedTopic] Bound to JNDI name: topic/securedTopic
    20:35:09,022 INFO  [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
    20:35:09,027 INFO  [testQueue] Bound to JNDI name: queue/testQueue
    20:35:09,076 INFO  [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
    20:35:09,143 INFO  [DLQ] Bound to JNDI name: queue/DLQ
    20:35:09,313 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
    20:35:09,922 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateful.StatefulContainer
    20:35:09,931 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=EJB_Metier_Stateful.jar,name=Tirrage,service=EJB3 with dependencies:
    20:35:09,999 INFO  [EJBContainer] STARTED EJB: com.et.TirrageBean ejbName: Tirrage
    20:35:10,113 INFO  [EJB3Deployer] Deployed: file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/deploy/EJB_Metier_Stateful.jar
    20:35:11,043 INFO  [TomcatDeployer] deploy, ctxPath=/PresentationJSF, warUrl=.../tmp/deploy/tmp65391PresentationJSF-exp.war/
    20:35:15,166 INFO  [CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
    20:35:15,170 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {org.richfaces.SKIN=blueSky, com.sun.faces.injectionProvider=org.jboss.web.jsf.integration.injection.JBossInjectionProvider, javax.faces.DEFAULT_SUFFIX=.xhtml}
    20:35:15,170 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
    20:35:15,230 INFO  [CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
    20:35:15,231 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {org.richfaces.SKIN=blueSky, com.sun.faces.injectionProvider=org.jboss.web.jsf.integration.injection.JBossInjectionProvider, javax.faces.DEFAULT_SUFFIX=.xhtml}
    20:35:15,231 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
    20:35:15,342 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
    20:35:16,273 INFO  [Http11Protocol] Démarrage de Coyote HTTP/1.1 sur http-127.0.0.1-8080
    20:35:16,379 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
    20:35:16,460 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)] Started in 32s:628ms
    20:35:19,869 ERROR [STDERR] 3 janv. 2009 20:35:19 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
    20:35:19,877 ERROR [STDERR] 3 janv. 2009 20:35:19 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
    20:35:19,908 ERROR [STDERR] 3 janv. 2009 20:35:19 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
    20:35:19,940 ERROR [STDERR] 3 janv. 2009 20:35:19 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
    20:35:19,946 ERROR [STDERR] 3 janv. 2009 20:35:19 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
    20:35:20,017 ERROR [STDERR] 3 janv. 2009 20:35:20 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/a4j.taglib.xml
    20:35:20,030 ERROR [STDERR] 3 janv. 2009 20:35:20 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/ajax4jsf.taglib.xml
    20:35:20,038 ERROR [STDERR] 3 janv. 2009 20:35:20 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/jsp.taglib.xml
    20:35:20,091 ERROR [STDERR] 3 janv. 2009 20:35:20 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/rich.taglib.xml
    20:35:20,100 ERROR [STDERR] 3 janv. 2009 20:35:20 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
    INFO: Added Library from: jar:file:/home/nvitale/Bureau/jboss-4.2.3.GA/server/default/tmp/deploy/tmp65391PresentationJSF-exp.war/WEB-INF/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/richfaces.taglib.xml
    20:35:20,581 INFO  [[/PresentationJSF]] Attribute disableInInputTypes='all' will be ignored for component 'j_id8', because value of disableInInput attribute is not 'true'
    20:35:20,582 INFO  [[/PresentationJSF]] Attribute disableInInputTypes='all' will be ignored for component 'j_id9', because value of disableInInput attribute is not 'true'
    20:35:23,956 INFO  [[/PresentationJSF]] Attribute disableInInputTypes='all' will be ignored for component 'j_id4', because value of disableInInput attribute is not 'true'
    20:35:23,958 INFO  [[/PresentationJSF]] Attribute disableInInputTypes='all' will be ignored for component 'j_id5', because value of disableInInput attribute is not 'true'
    20:35:23,961 INFO  [[/PresentationJSF]] Attribute disableInInputTypes='all' will be ignored for component 'j_id6', because value of disableInInput attribute is not 'true'
    20:35:23,962 INFO  [[/PresentationJSF]] Attribute disableInInputTypes='all' will be ignored for component 'j_id7', because value of disableInInput attribute is not 'true'
    20:35:28,485 ERROR [STDERR] javax.naming.NameNotFoundException: TirrageBean not bound
    20:35:28,486 ERROR [STDERR] 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    20:35:28,486 ERROR [STDERR] 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    20:35:28,486 ERROR [STDERR] 	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    20:35:28,486 ERROR [STDERR] 	at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
    20:35:28,486 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    20:35:28,486 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    20:35:28,486 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    20:35:28,486 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    20:35:28,486 ERROR [STDERR] 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    20:35:28,486 ERROR [STDERR] 	at sun.rmi.transport.Transport$1.run(Transport.java:159)
    20:35:28,486 ERROR [STDERR] 	at java.security.AccessController.doPrivileged(Native Method)
    20:35:28,486 ERROR [STDERR] 	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    20:35:28,487 ERROR [STDERR] 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    20:35:28,487 ERROR [STDERR] 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    20:35:28,487 ERROR [STDERR] 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    20:35:28,487 ERROR [STDERR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    20:35:28,487 ERROR [STDERR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    20:35:28,487 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:619)
    20:35:28,487 ERROR [STDERR] 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
    20:35:28,487 ERROR [STDERR] 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
    20:35:28,487 ERROR [STDERR] 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
    20:35:28,487 ERROR [STDERR] 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
    20:35:28,487 ERROR [STDERR] 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
    20:35:28,487 ERROR [STDERR] 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
    20:35:28,488 ERROR [STDERR] 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
    20:35:28,488 ERROR [STDERR] 	at Lettres.tirreConsonne(Lettres.java:19)
    20:35:28,488 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    20:35:28,488 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    20:35:28,488 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    20:35:28,488 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    20:35:28,488 ERROR [STDERR] 	at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
    20:35:28,488 ERROR [STDERR] 	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    20:35:28,488 ERROR [STDERR] 	at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
    20:35:28,488 ERROR [STDERR] 	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
    20:35:28,488 ERROR [STDERR] 	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    20:35:28,488 ERROR [STDERR] 	at javax.faces.component.UICommand.broadcast(UICommand.java:387)
    20:35:28,488 ERROR [STDERR] 	at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
    20:35:28,488 ERROR [STDERR] 	at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
    20:35:28,489 ERROR [STDERR] 	at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
    20:35:28,489 ERROR [STDERR] 	at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
    20:35:28,489 ERROR [STDERR] 	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
    20:35:28,489 ERROR [STDERR] 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    20:35:28,489 ERROR [STDERR] 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    20:35:28,489 ERROR [STDERR] 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    20:35:28,489 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    20:35:28,489 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    20:35:28,489 ERROR [STDERR] 	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
    20:35:28,489 ERROR [STDERR] 	at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
    20:35:28,489 ERROR [STDERR] 	at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
    20:35:28,489 ERROR [STDERR] 	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
    20:35:28,489 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    20:35:28,489 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    20:35:28,490 ERROR [STDERR] 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    20:35:28,490 ERROR [STDERR] 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    20:35:28,490 ERROR [STDERR] 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    20:35:28,490 ERROR [STDERR] 	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    20:35:28,490 ERROR [STDERR] 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    20:35:28,490 ERROR [STDERR] 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    20:35:28,490 ERROR [STDERR] 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    20:35:28,491 ERROR [STDERR] 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    20:35:28,506 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:619)
    Je travaille sur deux projets sur Eclipse Ganymède: un nommé "EJB_Metier_Stateful" qui contient comme son nom l'indique l'EJB TirrageBean dont voici le code:

    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    package com.et;
     
    import java.util.Random;
    import javax.ejb.Remote;
    import javax.ejb.Remove;
    import javax.ejb.Stateful;
     
     
    //import javax.ejb.Stateless;
     
     
    /**
     * Session Bean implementation class Tirrage
     */
    @Stateful(name="Tirrage")
    @Remote(Tirrage.class)
    public class TirrageBean implements Tirrage {
     
    	private int nbLettre=0;
    	private  char tabLettres[]=new char[7];
     
     
    	public char getTabLettres(int n) {
    		return tabLettres[n];
    	}
     
    	public void setTabLettres(char[] tabLettres) {
    		this.tabLettres = tabLettres;
    	}
     
    	public int getNbLettre() {
    		return nbLettre;
    	}
     
    	public void setNbLettre(int nbLettre) {
    		this.nbLettre = nbLettre;
    	}
     
    	public char[] TirrageLettre(boolean isConsonne) {
        	char lettre;
        	String voyelle = "aeiouy";
            String consonne = "bcdfghjklmnpqrstvwxz";
     
    	    Random random= new Random(System.currentTimeMillis());
     
    	    if (isConsonne) lettre= consonne.charAt(random.nextInt(19));
    	    else lettre= voyelle.charAt(random.nextInt(5));
    	    tabLettres[nbLettre]=lettre;
    	    nbLettre++;
    	    return tabLettres;
    	}
     
    	@Remove
    	public void remove()
    	{
    		System.out.println("Session bean supprimé");
    	}
     
     
    }
    et son interface nommé Tirrage:

    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
     
    package com.et;
     
    import javax.ejb.Remote;
    import javax.ejb.Remove;
     
    @Remote
    public interface Tirrage {
       int nbLettre=0;
       char tabLettres[]=new char[7];
       public  char[] TirrageLettre(boolean isConsonne);
       public  int getNbLettre();
       public  void setNbLettre(int nbLettre);
       public  char getTabLettres(int n);
       public  void setTabLettres(char[] tabLettres);
       @Remove
       public void remove();
    }
    L'erreur JBOSSintervient lorsqu'un appel est effectué à cet EJB via la page JSF et son managed bean nommé Lettres:

    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.et.Tirrage;
    
    
    public class Lettres {
    	
    	private  char tabLettres[]=new char[7];
    	private char lettre = 'a';
    	
    	public String tirreConsonne(){
    		int compteur;
    		System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    		System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
    		System.setProperty("java.naming.provider.url", "jnp://localhost:1099");
    	    try{	     	  
    	    	  Context context = new InitialContext();
    	          Tirrage beanRemote = (Tirrage)
    	          context.lookup("TirrageBean/remote");
    	          tabLettres=beanRemote.TirrageLettre(true);
    	          
    	          compteur=beanRemote.getNbLettre();
    	          if (compteur>=6) return "finTirrage";
    	          else return "continuerTirrage";
    	          
    	    }
    	    catch(Exception e) {
    	         e.printStackTrace();
    	         return "erreur";
    	      }
    	}
    	
    	public String tirreVoyelle(){
    		int compteur;
    			    	  
    		System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    		System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
    		System.setProperty("java.naming.provider.url", "localhost:1099");
    	    try{	     	  
    	    	  Context context = new InitialContext();
    	          Tirrage beanRemote = (Tirrage)
    	          context.lookup("TirrageBean/remote");
    	          tabLettres=beanRemote.TirrageLettre(false);
    	          
    	          compteur=beanRemote.nbLettre;
    	          if (compteur>=6) return "finTirrage";
    	          else return "continuerTirrage";
    	          
    	    }
    	    catch(Exception e) {
    	         e.printStackTrace();
    	         return "erreur";
    	      }
    
    	}
    
    	public void setTabLettres(char tabLettres[]) {
    		this.tabLettres = tabLettres;
    	}
    
    	public char[] getTabLettres() {
    		return tabLettres;
    	}
    
    	public void setLettre(char lettre) {
    		this.lettre = lettre;
    	}	public char getLettre() {
    		return lettre;
    	}
    	
    	
    }
    Vous pouvez voir en rouge que je mets bien les propriétés.

    Voici un extrat de la page JSF faisant appel au managed beans:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     <h:form id="choix">
    	  		<h:commandButton id="choixconsonne" action="#{LaLettres.tirreConsonne}" value="consonne (fleche haut)" ></h:commandButton>
    	  		<br> </br> 
    	  		<h:commandButton id="choixvoyelle" action="#{LaLettres.tirreVoyelle}" value="voyelle (fleche bas)"></h:commandButton> 
    	  	</h:form>
    et la définition du managed beans dans le faces-config.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <managed-bean>
        	<managed-bean-name>LaLettres</managed-bean-name>
        	<managed-bean-class>Lettres</managed-bean-class>
        	<managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    Pour finir voici mon Global JNDI namespace que j'ai récupéré via JBoss avec en rouge ce qui concerne mon EJB (JndiView, dans la jmx-console):

    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
      +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
      +- jmx (class: org.jnp.interfaces.NamingContext)
      |   +- invoker (class: org.jnp.interfaces.NamingContext)
      |   |   +- RMIAdaptor (proxy: $Proxy47 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
      |   +- rmi (class: org.jnp.interfaces.NamingContext)
      |   |   +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
      +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
      +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
      +- UserTransactionSessionFactory (proxy: $Proxy15 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
      +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
      +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
      +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
      +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
      +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
      +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
      +- queue (class: org.jnp.interfaces.NamingContext)
      |   +- A (class: org.jboss.mq.SpyQueue)
      |   +- testQueue (class: org.jboss.mq.SpyQueue)
      |   +- ex (class: org.jboss.mq.SpyQueue)
      |   +- DLQ (class: org.jboss.mq.SpyQueue)
      |   +- D (class: org.jboss.mq.SpyQueue)
      |   +- C (class: org.jboss.mq.SpyQueue)
      |   +- B (class: org.jboss.mq.SpyQueue)
      +- topic (class: org.jnp.interfaces.NamingContext)
      |   +- testDurableTopic (class: org.jboss.mq.SpyTopic)
      |   +- testTopic (class: org.jboss.mq.SpyTopic)
      |   +- securedTopic (class: org.jboss.mq.SpyTopic)
      +- console (class: org.jnp.interfaces.NamingContext)
      |   +- PluginManager (proxy: $Proxy48 implements No ClassLoaders found for: org.jboss.console.manager.PluginManagerMBean (no security manager: RMI class loader disabled))
      +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
      +- Tirrage (class: org.jnp.interfaces.NamingContext)
      |   +- remote (class: java.lang.Object)
      |   +- remoteStatefulProxyFactory (proxy: $Proxy66 implements interface org.jboss.ejb3.ProxyFactory)
      +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
      +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
      +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
      +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
    Je bloque depuis un nombre d'heures que je ne compte plus et si quelqu'un pouvait me donner un coup de main je luis en serais très reconnaissant...

    Cordialement,

    Altaïr

  2. #2
    Membre habitué Avatar de sewatech
    Inscrit en
    Février 2007
    Messages
    141
    Détails du profil
    Informations personnelles :
    Âge : 54

    Informations forums :
    Inscription : Février 2007
    Messages : 141
    Points : 166
    Points
    166
    Par défaut
    As-tu regardé ce que tu as dans ton registre JNDI, avec le MBean JndiView, dans la jmx-console ?

  3. #3
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    19
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 19
    Points : 15
    Points
    15
    Par défaut
    Bonjour,

    tu parles de ce que je viens de rajouter à la fin du message précédent? (que j'ai du éditer pendant que tu lisais...)
    Pour le MBean, je ne sais pas trop ce que tu veux...

    Merci à toi.

  4. #4
    Membre habitué Avatar de sewatech
    Inscrit en
    Février 2007
    Messages
    141
    Détails du profil
    Informations personnelles :
    Âge : 54

    Informations forums :
    Inscription : Février 2007
    Messages : 141
    Points : 166
    Points
    166
    Par défaut
    Oui, c'est ça

    Je pense que ton soucis vient du fait que ton bean s'appelle Tirrage et que tu fais un lookup sur TirrageBean.

  5. #5
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    19
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 19
    Points : 15
    Points
    15
    Par défaut
    Tirrage est l'interface et TirrageBean le Bean. Il faut faire le lookup sur l'interface?

  6. #6
    Membre habitué Avatar de sewatech
    Inscrit en
    Février 2007
    Messages
    141
    Détails du profil
    Informations personnelles :
    Âge : 54

    Informations forums :
    Inscription : Février 2007
    Messages : 141
    Points : 166
    Points
    166
    Par défaut
    Dans ton bean, tu as annoté ton bean avec @Stateful(name="Tirrage"). C'est sur ce nom que tu fais un lookup.

    En fait, le lookup porte sur un nom du registre JNDI, et JNDIView nous montre bien que c'est Tirrage qui a été déclaré.

  7. #7
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    19
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 19
    Points : 15
    Points
    15
    Par défaut
    Bon en tout cas, ça a l'air de marcher maintenant...
    Tu as toute ma gratutude te mon immense respect

  8. #8
    Nouveau Candidat au Club
    Inscrit en
    Mai 2009
    Messages
    1
    Détails du profil
    Informations forums :
    Inscription : Mai 2009
    Messages : 1
    Points : 1
    Points
    1
    Par défaut aider moi
    Bonjour à tous,

    je crée une application web avec des EJB3 et du coté présentation JSF1.2/Facelet et donc des Managed Beans.
    J'utilise JBOSS 4.2.3 comme serveur d'application.

    J'ai un problème récurrent et que je ne parviens pas à résoudre
    l'erreur "javax.naming.NameNotFoundException: TirrageBean not bound" où TirrageBean est le nom de mon EJB.
    voici log jboss:
    ERROR [JBossInjectionProvider] Injection failed on managed bean.
    javax.naming.NameNotFoundException: service not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.catalina.util.DefaultAnnotationProcessor.lookupFieldResource(DefaultAnnotationProcessor.java:201)
    at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:139)
    at org.jboss.web.jsf.integration.injection.JBossInjectionProvider.inject(JBossInjectionProvider.java:104)
    at com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:203)
    at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:107)
    at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:222)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:88)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
    at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:86)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
    at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
    at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
    at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Unknown Source)

    voici le code de mon bean(jsf):
    package jsf;


    import java.util.Date;

    import persistence.Address;
    import persistence.Customer;
    import stateless.CustomerLocal;

    import javax.annotation.Resource;
    import javax.ejb.EJB;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;

    /**
    *
    */
    public class AccountController extends Controller {

    // ======================================
    // = Attributs =
    // ======================================

    @EJB(name = "EAR_project/CustomerBean/local")

    private CustomerLocal customerBean;

    private final String cname = this.getClass().getName();

    private Long id;
    private String firstname;
    private String lastname;
    private String telephone;
    private String email;
    private Date dateDeDepot;

    public Date getDateDeDepot() {
    return dateDeDepot;
    }

    public void setDateDeDepot(Date dateDeDepot) {
    this.dateDeDepot = dateDeDepot;
    }

    public Long getId() {
    return id;
    }

    public void setId(Long id) {
    this.id = id;
    }

    public String getFirstname() {
    return firstname;
    }

    public void setFirstname(String firstname) {
    this.firstname = firstname;
    }

    public String getLastname() {
    return lastname;
    }

    public void setLastname(String lastname) {
    this.lastname = lastname;
    }

    public String getTelephone() {
    return telephone;
    }

    public void setTelephone(String telephone) {
    this.telephone = telephone;
    }

    public String getEmail() {
    return email;
    }

    public void setEmail(String email) {
    this.email = email;
    }

    private String login;
    private String password;
    private String password2;
    private Customer customer = new Customer();
    private Address homeAddress = new Address();


    //Methode
    public String doSignIn() {
    final String mname = "doSignIn";
    logger.entering(cname, mname);

    String navigateTo =null;


    try {
    customer = customerBean.authenticate(login, password);
    homeAddress = customer.getHomeAddress();
    navigateTo = "customer.signed.in";
    } catch (Exception e) {
    addMessage(cname, mname, e);
    }

    logger.exiting(cname, mname, navigateTo);
    return navigateTo;
    }

    public String doCreateNewAccount() {
    final String mname = "doCreateNewAccount";
    logger.entering(cname, mname);

    String navigateTo = null;

    // Id and password must be filled
    if ("".equals(customer.getLogin()) || "".equals(customer.getPassword()) || "".equals(password2)) {
    addWarningMessage("Identifiant et mot de passe doivent être rempli");
    navigateTo = null;

    } else if (!customer.getPassword().equals(password2)) {
    addWarningMessage("Les deux mots de passe entrés doivent être les mêmes");
    navigateTo = null;

    } else {
    navigateTo = "create.a.new.account";
    }

    logger.exiting(cname, mname, navigateTo);
    return navigateTo;
    }

    public String doCreateCustomer() {
    final String mname = "doCreateCustomer";
    logger.entering(cname, mname);

    String navigateTo = null;

    try {
    // Creer utilisateur
    customer = customerBean.createCustomer(customer, homeAddress);
    homeAddress = customer.getHomeAddress();
    navigateTo = "customer.created";
    // System.out.println("ok");
    } catch (Exception e) {
    //System.out.println("oups");
    addMessage(cname, mname, e);

    }

    logger.exiting(cname, mname, navigateTo);
    return navigateTo;
    }

    public String doUpdateAccount() {
    final String mname = "doUpdateAccount";
    logger.entering(cname, mname);

    String navigateTo = null;

    try {
    // Updates the customer
    customer = customerBean.updateCustomer(customer, homeAddress);
    homeAddress = customer.getHomeAddress();
    navigateTo = "account.updated";
    } catch (Exception e) {
    addMessage(cname, mname, e);
    }

    logger.exiting(cname, mname, navigateTo);
    return navigateTo;
    }

    public String doSignOff() {
    final String mname = "doSignOff";
    logger.entering(cname, mname);

    String navigateTo = "signoff";

    FacesContext fc = FacesContext.getCurrentInstance();
    HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
    session.invalidate();

    logger.exiting(cname, mname, navigateTo);
    return navigateTo;
    }


    public String getLogin() {
    return login;
    }

    public void setLogin(String login) {
    this.login = login;
    }

    public String getPassword() {
    return password;
    }

    public void setPassword(String password) {
    this.password = password;
    }

    public String getPassword2() {
    return password2;
    }

    public void setPassword2(String password2) {
    this.password2 = password2;
    }

    public Customer getCustomer() {
    return customer;
    }

    public void setCustomer(Customer customer) {
    this.customer = customer;
    }

    public Address getHomeAddress() {
    return homeAddress;
    }

    public void setHomeAddress(Address homeAddress) {
    this.homeAddress = homeAddress;
    }



    }
    voici le code de l'interface CustomerLocal de l'EJB CustomerBean:
    package service;


    import persistence.Address;
    import persistence.Customer;

    import javax.ejb.Local;

    /**
    *
    */
    @Local
    public interface CustomerLocal {


    // ======================================
    // = Methodes publiques =
    // ======================================
    Customer authenticate(String login, String password);

    Customer createNewAccount (String login, String password );


    Customer createCustomer(Customer customer, Address homeAddress);

    Customer findCustomer(Long customerId);

    Customer updateCustomer(Customer customer, Address homeAddress);
    }
    voici le code de l'EJB Customer:
    package persistence;

    import persistence.Address;
    import persistence.ValidationException;

    import javax.persistence.*;
    import java.io.Serializable;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;

    /**
    * Cette classe représente un utilisateur Guichet Unique Virtuel.
    *
    *
    * @voir GUV.persistence.Address
    */

    @Entity
    @Table(schema="messagerie")
    public class Customer implements Serializable {

    /**
    *
    */
    private static final long serialVersionUID = 1L;
    /**
    *
    */
    // ======================================
    // = Attributs =
    // ======================================
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Column(unique = true, nullable = false, length = 8)
    private String login;
    @Column(nullable = false, length = 8)
    private String password;
    @Column(nullable = false, length = 30)
    private String firstname;
    @Column(nullable = false, length = 30)
    private String lastname;
    private String telephone;
    private String email;
    @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumn(name = "address_fk", nullable = true)
    private Address homeAddress;
    @Column(name = "date_de_depot")
    @Temporal(TemporalType.DATE)
    private Date dateDeDepot;
    @Transient
    private Integer dateDepot;

    // ======================================
    // = Constructeurs =
    // ======================================
    public Customer() {
    }

    public Customer(String firstname, String lastname) {
    this.firstname = firstname;
    this.lastname = lastname;
    }

    // ======================================
    // = Methodes Lifecycle Callback =
    // ======================================
    @PrePersist
    @PreUpdate
    private void validateData() {
    if (firstname == null || "".equals(firstname))
    throw new ValidationException("Invalid first name");
    if (lastname == null || "".equals(lastname))
    throw new ValidationException("Invalid last name");
    if (login == null || "".equals(login))
    throw new ValidationException("Invalid login");
    if (password == null || "".equals(password))
    throw new ValidationException("Invalid password");
    }

    /**
    * Cette méthode calcul date de depot du client.
    */
    @PostLoad
    @PostPersist
    @PostUpdate
    public void calculateDepot() {
    if (dateDeDepot == null) {
    dateDepot = null;
    return;
    }

    Calendar datDepot = new GregorianCalendar();
    datDepot.setTime(dateDeDepot);
    Calendar now = new GregorianCalendar();
    now.setTime(new Date());
    int adjust = 0;
    if (now.get(Calendar.DAY_OF_YEAR) - datDepot.get(Calendar.DAY_OF_YEAR) < 0) {
    adjust = -1;
    }
    dateDepot = now.get(Calendar.YEAR) - datDepot.get(Calendar.YEAR) + adjust;
    }

    // ======================================
    // = Methodes publiques =
    // ======================================

    /**
    * Given a password, this method then checks if it matches the user
    *
    * @param pwd
    * @throws ValidationException thrown if the password is empty or different than the one
    * store in database
    */
    public void matchPassword(String pwd) {
    if (pwd == null || "".equals(pwd))
    throw new ValidationException("Mot de passe Invalid ");

    // The password entered by the customer is not the same stored in database
    if (!pwd.equals(password))
    throw new ValidationException("Passwords doen't match");
    }

    // ======================================
    // = Accesseurs =
    // ======================================

    public Long getId() {
    return id;
    }

    public String getLogin() {
    return login;
    }

    public void setLogin(String login) {
    this.login = login;
    }

    public String getPassword() {
    return password;
    }

    public void setPassword(String password) {
    this.password = password;
    }

    public String getFirstname() {
    return firstname;
    }

    public void setFirstname(String firstname) {
    this.firstname = firstname;
    }

    public String getLastname() {
    return lastname;
    }

    public void setLastname(String lastname) {
    this.lastname = lastname;
    }

    public String getTelephone() {
    return telephone;
    }

    public void setTelephone(String telephone) {
    this.telephone = telephone;
    }

    public String getEmail() {
    return email;
    }

    public void setEmail(String email) {
    this.email = email;
    }


    public Address getHomeAddress() {
    return homeAddress;
    }

    public void setHomeAddress(Address homeAddress) {
    this.homeAddress = homeAddress;
    }

    public Date getDateDeDepot() {
    return dateDeDepot;
    }

    public void setDateDeDepot(Date dateDeDepot) {
    this.dateDeDepot = dateDeDepot;
    }

    public Integer getDateDepot() {
    return dateDepot;
    }
    public void setDateDepot(Integer dateDepot) {
    this.dateDepot = dateDepot;
    }
    // ======================================
    // = Methodes hash, equals, toString =
    // ======================================
    @Override
    public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Customer customer = (Customer) o;

    if (dateDeDepot != null ? !dateDepot.equals(customer.dateDeDepot) : customer.dateDeDepot != null)
    return false;
    if (email != null ? !email.equals(customer.email) : customer.email != null) return false;
    if (!firstname.equals(customer.firstname)) return false;
    if (!id.equals(customer.id)) return false;
    if (!lastname.equals(customer.lastname)) return false;
    if (!login.equals(customer.login)) return false;
    if (!password.equals(customer.password)) return false;
    if (telephone != null ? !telephone.equals(customer.telephone) : customer.telephone != null) return false;

    return true;
    }

    @Override
    public int hashCode() {
    int result;
    result = id.hashCode();
    result = 31 * result + login.hashCode();
    result = 31 * result + password.hashCode();
    result = 31 * result + firstname.hashCode();
    result = 31 * result + lastname.hashCode();
    result = 31 * result + (telephone != null ? telephone.hashCode() : 0);
    result = 31 * result + (email != null ? email.hashCode() : 0);
    result = 31 * result + (dateDepot != null ? dateDeDepot.hashCode() : 0);
    return result;
    }

    @Override
    public String toString() {
    final StringBuilder sb = new StringBuilder();
    sb.append("Customer");
    sb.append("{id=").append(id);
    sb.append(", login='").append(login).append('\'');
    sb.append(", password='").append(password).append('\'');
    sb.append(", firstname='").append(firstname).append('\'');
    sb.append(", lastname='").append(lastname).append('\'');
    sb.append(", telephone='").append(telephone).append('\'');
    sb.append(", email='").append(email).append('\'');
    sb.append(", homeAddress=").append(homeAddress);
    sb.append(", dateDeDepot=").append(dateDeDepot);
    sb.append(", dateDepot=").append(dateDepot);
    sb.append('}');
    return sb.toString();
    }
    }
    Voici un extrat de la page JSF faisant appel au managed beans:
    <TD align=right><B>Login :</B></TD>
    <TD>
    <h:inputText value="#{account.login}" maxlength="10" size="12"/>
    </TD>
    </TR>
    <TR>
    <TD align=right><B>Password:</B></TD>
    <TD>
    <h:inputSecret value="#{account.password}" maxlength="10" size="12"/>
    </TD>
    </TR>
    <TR>
    <TD align=middle colSpan=2>
    <h:commandButton value="Se Connecter"
    action="#{account.doSignIn}"
    type="submit"/>
    </TD>
    </TR>
    </TABLE>
    </h:form>
    voici le code de persistence.xml car je n'arrive pas a persister les données ecrites dans les pages JSF:


    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="demoPU">
    <jta-data-source>java:/MySqlDS</jta-data-source>
    <class>persistence.Customer</class>
    <class>persistence.Address</class>


    <properties>
    <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
    <property name="hibernate.show_sql" value="true" />
    <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
    </properties>
    </persistence-unit>
    </persistence>
    s'il vous plait aider moi

Discussions similaires

  1. javax.naming.NameNotFoundException: remote not bound
    Par iMacXus dans le forum Wildfly/JBoss
    Réponses: 12
    Dernier message: 07/10/2011, 00h51
  2. Réponses: 9
    Dernier message: 05/06/2010, 23h04
  3. javax.naming.NameNotFoundException: LocalMonBean not bound
    Par neyo_am dans le forum Wildfly/JBoss
    Réponses: 7
    Dernier message: 22/07/2009, 00h25
  4. [JNDI] javax.naming.NameNotFoundException: PremierEJB3 not bound
    Par champion dans le forum Java EE
    Réponses: 2
    Dernier message: 19/02/2008, 12h03
  5. [EJB Stateless] javax.naming.NameNotFoundException: ejb not bound
    Par slymira dans le forum Java EE
    Réponses: 18
    Dernier message: 04/07/2005, 16h30

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