[jboss-jira] [JBoss JIRA] (AS7-6012) AS7 violating alternate client view of EJB 3.1 spec
Stuart Douglas (JIRA)
jira-events at lists.jboss.org
Tue May 7 19:47:53 EDT 2013
[ https://issues.jboss.org/browse/AS7-6012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stuart Douglas resolved AS7-6012.
---------------------------------
Resolution: Rejected
This does not work for a number of reasons (the most obvious one being that clients can talk to multiple servers).
This does work for the EE application client, which is the only standard client defined by the spec. The spec does not say anything about non-standard remote clients.
> AS7 violating alternate client view of EJB 3.1 spec
> ---------------------------------------------------
>
> Key: AS7-6012
> URL: https://issues.jboss.org/browse/AS7-6012
> Project: Application Server 7
> Issue Type: Bug
> Components: EJB
> Reporter: John Ament
> Assignee: jaikiran pai
>
> Section 4.4.2.2 of the EJB 3.1 spec states that the following JNDI locations should be populated for "other client views," which includes remote. AS7 is using a highly custom pattern for this view. This is shown when trying to run the following test case in Arquillian:
> @Remote
> public interface RemoteDatabaseIntegrator {
> public void runQuery(String query) throws SQLException;
> }
> @Remote(RemoteDatabaseIntegrator.class)
> @Stateless(name="RemoteDatabaseIntegrator")
> public class RemoteDatabaseIntegratorImpl implements RemoteDatabaseIntegrator {
> @Resource(name="jdbc/AppDS")
> private DataSource ds;
> private Connection conn;
> @PostConstruct
> public void init() throws SQLException {
> this.conn = ds.getConnection();
> }
> @PreDestroy
> public void cleanup() throws SQLException {
> this.conn.close();
> }
> public void runQuery(String query) throws SQLException {
> this.conn.createStatement().execute(query);
> }
> }
> @RunWith(Arquillian.class)
> @RunAsClient
> public class RemoteDatabaseIntegratorTest {
> @Deployment(testable=false)
> public static JavaArchive createTestArchive() {
> return ShrinkWrap.create(JavaArchive.class,"test.jar")
> .addClasses(RemoteDatabaseIntegrator.class,RemoteDatabaseIntegratorImpl.class);
> }
>
> private static final String JNDI_LOC = "?";
>
> @Test
> public void testDbServiceInjectionFailure() throws Exception{
> Context context = createAS7Context();
> RemoteDatabaseIntegrator dbIntegrator = (RemoteDatabaseIntegrator)context.lookup(JNDI_LOC);
> dbIntegrator.runQuery("select 1");
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list