[arquillian-issues] [JBoss JIRA] (ARQ-1122) ServletRuntime lookup only returns servlets of first web application found

Ralph Abbink (JIRA) jira-events at lists.jboss.org
Fri Sep 21 09:34:35 EDT 2012


Ralph Abbink created ARQ-1122:
---------------------------------

             Summary: ServletRuntime lookup only returns servlets of first web application found
                 Key: ARQ-1122
                 URL: https://issues.jboss.org/browse/ARQ-1122
             Project: Arquillian
          Issue Type: Enhancement
      Security Level: Public (Everyone can see)
          Components: WebLogic Containers
    Affects Versions: 1.0.2.Final
         Environment: Weblogic 12c
            Reporter: Ralph Abbink
            Assignee: Vineet Reynolds


After enriching our regular maven built .ear i noticed the following exception: {noformat}ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.{noformat}

It appears the lookup for servletRuntimes only returns the servlets of the first web application in the deployment. In our .ear we have several web modules and the first one found wasn't the module i enriched using Arquillian.

{code:title=WebLogicJMXClient.java}
private ObjectName[] findServletRuntimes(ObjectName wlServerRuntime, String deploymentName) throws Exception
      {
         ObjectName[] applicationRuntimes = (ObjectName[]) connection.getAttribute(wlServerRuntime, "ApplicationRuntimes");
         for(ObjectName applicationRuntime: applicationRuntimes)
         {
            String applicationName = (String) connection.getAttribute(applicationRuntime, "Name");
            if(applicationName.equals(deploymentName))
            {
               ObjectName[] componentRuntimes = (ObjectName[]) connection.getAttribute(applicationRuntime, "ComponentRuntimes");
               for(ObjectName componentRuntime : componentRuntimes)
               {
                  String componentType = (String) connection.getAttribute(componentRuntime, "Type");
                  if (componentType.toString().equals("WebAppComponentRuntime"))
                  {
                     ObjectName[] servletRuntimes = (ObjectName[]) connection.getAttribute(componentRuntime, "Servlets");
                     return servletRuntimes;
                  }
               }
            }
         }
         throw new DeploymentException(
               "The deployment details were not found in the MBean Server. Possible causes include:\n"
                     + "1. The deployment failed. Review the admin server and the target's log files.\n"
                     + "2. The deployment succeeded partially. The deployment must be the Active state. Instead, it might be in the 'New' state.\n"
                     + "   Verify that the the admin server can connect to the target(s), and that no firewall rules are blocking the traffic on the admin channel.");
      }
{code}

{code:title="Returning all servlets found" WebLogicJMXClient.java}
private List<ObjectName> findServletRuntimes(ObjectName wlServerRuntime, String deploymentName) throws Exception
      {
         ObjectName[] applicationRuntimes = (ObjectName[]) connection.getAttribute(wlServerRuntime, "ApplicationRuntimes");
         for(ObjectName applicationRuntime: applicationRuntimes)
         {
            String applicationName = (String) connection.getAttribute(applicationRuntime, "Name");
            if(applicationName.equals(deploymentName))
            {
               List<ObjectName> servletRuntimes = new ArrayList<ObjectName>();
               ObjectName[] componentRuntimes = (ObjectName[]) connection.getAttribute(applicationRuntime, "ComponentRuntimes");
               for(ObjectName componentRuntime : componentRuntimes)
               {
                  String componentType = (String) connection.getAttribute(componentRuntime, "Type");
                  if (componentType.toString().equals("WebAppComponentRuntime"))
                  {
                     servletRuntimes.addAll(Arrays.asList((ObjectName[]) connection.getAttribute(componentRuntime, "Servlets")));
                  }
               }
               return servletRuntimes;
            }
         }
         throw new DeploymentException(
               "The deployment details were not found in the MBean Server. Possible causes include:\n"
                     + "1. The deployment failed. Review the admin server and the target's log files.\n"
                     + "2. The deployment succeeded partially. The deployment must be the Active state. Instead, it might be in the 'New' state.\n"
                     + " Verify that the the admin server can connect to the target(s), and that no firewall rules are blocking the traffic on the admin channel.");
      }
   }
{code}

--
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 arquillian-issues mailing list