Mojo
  1. Mojo
  2. MOJO-682

native2ascii-maven-plugin doesn't work out-of-the-box with BEA's JRockit

    Details

    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Here's the full stack trace (with a workaround at the bottom):

      [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error starting Sun's native2ascii:
      sun.tools.native2ascii.Main
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      Error starting Sun's native2ascii:
              at org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii.run(SunNative2Ascii.j
      ava:67)
              at org.apache.tools.ant.taskdefs.optional.native2ascii.DefaultNative2Ascii.convert(DefaultNa
      tive2Ascii.java:54)
              at org.apache.tools.ant.taskdefs.optional.Native2Ascii.convert(Native2Ascii.java:268)
              at org.apache.tools.ant.taskdefs.optional.Native2Ascii.execute(Native2Ascii.java:227)
              at org.codehaus.mojo.native2ascii.Native2AsciiMojo.executeAnt(Native2AsciiMojo.java:115)
              at org.codehaus.mojo.native2ascii.Native2AsciiMojo.execute(Native2AsciiMojo.java:92)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor
      .java:539)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifec
      ycleExecutor.java:480)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.
      java:459)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultL
      ifecycleExecutor.java:311)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleE
      xecutor.java:278)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java
      :143)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:164)
              at org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii.run(SunNative2Ascii.j
      ava:51)
              ... 23 more
      --- Nested Exception ---
      java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:164)
              at org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii.run(SunNative2Ascii.j
      ava:51)
              at org.apache.tools.ant.taskdefs.optional.native2ascii.DefaultNative2Ascii.convert(DefaultNa
      tive2Ascii.java:54)
              at org.apache.tools.ant.taskdefs.optional.Native2Ascii.convert(Native2Ascii.java:268)
              at org.apache.tools.ant.taskdefs.optional.Native2Ascii.execute(Native2Ascii.java:227)
              at org.codehaus.mojo.native2ascii.Native2AsciiMojo.executeAnt(Native2AsciiMojo.java:115)
              at org.codehaus.mojo.native2ascii.Native2AsciiMojo.execute(Native2AsciiMojo.java:92)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor
      .java:539)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifec
      ycleExecutor.java:480)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.
      java:459)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultL
      ifecycleExecutor.java:311)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleE
      xecutor.java:278)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java
      :143)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5 seconds
      [INFO] Finished at: Thu Mar 08 11:44:14 MST 2007
      [INFO] Final Memory: 40M/512M
      [INFO] ------------------------------------------------------------------------
      $
      

      Copying $JROCKIT_HOME/lib/tools.jar to $JROCKIT_HOME/jre/lib/ext/tools.jar fixed this problem. The reason this happened is probably because I chose not to use JRockit as my default JRE.

        Issue Links

          Activity

          Hide
          murray waters added a comment -

          This also occurs when using the IBM jvm.

          Show
          murray waters added a comment - This also occurs when using the IBM jvm.
          Hide
          Juan Pablo Santos Rodríguez added a comment -

          tools.jar dependency is loaded in pom by a profile:

          <profiles>
          <profile>
          <id>default-tools.jar</id>
          <activation>
          <property>
          <name>java.vendor</name>
          <value>Sun Microsystems Inc.</value>
          </property>
          </activation>
          <dependencies>
          <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.4.2</version>
          <scope>system</scope>
          <systemPath>$

          {java.home}/../lib/tools.jar</systemPath>
          </dependency>
          </dependencies>
          </profile>

          triggering this same profile with different ids and property values (=ctrl-c + ctrl-v) should fix the issue (Oracle for JRockit, IBM for IBM jvm).

          Also, profile activation rule could be changed to:
          <file>
          <exists>${java.home}

          /../lib/tools.jar</exists>
          </file>

          which should also work, but only on Maven 2.0.9 onwards

          Show
          Juan Pablo Santos Rodríguez added a comment - tools.jar dependency is loaded in pom by a profile: <profiles> <profile> <id>default-tools.jar</id> <activation> <property> <name>java.vendor</name> <value>Sun Microsystems Inc.</value> </property> </activation> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.4.2</version> <scope>system</scope> <systemPath>$ {java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </profile> triggering this same profile with different ids and property values (=ctrl-c + ctrl-v) should fix the issue (Oracle for JRockit, IBM for IBM jvm). Also, profile activation rule could be changed to: <file> <exists>${java.home} /../lib/tools.jar</exists> </file> which should also work, but only on Maven 2.0.9 onwards
          Hide
          Tim Astle added a comment -

          The same problem happens if you use JDK 7. I just ran into this recently when migrating some Maven 3 projects.

          Show
          Tim Astle added a comment - The same problem happens if you use JDK 7. I just ran into this recently when migrating some Maven 3 projects.
          Hide
          Evgeny Mandrikov added a comment -

          Tim, thanks for the notification, but I know and going to fix this.

          Show
          Evgeny Mandrikov added a comment - Tim, thanks for the notification, but I know and going to fix this.
          Hide
          Evgeny Mandrikov added a comment -

          Fixed as part of MOJO-1768

          Show
          Evgeny Mandrikov added a comment - Fixed as part of MOJO-1768

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Matt Raible
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: