glassfish
  1. glassfish
  2. GLASSFISH-16954

asadmin complains about "Unknown plain text format" when deployment fails

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: admin
    • Labels:
      None
    • Environment:

      Win7 Pro SP1 64 Bit de_DE

      Description

      I am trying to deploy an application using "asadmin deploy --retrieve . SuperSimple.ear". Due to a bug in that EAR, deployment fails. This is a typical situation when still in development, so asadmin should be clever enough to handle this with a message like "Deployment failed due to...".

      But what it actually says is "Unknown plain text format.". Least programmers will understand that this actually means: "Everything is OK, you just have a typo in your EAR"...!

      c:\Users\Karg\workspace\CreateComplaintsRS\dist>C:\glassfish3\bin\asadmin deploy --retrieve . SuperSimple.ear
      remote failure: Unknown plain text format. A properly formatted response from a PlainTextActionReporter
      always starts with one of these 2 strings: PlainTextActionReporterSUCCESS or PlainTextActionReporterFAILURE. The response we re
      ceived from the server was not understood: Signature-Version: 1.0
      message: Error occurred during deployment: Exception while preparing t
      he app : Exception [EclipseLink-28018] (Eclipse Persistence Services

      • 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityMa
        nagerSetupException
        Exception Description: Predeployment of
        PersistenceUnit [QUIPSY] failed.
        Internal Exception: Excepti
        on [EclipseLink-7163] (Eclipse Persistence Services - 2.2.0.v20110202
        %%%EO13): org.eclipse.persistence.exceptions.ValidationException
        L%%%Exception Description: Entity class [class de.quipsy.persistency.
        suppliedPart.SuppliedPartPk] has both an @EmbdeddedId (on attribute [
        pk]) and an @Id (on attribute [customerId]. Both ID types cannot be s
        pecified on the same entity.. Please see server.log for more details.

      Exception while invoking class org.glassfish.persistence.jpa
      .JPADeployer prepare method : javax.persistence.PersistenceException:
      Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.2.0.
      v20110202-r8913): org.eclipse.persistence.exceptions.EntityManagerSet
      upException
      Exception Description: Predeployment of Persiste
      nceUnit [QUIPSY] failed.
      Internal Exception: Exception [Ecli
      pseLink-7163] (Eclipse Persistence Services - 2.2.0.v20110202-r8913):
      org.eclipse.persistence.exceptions.ValidationException
      Exce
      ption Description: Entity class [class de.quipsy.persistency.supplied
      Part.SuppliedPartPk] has both an @EmbdeddedId (on attribute [pk]) and
      an @Id (on attribute [customerId]. Both ID types cannot be specified
      on the same entity.
      Exception [EclipseLink-28018] (Eclipse P
      ersistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence
      .exceptions.EntityManagerSetupException
      Exception Description: Prede
      ployment of PersistenceUnit [QUIPSY] failed.
      Internal Exception: Exc
      eption [EclipseLink-7163] (Eclipse Persistence Services - 2.2.0.v2011
      0202-r8913): org.eclipse.persistence.exceptions.ValidationException

      Exception Description: Entity class [class de.quipsy.persistency.supp
      liedPart.SuppliedPartPk] has both an @EmbdeddedId (on attribute [pk])
      and an @Id (on attribute [customerId]. Both ID types cannot be speci
      fied on the same entity.
      name_value: SuperSimple
      name_name: name
      keys: name
      use-main-children-attribute: false
      exit-code: FAILURE

      Command deploy failed.

      c:\Users\Karg\workspace\CreateComplaintsRS\dist>

        Activity

        Hide
        Byron Nevins added a comment -

        Original problem is resolved

        Show
        Byron Nevins added a comment - Original problem is resolved
        Hide
        Tim Quinn added a comment -

        I do not see how it is deployment that is the problem here. Deployment invokes the published methods on ActionReport to set the report's message. (DeployCommand, line 440)

        It should be up to the various report implementations - such as PropsFileActionReporter - to do the right thing with the values presented to it. Because it's PropsFileActionReporter that knows it expresses the report as a manifest, it should be that class that does whatever is needed to correctly handle any value passed to it so it does not create an invalid manifest.

        I'm passing the baton back to the admin component, because it cannot be deployment's responsibility to know that the particular implementation of ActionReport at hand is not handling the message correctly.

        Show
        Tim Quinn added a comment - I do not see how it is deployment that is the problem here. Deployment invokes the published methods on ActionReport to set the report's message. (DeployCommand, line 440) It should be up to the various report implementations - such as PropsFileActionReporter - to do the right thing with the values presented to it. Because it's PropsFileActionReporter that knows it expresses the report as a manifest, it should be that class that does whatever is needed to correctly handle any value passed to it so it does not create an invalid manifest. I'm passing the baton back to the admin component, because it cannot be deployment's responsibility to know that the particular implementation of ActionReport at hand is not handling the message correctly.
        Hide
        Hong Zhang added a comment -

        assign to tim to follow up as tim had previously worked on it already

        Show
        Hong Zhang added a comment - assign to tim to follow up as tim had previously worked on it already
        Hide
        Byron Nevins added a comment -

        Comment from my code checkin

        16954
        GIGO. The server, actually Deployment, is sending back a corrupt (garbage!!) Manifest object. The JDK Manifest class implementation itself fails to parse it.
        There is absolutely nothing that CLI can do to "fix" this.
        BUT – the error message was not correct – it incorrectly assumed that it was a badly formatted plaintext return object.
        I fixed the error message. The real fix must be done server-side in deployment code.

        Show
        Byron Nevins added a comment - Comment from my code checkin 16954 GIGO. The server, actually Deployment, is sending back a corrupt (garbage!!) Manifest object. The JDK Manifest class implementation itself fails to parse it. There is absolutely nothing that CLI can do to "fix" this. BUT – the error message was not correct – it incorrectly assumed that it was a badly formatted plaintext return object. I fixed the error message. The real fix must be done server-side in deployment code.
        Hide
        Byron Nevins added a comment -

        Nope. That war file does NOT show the bug:

        === This Issue remain non-reproducible ===

        fetchCommandModel: got command opts: com.sun.enterprise.admin.util.CommandModelData@1037c71
        doHttpCommand succeeds
        Process program options
        Parsing program options
        Parse command options
        params: {}
        operands: [basicwebapp.war]
        Prevalidate command options
        Inject command options
        Validate command options
        asadmin --host localhost --port 4848 --user admin --interactive=true --echo=false --terse=true deploy --force=false --precompilejsp=false --verify=fal
        se --generatermistubs=false --availabilityenabled=false --asyncreplication=true --keepreposdir=false --keepfailedstubs=false --isredeploy=false --logr
        eportederrors=true basicwebapp.war
        Execute command
        removing --upload option
        doUpload set to false
        FILE PARAM: DEFAULT = D:\j2eeapps\basicwebapp.war
        URI: /__asadmin/deploy?DEFAULT=D%3A%5Cj2eeapps%5Cbasicwebapp.war
        URL: com.sun.enterprise.admin.util.HttpConnectorAddress@1ef8cf3
        URL: http://localhost:4848/__asadmin/deploy?DEFAULT=D%3A%5Cj2eeapps%5Cbasicwebapp.war
        Password options: null
        Using auth info: User: admin, Password: <null>
        ------- RAW RESPONSE ---------
        Signature-Version: 1.0
        message: Error occurred during deployment: Exception while preparing t
        he app : Exception [EclipseLink-28018] (Eclipse Persistence Services

        • 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityMa
          %%%EOL%%%Exception Description: Predeployment of
          %%%EOL%%%Internal Exception: Excep.
          tion [EclipseLink-7333] (Eclipse Persistence Services - 2.2.0.v201102
          %%%-r8913): org.eclipse.persistence.exceptions.ValidationException
          EOL%%%Exception Description: The reference column name [foo] mapped o
          n the element [field userCredentials] does not correspond to a valid
          field on the mapping reference.. Please see server.log for more detai
          ls.
          name_value: basicwebapp
          name_name: name
          keys: name
          use-main-children-attribute: false
          exit-code: FAILURE

        ------- RAW RESPONSE ---------
        PROCESSING MANIFEST...
        remote failure: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.
        2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityManagerSetupException
        Exception Description: Predeployment of PersistenceUnit [pujavaee] failed.
        Internal Exception: Exception [EclipseLink-7333] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.Validation
        Exception
        Exception Description: The reference column name [foo] mapped on the element [field userCredentials] does not correspond to a valid field on the mappi
        ng reference.. Please see server.log for more details.
        Command deploy failed.

        d:\j2eeapps>

        Show
        Byron Nevins added a comment - Nope. That war file does NOT show the bug: === This Issue remain non-reproducible === fetchCommandModel: got command opts: com.sun.enterprise.admin.util.CommandModelData@1037c71 doHttpCommand succeeds Process program options Parsing program options Parse command options params: {} operands: [basicwebapp.war] Prevalidate command options Inject command options Validate command options asadmin --host localhost --port 4848 --user admin --interactive=true --echo=false --terse=true deploy --force=false --precompilejsp=false --verify=fal se --generatermistubs=false --availabilityenabled=false --asyncreplication=true --keepreposdir=false --keepfailedstubs=false --isredeploy=false --logr eportederrors=true basicwebapp.war Execute command removing --upload option doUpload set to false FILE PARAM: DEFAULT = D:\j2eeapps\basicwebapp.war URI: /__asadmin/deploy?DEFAULT=D%3A%5Cj2eeapps%5Cbasicwebapp.war URL: com.sun.enterprise.admin.util.HttpConnectorAddress@1ef8cf3 URL: http://localhost:4848/__asadmin/deploy?DEFAULT=D%3A%5Cj2eeapps%5Cbasicwebapp.war Password options: null Using auth info: User: admin, Password: <null> ------- RAW RESPONSE --------- Signature-Version: 1.0 message: Error occurred during deployment: Exception while preparing t he app : Exception [EclipseLink-28018] (Eclipse Persistence Services 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityMa %%%EOL%%%Exception Description: Predeployment of %%%EOL%%%Internal Exception: Excep. tion [EclipseLink-7333] (Eclipse Persistence Services - 2.2.0.v201102 %%%-r8913): org.eclipse.persistence.exceptions.ValidationException EOL%%%Exception Description: The reference column name [foo] mapped o n the element [field userCredentials] does not correspond to a valid field on the mapping reference.. Please see server.log for more detai ls. name_value: basicwebapp name_name: name keys: name use-main-children-attribute: false exit-code: FAILURE ------- RAW RESPONSE --------- PROCESSING MANIFEST... remote failure: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2. 2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [pujavaee] failed. Internal Exception: Exception [EclipseLink-7333] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.Validation Exception Exception Description: The reference column name [foo] mapped on the element [field userCredentials] does not correspond to a valid field on the mappi ng reference.. Please see server.log for more details. Command deploy failed. d:\j2eeapps>

          People

          • Assignee:
            Byron Nevins
            Reporter:
            mkarg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: