[jboss-jira] [JBoss JIRA] (AS7-6012) AS7 violating alternate client view of EJB 3.1 spec

John Ament (JIRA) jira-events at lists.jboss.org
Wed Nov 21 19:49:21 EST 2012


John Ament created AS7-6012:
-------------------------------

             Summary: 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