This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250154 - Why this version of 8.0.2 can not get the JMSContext in a Servlet by resource injection method?
Summary: Why this version of 8.0.2 can not get the JMSContext in a Servlet by resource...
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 8.0.2
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords: PLATFORM
Depends on:
Blocks:
 
Reported: 2015-02-02 08:45 UTC by sxsuh_cn
Modified: 2015-05-20 12:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE 日志 (100.42 KB, text/plain)
2015-02-02 08:45 UTC, sxsuh_cn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sxsuh_cn 2015-02-02 08:45:13 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.7.0_51
Runtime = Java HotSpot(TM) Client VM 24.51-b03

Why not the @Inject work? But it is correctly worked in NetBeans 8.0.
 
In NetBean 8.0.2, I create a message driven bean(mdb) in a ejb module, and create a servlet to send a message to the mdb. 
But I find that the JMSContext object is null by using resource injection method. 
I have already added a "beans.xml" to the web module( put it in WEB-INF folder).
Here the Inject codes are:
  @Inject
  @JMSConnectionFactory("java:comp/DefaultJMSConnectionFactory")
  private JMSContext context;
the context is a null. why not work?

If I do not use the @Inject, it works well. Here the codes are:
    @Resource(lookup = "java:comp/DefaultJMSConnectionFactory")
    javax.jms.ConnectionFactory connectionFactory;
	... I create connection , start connection , create session, create producer, send message ..... it work well.

ps: this is my first time to submit the question task about netbeasn, if you have answers plase replay to me, thanks.
Comment 1 sxsuh_cn 2015-02-02 08:45:20 UTC
Created attachment 151775 [details]
IDE 日志
Comment 2 Petr Hejl 2015-05-20 12:49:10 UTC
This is not a NetBeans issue. Reported to GF: https://java.net/jira/browse/GLASSFISH-21362