users@glassfish.java.net

Re: CDI Bean Injection not happening..(Only Service Injection)

From: <forums_at_java.net>
Date: Thu, 14 Mar 2013 04:28:44 -0500 (CDT)

Hi Amit, CC: Sahoo I have finished the re-factoring of your sample, and
firstly please seeing my modified sample. [Core Idea] Server Side: Using EJB
bundle + CDI Client Side: Using @OSGiService Because I used Glassfish v4
SnapShot(my built version), you can run it on Glassfish v3.x because
Glassfish OSGi-JavaEE is compatible with v3.x and basically not depends on v4
API. [Confirming Result] If you can run successfully, you should see, 1)
accessing "http://localhost:8080/CDI/message" Result: Hello Weld!0
com.amitinside.item.Item_at_1bd9301 [Value=100, Limit=200]
com.amitinside.item.Item_at_fe3e1c [Value=200, Limit=300] 2) in the server.log,
... [2013-03-14T18:20:25.109+0900] [glassfish 4.0] [WARNING] []
[org.jboss.weld.Reflection] [tid: _ThreadID=31
_ThreadName=http-listener-1(4)] [timeMillis: 1363252825109] [levelValue: 900]
[[ WELD-001450 Interceptor method public java.lang.Object
com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(javax.interceptor.InvocationContext)
throws java.lang.Throwable does not declare that it throws Exception.]]
[2013-03-14T18:20:25.125+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825125] [levelValue:
800] [[ -------------------------------------------------------]]
[2013-03-14T18:20:25.125+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825125] [levelValue:
800] [[ ------------------- 2013-03-14 18:20:25.125 -------------------]]
[2013-03-14T18:20:25.125+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825125] [levelValue:
800] [[
--------------------!!!!com.amitinside.dao.impl.DefaultItemDao$Proxy$_$$_WeldSu]]
[2013-03-14T18:20:25.171+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825171] [levelValue:
800] [[ -------------------------------------------------------]]
[2013-03-14T18:20:25.171+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825171] [levelValue:
800] [[ ------------------- 2013-03-14 18:20:25.125 -------------------]]
[2013-03-14T18:20:25.171+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825171] [levelValue:
800] [[ Item event observed for item com.amitinside.item.Item_at_1545cba
[Value=100, Limit=200]]] [2013-03-14T18:20:25.250+0900] [glassfish 4.0]
[INFO] [] [] [tid: _ThreadID=31 _ThreadName=Thread-3] [timeMillis:
1363252825250] [levelValue: 800] [[
-------------------------------------------------------]]
[2013-03-14T18:20:25.250+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825250] [levelValue:
800] [[ ------------------- 2013-03-14 18:20:25.125 -------------------]]
[2013-03-14T18:20:25.250+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825250] [levelValue:
800] [[ Item event observed for item com.amitinside.item.Item_at_ec25df
[Value=200, Limit=300]]] [2013-03-14T18:20:25.250+0900] [glassfish 4.0]
[INFO] [] [] [tid: _ThreadID=31 _ThreadName=Thread-3] [timeMillis:
1363252825250] [levelValue: 800] [[
-------------------------------------------------------]]
[2013-03-14T18:20:25.250+0900] [glassfish 4.0] [INFO] [] [] [tid:
_ThreadID=31 _ThreadName=Thread-3] [timeMillis: 1363252825250] [levelValue:
800] [[ ------------------- 2013-03-14 18:20:25.125 -------------------]] ...
Good luck to you! And if you have any problem, please tell me.

--
[Message sent by forum member 'codeprince']
View Post: http://forums.java.net/node/895558