JBoss Community

Re: EJB 3.1 Global JNDI names

created by Süleyman Vurucu in JNDI and Naming - View the full discussion

I post the important part of my Arquillian TestCase.

 

The deployment and the injection works wonderfull. But the lookup still fails.  I start the thestcase with the jbossas-remote-6 profile

 

    @Deployment

    public static JavaArchive createTestArchive() {

        JavaArchive arch = ShrinkWrap.create( JavaArchive.class, "test.jar" )

        .addPackages( true,UserBean.class.getPackage()) // All EJB's

        .addPackages( true, Customer.class.getPackage()) // All Entities

        .addPackages( true,UserInContainerTestCase.class.getPackage()) // all Test Classes

//        .addClasses( UserInContainerTestCase.class, UserBeanRemote.class, UserBean.class, User.class, DBObject.class, UserIssueRole.class)

//        .addClasses( UserInContainerTestCase.class, UserBeanRemote.class)

         .addManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));

        return arch;

    }

   

     @After

     public void beforeTest(){

         try {

                 InitialContext pJndiContext = new InitialContext();

                NamingEnumeration<NameClassPair> nEn = pJndiContext.list( "java:global" );

                sLog.debug( "LIST" );

                while (nEn.hasMoreElements()) {

                    sLog.debug( nEn.next() );

                }

            } catch (Exception e1) {

                sLog.error( "ERROR",e1 );

            }

     }

 

     @EJB

    private UserBeanRemote    ub;

 

    @Test

    public void testTest(){

        Assert.assertNotNull( ub );

        sLog.info( "OK" );

    }

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community