Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1477

TomEE wont start if added maven-properties to <args>

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.1
    • 1.7.2, 7.0.0-M1
    • TomEE Maven Plugin
    • None
    • Mac, osX

    Description

      if you have something like

      <properties>
          <tomee.additional.args />
          <tomee.additional.ldap.args />
      </properties>
      
      <profiles>
          <profile>
              <id>tomee</id>
              <properties>
                  <tomee.additional.ldap.args>-DldapPrinicpal=principal -DldapPassword=pass -DldapUrl=ldap://myurl:389</tomee.additional.ldap.args>
              </properties>
          </profile>
      </profiles>
      
      ...
      <plugin>
          <groupId>org.apache.openejb.maven</groupId>
          <artifactId>tomee-maven-plugin</artifactId>
          <version>${tomee.mavenplugin.version}</version>
              <configuration>
                  <tomeeVersion>${tomee.version}</tomeeVersion>
                  <tomeeClassifier>${tomee.classifier}</tomeeClassifier>
                  <args>-Dopenejb.log.factory=log4j ${tomee.additional.args} ${tomee.additional.ldap.args} ${tomee.wps.additional.args}</args>
      ...
      

      tomEE startup fails with message: can not find main class (my local message: Hauptklasse konnte nicht gefunden werden)

      the problem is that the first maven property is empty and will be passed as an emtpy String.

      this behavoir only occurs on my mac (and i think this issue will be on linux to). everything works fine on my windows-box.

      Attachments

        1. TOMEE-1477.patch
          1.0 kB
          Reinhard Sandtner
        2. TOMEE-1477-fixedInMavenPlugin.patch
          0.9 kB
          Reinhard Sandtner
        3. TOMEE-1477-argsWithSpaces.patch
          2 kB
          Reinhard Sandtner

        Activity

          should work if you keep a " " inside. basicall args should ATM be space delimited and is here for -X properties more than system properties (using them here works more as a side effect than a feature since they were designed to be in systemVariables or src/main/tomee/conf/system.properties)

          romain.manni-bucau Romain Manni-Bucau added a comment - should work if you keep a " " inside. basicall args should ATM be space delimited and is here for -X properties more than system properties (using them here works more as a side effect than a feature since they were designed to be in systemVariables or src/main/tomee/conf/system.properties)

          not sure if i hit the right place - maybe it would be better filter in maven-plugin

          rsandtner Reinhard Sandtner added a comment - not sure if i hit the right place - maybe it would be better filter in maven-plugin

          yep in AbstractTomEEMavenPlugin (<tomee>/maven/tomee-maven-plugin).

          romain.manni-bucau Romain Manni-Bucau added a comment - yep in AbstractTomEEMavenPlugin (<tomee>/maven/tomee-maven-plugin).

          fixed it in AbstractTomEEMojo

          rsandtner Reinhard Sandtner added a comment - fixed it in AbstractTomEEMojo

          Looks good, wonder if

          trings.addAll(Arrays.asList(args.split(" *")));
          

          wouldn't have been enough

          BTW this still has a bug (it had before but since we are fixing this for all kind of args I think we should do it completely): this args is not handled:

          "-Dfoo=bar dummy" -Dtr=_
          

          cause it has a space in ""

          do yuo want to have a try to fix it as well before we apply the patch?

          romain.manni-bucau Romain Manni-Bucau added a comment - Looks good, wonder if trings.addAll(Arrays.asList(args.split( " *" ))); wouldn't have been enough BTW this still has a bug (it had before but since we are fixing this for all kind of args I think we should do it completely): this args is not handled: "-Dfoo=bar dummy" -Dtr=_ cause it has a space in "" do yuo want to have a try to fix it as well before we apply the patch?

          slightly reworked the patch cause it was no more respecting args ordering at least, hope it is still ok for you

          romain.manni-bucau Romain Manni-Bucau added a comment - slightly reworked the patch cause it was no more respecting args ordering at least, hope it is still ok for you

          works for me - txs! i also tried to fix it but you are much to fast

          rsandtner Reinhard Sandtner added a comment - works for me - txs! i also tried to fix it but you are much to fast
          andyg Andy Gumbrecht added a comment -

          Closed on release of TomEE 7.0.0-M1

          andyg Andy Gumbrecht added a comment - Closed on release of TomEE 7.0.0-M1

          People

            romain.manni-bucau Romain Manni-Bucau
            rsandtner Reinhard Sandtner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: