0 Replies Latest reply on Dec 1, 2015 10:01 AM by Hayk Davtyan

    How to Inject SessionContext in arquillian embedded container for wildfly 8.2

    Hayk Davtyan Newbie

      My wildfly server not running after adding the line

      @Resource private SessionContext sessionContext;

      How to inject Session Context in embeded arquillian with wildfly 8.2 version??? I even tried to add the line

      .addAsWebInfResource(new File("D:\wildfly-.2.0.Final\domain\configuration\domain.xml")) mentioning the domain.xml of my wildfly server where I have crated users. but again not able to start the server. Also when I remove the line of injecting SessionContext my server starts normally.

      @RunWith(Arquillian.class)

      public class CRLManagerTest {

      private static final Logger LOGGER = LoggerFactory.getLogger(CRLManagerTest.class);

      @Deployment
      public static WebArchive createDeployment() {

        WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "test.war")
        .addClass(CrManagerFacade1.class)
        .addClass(SessionContext.class)
        .addClass(CrManagerFacade.class)
        .addClass(CrManager.class)

        .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
        .addAsWebInfResource(new File("D:\\wildfly-.2.0.Final\\domain\\configuration\\domain.xml"))
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsManifestResource("META-INF/persistence.xml", "persistence.xml") .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        ;
        return webArchive;
      }
      @Resource
      private SessionContext sessionContext;

      @Test
      public void testUpdateReceipt1() throws Exception {
        LOGGER.info(">>>>>>>>>>>>> This is a test");
        Assert.assertEquals("hello","hello");
      }

      Here is my arquillian.xml

      <container qualifier="jboss-managed" default="true"> <configuration> <property name="jbossHome">${jbossHome}</property> <property name="instanceRoot">${jbossHome}\domain</property> </configuration> </container>

      I asked question to stack overflow also

      http://stackoverflow.com/questions/34021419/how-to-inject-sessioncontext-in-arquillian-embedded-container-for-wildfly-8-…