  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | JNDI lookup of DataSource by message-driven bean | JNDI lookup of DataSource by message-driven bean 2004-06-12 - By Tim Wood
Back "Advanced" situation here. My application (in Sun's J2EE SDK 1.4) consists of several stateless session beans (SSB), defined as SOAP endpoints, and 2 message -driven beans (MDB) used internally. One class (com.myapp.orderServer.jaxRPC .dblDuty.Impl) does double duty as an SSB and as an MDB (one instance for each bean is created).
All the beans use JNDI to locate a JDBC DataSource that each uses for DBMS transactions. If the MDB instance of dblDuty.Impl gets control first, its JNDI lookup for the DataSource fails with the log messages below. The bean business logic thus fails to initialize and the system can't run. My workaround is to "prime" the system by "ping"ing the SSBs via SOAP when the app. is started, so the DataSources are first looked up in the SSBs. Then all beans start and run fine. All the beans are configured in the deployment descriptor to use the right resources. So why does it matter to JNDI which bean calls it for a lookup first??
Thanks, Tim
javax.naming.NamingException : invocation exception at com.sun.enterprise.naming.NamingManagerImpl.getComponentId (NamingManagerImpl.java:959) at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl .java:658) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext .java:108) at javax.naming.InitialContext (InitialContext.java:347) at com.myapp.orderServer.impl.DatabaseConnectionPool .provideFacetDataSource(DatabaseConnectionPool.java:118) at com.myapp.orderServer.impl.FacetImpl.initDataSource(FacetImpl.java :116) at com.myapp.orderServer.impl.DblDuty.<init>(DblDuty.java:93) at com.myapp.orderServer.impl.DblDuty<clinit>(DblDuty.java:81) at com.myapp.orderServer.jaxRPC.dblDuty.Impl.<init>(Impl.java:72) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:39) ... at com.sun.messaging.jmq.jmsclient.MessageConsumerImpl .deliverAndAcknowledge(MessageConsumerImpl.java:247) at com.sun.messaging.jmq.jmsclient.MessageConsumerImpl.onMessage (MessageConsumerImpl.java:210) at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader .java:61) at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader .java:139) at java.lang.Thread (Thread.java:534)
[#|2004-06-10T21:47:17.324-0700|SEVERE|j2ee-appserver1.4|javax.enterprise .system.container.ejb.mdb|_ThreadID=11;|MDB00042: [OrderServer:DblDutyMDB]: No invocation for message []|#]
MQRA:ML:Caught Exception from onMessage():OrderServer:DblDutyMDB: message -driven bean invocation closed by container [#|2004-06-10T21:47:17.414-0700|INFO|j2ee-appserver1.4|javax.enterprise.system .container.web|_ThreadID=10;|WEB0100: Loading web module [adminapp] in virtual server [server] at [/web1]|#]
MQRA:ML:Caught Exception from onMessage():OrderServer:DblDutyMDB: message -driven bean invocation closed by container MQRA:ML:Exhausted redelivery Attempts-shutting down delivery for ActvationSpec configuration= DestinationType =javax.jms.Queue Destination =DblDuty MessageSelector =null AcknowledgeMode =Auto-acknowledge SubscriptionDurability =NonDurable ClientId =null SubscriptionName =null ConnectionFactoryJNDIName =null EndpointPoolMaxSize =32 EndpointPoolSteadySize =0 EndpointPoolResizeCount =8 EndpointPoolResizeTimeout =600 EndpointExceptionRedeliveryAttempts =1 EndpointExceptionRedeliveryInterval =100 AddressList =null
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|
 |