10:28:17,683 INFO [Ejb3Deployment] EJB3 deployment time took: 26
10:28:17,692 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=Mail-EJBModule.jar,name=MailMDB,service=EJB3 with dependencies:
10:28:17,722 INFO [EJBContainer] STARTED EJB: eu.virtualLab.mail.MailMDB ejbName: MailMDB
10:28:17,725 WARN [MessagingContainer] Could not find the queue destination-jndi-name=queue/outGoingEmail
10:28:17,727 WARN [MessagingContainer] destination not found: queue/outGoingEmail reason: javax.naming.NameNotFoundException: outGoingEmail not bound
10:28:17,729 WARN [MessagingContainer] creating a new temporary destination: queue/outGoingEmail
10:28:17,762 INFO [outGoingEmail] Bound to JNDI name: queue/outGoingEmail
10:28:17,854 INFO [EJB3Deployer] Deployed: file:/etc/jboss-4.0.5.GA/server/default/deploy/Mail-EJBModule.jar
11:27:17,659 INFO [Ejb3Deployment] EJB3 deployment time took: 66
11:27:17,670 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=Mail-EJBModule.jar,name=MailMDB,service=EJB3 with dependencies:
11:27:17,712 INFO [EJBContainer] STARTED EJB: eu.virtualLab.mail.MailMDB ejbName: MailMDB
11:27:17,760 INFO [EJB3Deployer] Deployed: file:/etc/jboss-4.0.5.GA/server/default/deploy/Mail-EJBModule.jar
11:38:55,699 INFO [ClientDeployer] Removing client ENC from: Mail-EJBModuleClient
11:38:55,737 INFO [ClientDeployer] Client ENC bound under: Mail-EJBModuleClient
11:38:56,686 ERROR [JmsServerSession] Unexpected error delivering message org.jboss.mq.SpyObjectMessage {
Header {
jmsDestination : QUEUE.outGoingEmail
jmsDeliveryMode : 2
jmsExpiration : 0
jmsPriority : 4
jmsMessageID : ID:9-11741279366781
jmsTimeStamp : 1174127936678
jmsCorrelationID: null
jmsReplyTo : null
jmsType : null
jmsRedelivered : false
jmsProperties : {sent=1174127936673}
jmsPropReadWrite: false
msgReadOnly : true
producerClientId: ID:9
}
}
java.lang.RuntimeException: java.lang.NullPointerException
at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:113)
at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:505)
at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:112)
at org.jboss.ejb3.StrictMaxPool.get(StrictMaxPool.java:122)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
trying to decode a woman mind....
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
private SessionContext context;
private javax.mail.Message msg = null;
Properties htmlTags = new Properties();
private final Logger logger = Logger.getLogger(getClass().getName());
@PostConstruct
public void initialize() {
logger.info("[initialize] PostConstruct. ok!");
Session session =(Session)context.lookup("java:comp/env/mail/Mail");
Note: To avoid collisions with names of other enterprise resources in the JNDI
namespace, and to avoid portability problems, all names in a J2EE application
should begin with the string java:comp/env.
javax.naming.NameNotFoundException: env not bound
trying to decode a woman mind....
trying to decode a woman mind....
The bean now works properly, but I don't understand what you mean with your last reply.
which additional contents should I add to the conf. file?
Is it not sufficient to match both jndi names between the configuration file and the the bean?
Note: To avoid collisions with names of other enterprise resources in the JNDI
namespace, and to avoid portability problems, all names in a J2EE application
should begin with the string java:comp/env.
Note: To avoid collisions with names of other enterprise resources in the JNDI
namespace, and to avoid portability problems, all names in a J2EE application
should begin with the string java:comp/env.
Can I ask you when I should use SessionContext object instead the Context for the lookup?
To avoid collisions with names of other enterprise resources in the JNDI
namespace it is recommended that the application should use the java:comp/env namespace which is specific to the application. Each application deployed in the application server's JVM will have its own java:/comp/env jndi namespace. This would mean that App1 deployed on the JBoss server can bind an object to "java:/comp/env/xyz" and another App2 deployed on the same JBoss server can bind a different object to the "java:/comp/env/xyz" without overwritting the object of App1. This is possible because each application will have its own java:/comp/env namespace. Now consider the same scenario in the case of java:/ namespace. As already mentioned above, the java:/ namespace is *shared* by all applications deployed on the application server. This would mean that the two applications App1 and App2 deployed on the server CANNOT bind their objects to the same jndi name java:/xyz.
trying to decode a woman mind....
That's a very big dog. I think I want to go home now and hug this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|