[JBoss JIRA] (WFLY-3774) CDI bean with StereoType is not injectable in implicit bean archive
by Takayoshi Kimura (JIRA)
[ https://issues.jboss.org/browse/WFLY-3774?page=com.atlassian.jira.plugin.... ]
Takayoshi Kimura reopened WFLY-3774:
------------------------------------
Sorry I wasn't clear on that point. CDI 1.2 clearly listed what is injectable, but it also applies to CDI 1.1. This behavior is nothing changed between versions, it just got clearer definistion.
> CDI bean with StereoType is not injectable in implicit bean archive
> -------------------------------------------------------------------
>
> Key: WFLY-3774
> URL: https://issues.jboss.org/browse/WFLY-3774
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: CDI / Weld
> Affects Versions: 8.1.0.Final
> Reporter: Takayoshi Kimura
> Assignee: Jozef Hartinger
> Attachments: logs.zip, stereotype.zip
>
>
> CDI 1.2 defines bean defining annotations and with beans with these annotations should be injectable. However a bean with StereoType, one of bean defining annotations, is not injectable within implicit bean archive on WildFly.
> Attached a simple war project to reproduce this problem. This works on GlassFish 4 but doesn't work on WildFly 8.1.0 nor WildFly 9 master at this time. Making this an explicit bean archive by adding empty beans.xml (or set bean-discovery-mode=all) fixes the problem, the container recognizes the CDI bean correctly.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 5 months
[JBoss JIRA] (WFLY-3774) CDI bean with StereoType is not injectable in implicit bean archive
by Takayoshi Kimura (JIRA)
[ https://issues.jboss.org/browse/WFLY-3774?page=com.atlassian.jira.plugin.... ]
Takayoshi Kimura updated WFLY-3774:
-----------------------------------
Attachment: logs.zip
Re-run the reproducer with WildFly 8.1.0.Final and reproduced. Attached WF log and Maven stdout.
Surefire log is included in stestereotype.zip, stereotype/target/surefire-reports/example.FooTest.txt.
> CDI bean with StereoType is not injectable in implicit bean archive
> -------------------------------------------------------------------
>
> Key: WFLY-3774
> URL: https://issues.jboss.org/browse/WFLY-3774
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: CDI / Weld
> Affects Versions: 8.1.0.Final
> Reporter: Takayoshi Kimura
> Assignee: Jozef Hartinger
> Attachments: logs.zip, stereotype.zip
>
>
> CDI 1.2 defines bean defining annotations and with beans with these annotations should be injectable. However a bean with StereoType, one of bean defining annotations, is not injectable within implicit bean archive on WildFly.
> Attached a simple war project to reproduce this problem. This works on GlassFish 4 but doesn't work on WildFly 8.1.0 nor WildFly 9 master at this time. Making this an explicit bean archive by adding empty beans.xml (or set bean-discovery-mode=all) fixes the problem, the container recognizes the CDI bean correctly.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 5 months
[JBoss JIRA] (WFLY-944) Connection manager not available during shutdown
by James Livingston (JIRA)
[ https://issues.jboss.org/browse/WFLY-944?page=com.atlassian.jira.plugin.s... ]
James Livingston edited comment on WFLY-944 at 8/31/14 8:12 PM:
----------------------------------------------------------------
Piotr: you just need to declare a <resource-ref> in your web.xml, which is the portable way of telling the container that you require the resource. Add the following and then look up "java:comp/env/jdbc/myDS":
<resource-ref>
<res-ref-name>jdbc/myDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<lookup-name>java:jboss/datasources/ExampleDS</lookup-name>
</resource-ref>
The limitation for SARs is that it's not easy to declare such a dependency. In general they should be converted to singleton EJBs where you can do that.
was (Author: jameslivingston):
Piotr: you just need to declare a <resource-ref> in your web.xml, which is the portable way of telling the container that you require the resource. Add the following and then look up "java:comp/env/jdbc/myDS":
<resource-ref>
<res-ref-name>jdbc/myDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<lookup-name>java:jboss/datasources/ExampleDS</lookup-name>
</resource-ref>
> Connection manager not available during shutdown
> ------------------------------------------------
>
> Key: WFLY-944
> URL: https://issues.jboss.org/browse/WFLY-944
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Server
> Reporter: Ori Kremer
> Attachments: TestEAR.zip
>
>
> The problem occurs when trying to access the database during the shutdown phase.
> It looks like when our shutdown code tries to access the database - it is no longer available.
> Our application is deployed as an EAR that has a SAR module to handle startup and shutdown.
> We add our application specific startup and shutdown code in the corresponding MBean hooks.
> In JBoss 7.0.2 and 7.1.1 we're encountering an error when the shutdown code is attempting to access the database and is failing due to the fact that the connection manager is closed:
> 13:08:37,975 ERROR [org.jboss.as.service] JBAS017200: Failed to execute legacy service stop() method: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_01]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_01]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_01]
> at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_01]
> at org.jboss.as.service.AbstractService.invokeLifecycleMethod(AbstractService.java:52) [jboss-as-sar-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.service.StartStopService.stop(StartStopService.java:66) [jboss-as-sar-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_01]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_01]
> at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]
> Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000451: The connection manager is shutdown: java:/org.test.NonSecureDS
> at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:137)
> at org.test.StartupService.updateStatus(StartupService.java:37)
> at org.test.StartupService.stop(StartupService.java:56)
> ... 11 more
> Caused by: javax.resource.ResourceException: IJ000451: The connection manager is shutdown: java:/org.test.NonSecureDS
> at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:321)
> at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)
> at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)
> at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)
> ... 13 more
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 5 months
[JBoss JIRA] (WFLY-944) Connection manager not available during shutdown
by James Livingston (JIRA)
[ https://issues.jboss.org/browse/WFLY-944?page=com.atlassian.jira.plugin.s... ]
James Livingston commented on WFLY-944:
---------------------------------------
Piotr: you just need to declare a <resource-ref> in your web.xml, which is the portable way of telling the container that you require the resource. Add the following and then look up "java:comp/env/jdbc/myDS":
<resource-ref>
<res-ref-name>jdbc/myDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<lookup-name>java:jboss/datasources/ExampleDS</lookup-name>
</resource-ref>
> Connection manager not available during shutdown
> ------------------------------------------------
>
> Key: WFLY-944
> URL: https://issues.jboss.org/browse/WFLY-944
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Server
> Reporter: Ori Kremer
> Attachments: TestEAR.zip
>
>
> The problem occurs when trying to access the database during the shutdown phase.
> It looks like when our shutdown code tries to access the database - it is no longer available.
> Our application is deployed as an EAR that has a SAR module to handle startup and shutdown.
> We add our application specific startup and shutdown code in the corresponding MBean hooks.
> In JBoss 7.0.2 and 7.1.1 we're encountering an error when the shutdown code is attempting to access the database and is failing due to the fact that the connection manager is closed:
> 13:08:37,975 ERROR [org.jboss.as.service] JBAS017200: Failed to execute legacy service stop() method: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_01]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_01]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_01]
> at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_01]
> at org.jboss.as.service.AbstractService.invokeLifecycleMethod(AbstractService.java:52) [jboss-as-sar-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.as.service.StartStopService.stop(StartStopService.java:66) [jboss-as-sar-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_01]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_01]
> at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]
> Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000451: The connection manager is shutdown: java:/org.test.NonSecureDS
> at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:137)
> at org.test.StartupService.updateStatus(StartupService.java:37)
> at org.test.StartupService.stop(StartupService.java:56)
> ... 11 more
> Caused by: javax.resource.ResourceException: IJ000451: The connection manager is shutdown: java:/org.test.NonSecureDS
> at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:321)
> at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)
> at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)
> at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)
> ... 13 more
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 5 months