[jbosstools-issues] [JBoss JIRA] (JBIDE-11445) Cannot create application

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Mon Apr 2 16:43:47 EDT 2012


    [ https://issues.jboss.org/browse/JBIDE-11445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681095#comment-12681095 ] 

Andre Dietisheim edited comment on JBIDE-11445 at 4/2/12 4:41 PM:
------------------------------------------------------------------

The changes that lead to this problem we authored by Bill DeCoste of the OpenShift team. I'll ask him to correct the bug since I dont know what lead him to do those changes.
I mailed bill de coste of the OpenShift team today:

{quote}
Hi Bill

I included the latest jars in our tooling last friday. When we tried to create news applications with our tooling this morning (CET) we faced the following issue:

https://issues.jboss.org/browse/JBIDE-11445

When looking into the code I found the following:
Application:
{code}
    public String getHealthCheckUrl() throws OpenShiftException {
        throw new OpenShiftException("NOT SUPPORTED FOR GENERIC APPLICATION");
    }
   
    public String getHealthCheckResponse() throws OpenShiftException {
        throw new OpenShiftException("NOT SUPPORTED FOR GENERIC APPLICATION");
    }
{code}

This is the reason for the error we get.

Subclasses offer a method to check for the health of an application:

JBossASApplication:
{code}
    public String getHealthCheckUrl() throws OpenShiftException {
        return getApplicationUrl() + "/health";
    }
   
    public String getHealthCheckResponse() throws OpenShiftException {
        return "1";
    }
{code}

I dont really understand why you changed this and why you're relying on fixed paths here.
Let me try to line out how things were supposed to work before:

1) When creating a new application, the legacy service reported an URL at which we could check for the application health:

ApplicationResponseUnmarshaller:
{code}
    protected IApplication createOpenShiftObject(ModelNode node) {
        ...
        String healthCheckPath = getDataNodeProperty(IOpenShiftJsonConstants.PROPERTY_HEALTH_CHECK_PATH, node);
        ...
       
        if (cartridge instanceof JBossCartridge) {
            return new JBossASApplication(applicationName, uuid, creationLog, healthCheckPath, cartridge, user, service);
{code}

The application was reporting this health check path in Application#getHealthCheckUrl:

{code}
public String getHealthCheckUrl() throws OpenShiftException {
     return getApplicationUrl() + '/' + healthCheckPath;
{code}

2.) You'd only have the health check url if you were in the (user-) session that had created the application. I double checked with the libra team (Mike McGrath) backthen if the health url could not be provided later on. They were telling me that this was the way it should be. They were telling me that the healt-check url was not responding to requests after a while, it was only reliable to check it when creating the application.
The old code would most likely not work in this latter usecase, it was afaik trying to check if the application was responding with 200 on its application-url (web-url). This might be the problem you were solving when chaning the code.

To me there are 2 problems with the current code:
1) Is it correct to use a fixed health check path now?
2) most likely there is a problem when creating an Application instance from the json-response. In my issue I was trying to create a jboss-as application and was obviously getting a Application whereas I should have got a JBossAsApplication so that I would get the right #getHealthCheckUrl
{quote}
                
      was (Author: adietish):
    mailed bill de coste of the OpenShift team today:

{quote}
Hi Bill

I included the latest jars in our tooling last friday. When we tried to create news applications with our tooling this morning (CET) we faced the following issue:

https://issues.jboss.org/browse/JBIDE-11445

When looking into the code I found the following:
Application:
{code}
    public String getHealthCheckUrl() throws OpenShiftException {
        throw new OpenShiftException("NOT SUPPORTED FOR GENERIC APPLICATION");
    }
   
    public String getHealthCheckResponse() throws OpenShiftException {
        throw new OpenShiftException("NOT SUPPORTED FOR GENERIC APPLICATION");
    }
{code}

This is the reason for the error we get.

Subclasses offer a method to check for the health of an application:

JBossASApplication:
{code}
    public String getHealthCheckUrl() throws OpenShiftException {
        return getApplicationUrl() + "/health";
    }
   
    public String getHealthCheckResponse() throws OpenShiftException {
        return "1";
    }
{code}

I dont really understand why you changed this and why you're relying on fixed paths here.
Let me try to line out how things were supposed to work before:

1) When creating a new application, the legacy service reported an URL at which we could check for the application health:

ApplicationResponseUnmarshaller:
{code}
    protected IApplication createOpenShiftObject(ModelNode node) {
        ...
        String healthCheckPath = getDataNodeProperty(IOpenShiftJsonConstants.PROPERTY_HEALTH_CHECK_PATH, node);
        ...
       
        if (cartridge instanceof JBossCartridge) {
            return new JBossASApplication(applicationName, uuid, creationLog, healthCheckPath, cartridge, user, service);
{code}

The application was reporting this health check path in Application#getHealthCheckUrl:

{code}
public String getHealthCheckUrl() throws OpenShiftException {
     return getApplicationUrl() + '/' + healthCheckPath;
{code}

2.) You'd only have the health check url if you were in the (user-) session that had created the application. I double checked with the libra team (Mike McGrath) backthen if the health url could not be provided later on. They were telling me that this was the way it should be. They were telling me that the healt-check url was not responding to requests after a while, it was only reliable to check it when creating the application.
The old code would most likely not work in this latter usecase, it was afaik trying to check if the application was responding with 200 on its application-url (web-url). This might be the problem you were solving when chaning the code.

To me there are 2 problems with the current code:
1) Is it correct to use a fixed health check path now?
2) most likely there is a problem when creating an Application instance from the json-response. In my issue I was trying to create a jboss-as application and was obviously getting a Application whereas I should have got a JBossAsApplication so that I would get the right #getHealthCheckUrl
{quote}
                  
> Cannot create application
> -------------------------
>
>                 Key: JBIDE-11445
>                 URL: https://issues.jboss.org/browse/JBIDE-11445
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 3.3.0.Beta3
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>            Priority: Critical
>             Fix For: 3.3.0.Beta3
>
>         Attachments: not-supported-for-generic-application.png
>
>
> When creating a new application with the current tooling against the current production server of OpemShift you get the following error:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list