10 Replies Latest reply on Aug 26, 2011 5:30 AM by denis_k

    arquillian-glassfish-remote-3.1 - can't login to server

    denis_k

      I would like to deploy my web archive to remote glassfish server. However, I can't pass through server's security barrier, I get this in logs:

       

      INFO: Could not read active container configuration: null

        com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:4848/management/domain returned a response status of 401

                at com.sun.jersey.api.client.WebResource.handle(WebResource.java:607)

                at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)

                at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:459)

                at org.jboss.arquillian.container.glassfish.remote_3_1.GlassFishRestDeployableContainer.start(GlassFishRestDeployableContainer.java:110)

       

      As you see, it seem to ignore my arquillian.xml (which is actually empty I have to say). If I open http://localhost:4848/management/domain in a browser, I get Login/Password window, which requires me to enter admin login and password.

       

      In GlassFishRestDeployableContainer there is no opportunity of passing login/password parameters to the request:

       

      final String xmlResponse = prepareClient().get(String.class);

      ...

          private WebResource.Builder prepareClient() {

              return prepareClient("");

          }

      ...

          private WebResource.Builder prepareClient(String additionalResourceUrl) {

              final Client client = Client.create();

              return client.resource(this.adminBaseUrl + additionalResourceUrl).accept(MediaType.APPLICATION_XML_TYPE);

          }

       

      How do I pass user name and password to Glassfish?

       

      Thanks