jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x GWT Plugin
  • MGWT-35

java.lang.ClassNotFoundException on windows xp and maven repo in default location

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1
  • Labels:
    None
  • Environment:
    Hide
    mvn -v
    Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
    Java version: 1.6.0_11
    Java home: f:\devtools\jdk1.6.0_11\jre
    Default locale: en_US, platform encoding: Cp1252
    OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
    Show
    mvn -v Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400) Java version: 1.6.0_11 Java home: f:\devtools\jdk1.6.0_11\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

Description

When your maven repository is installed in "c:/Documents and Settings/username/.m2" You should get this error.

INFO] [gwt:run]
[INFO] using GWT jars for specified version 1.6.2
[INFO] Unpack native libraries required to run GWT
[INFO] source web.xml present - f:\project\src\main\webapp\WEB-INF\web.xml - using it with embedded Tomcat
[INFO] establishing classpath list (scope = runtime)
[ERROR] java.lang.NoClassDefFoundError: and
[ERROR] Caused by: java.lang.ClassNotFoundException: and
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
[ERROR] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
[ERROR] Could not find the main class: and. Program will exit.
[ERROR] Exception in thread "main"

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    ClasspathBuilder.diff
    17/Apr/09 11:09 AM
    1 kB
    David Boon
  2. File
    run_orig.cmd
    17/Apr/09 11:10 AM
    7 kB
    David Boon
  3. Text File
    run.cmd.patch
    17/Apr/09 9:43 AM
    13 kB
    David Boon

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MGWT-23 gwt:run places quotes around the %CLASSPATH% variable in run.cmd on windows platform.

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
nicolas de loof added a comment - 17/Apr/09 9:51 AM

please attach the run.cmd generated by the plugin in /target

Show
nicolas de loof added a comment - 17/Apr/09 9:51 AM please attach the run.cmd generated by the plugin in /target
Hide
Permalink
David Boon added a comment - 17/Apr/09 11:10 AM

attached a version of ClasspathBuilder that fixes the problem, for me.

Show
David Boon added a comment - 17/Apr/09 11:10 AM attached a version of ClasspathBuilder that fixes the problem, for me.
Hide
Permalink
David Boon added a comment - 17/Apr/09 11:11 AM

I attached the unmodifid run.cmd, and I also found where I think the problem is. the ClasspathBuilder is putting double quotes around each classpath entry.

I changed the ClasspathBuilder to only surround the entire classpath with double quotes and things work perfectly.

-Dave

Show
David Boon added a comment - 17/Apr/09 11:11 AM I attached the unmodifid run.cmd, and I also found where I think the problem is. the ClasspathBuilder is putting double quotes around each classpath entry. I changed the ClasspathBuilder to only surround the entire classpath with double quotes and things work perfectly. -Dave
Hide
Permalink
nicolas de loof added a comment - 17/Apr/09 12:26 PM

This should be allready fixed in SVN as the
-cp "%CLASSPATH%"
has been replaced by
-cp %CLASSPATH%

so doubled quotes doesn't appear anymore.

I still must check it

Show
nicolas de loof added a comment - 17/Apr/09 12:26 PM This should be allready fixed in SVN as the -cp "%CLASSPATH%" has been replaced by -cp %CLASSPATH% so doubled quotes doesn't appear anymore. I still must check it
Hide
Permalink
Colin Alworth added a comment - 17/Apr/09 1:19 PM

I am seeing issues with running the gwt:test goal on windows, and getting this same error. Also using XP.

I can report this as a separate issue if you like, but the exception thrown is the same. As far as I can break it down, TestMojo.getClassPathElementFor is using a URL object, which unnecessarily escapes spaces in strings, and forgets to remove a leading slash in the path. As such, while the GWT jar is passed as
C:\Documents and Settings\username\.m2\repository\com\google\gwt\gwt-user\1.6.4\gwt-user-1.6.4.jar
the gwt-maven-plugin is passed as
/C:/Documents%20and%20Settings/calworth/.m2/repository/org/codehaus/mojo/gwt-maven-plugin/1.1-SNAPSHOT/gwt-maven-plugin-1.1-SNAPSHOT.jar

Windows borks on this - I don't know enough about building maven plugins to say for certain, but would it be possible to create the paths for both jars in the same way that the project roots are obtained?

Show
Colin Alworth added a comment - 17/Apr/09 1:19 PM I am seeing issues with running the gwt:test goal on windows, and getting this same error. Also using XP. I can report this as a separate issue if you like, but the exception thrown is the same. As far as I can break it down, TestMojo.getClassPathElementFor is using a URL object, which unnecessarily escapes spaces in strings, and forgets to remove a leading slash in the path. As such, while the GWT jar is passed as C:\Documents and Settings\username\.m2\repository\com\google\gwt\gwt-user\1.6.4\gwt-user-1.6.4.jar the gwt-maven-plugin is passed as /C:/Documents%20and%20Settings/calworth/.m2/repository/org/codehaus/mojo/gwt-maven-plugin/1.1-SNAPSHOT/gwt-maven-plugin-1.1-SNAPSHOT.jar Windows borks on this - I don't know enough about building maven plugins to say for certain, but would it be possible to create the paths for both jars in the same way that the project roots are obtained?
Hide
Permalink
David Boon added a comment - 17/Apr/09 3:09 PM

It doesn't appear to be fixed in the trunk, I checked out the trunk this morning to test the patch I made.

[16:06:41] gwt-maven-plugin % svn info ./src
Path: src
URL: http://svn.codehaus.org/mojo/trunk/mojo/gwt-maven-plugin/src
Repository Root: http://svn.codehaus.org/mojo
Repository UUID: 52ab4f32-60fc-0310-b215-8acea882cd1b
Revision: 9475
Node Kind: directory
Schedule: normal
Last Changed Author: ndeloof
Last Changed Rev: 9466
Last Changed Date: 2009-04-16 08:03:15 -0400 (Thu, 16 Apr 2009)

Show
David Boon added a comment - 17/Apr/09 3:09 PM It doesn't appear to be fixed in the trunk, I checked out the trunk this morning to test the patch I made. [16:06:41] gwt-maven-plugin % svn info ./src Path: src URL: http://svn.codehaus.org/mojo/trunk/mojo/gwt-maven-plugin/src Repository Root: http://svn.codehaus.org/mojo Repository UUID: 52ab4f32-60fc-0310-b215-8acea882cd1b Revision: 9475 Node Kind: directory Schedule: normal Last Changed Author: ndeloof Last Changed Rev: 9466 Last Changed Date: 2009-04-16 08:03:15 -0400 (Thu, 16 Apr 2009)
Hide
Permalink
nicolas de loof added a comment - 18/Apr/09 2:07 PM

Have this exact same configuration and works fine with latest SNAPSHOT :

set CLASSPATH="D:\java\gwt-maven-plugin\target\it\gwt-compile\src\main\java";"D:\java\gwt-maven-plugin\target\it\gwt-compile\src\main\resources";"D:\java\gwt-maven-plugin\target\it\gwt-compile\target\classes";"C:\Documents and Settings\admin\.m2\repository\com\google\gwt\gwt-user\1.6.4\gwt-user-1.6.4.jar";"C:\Documents and Settings\admin\.m2\repository\com\google\gwt\gwt-dev\1.6.4\gwt-dev-1.6.4-windows.jar"
"C:\Program Files\Java\jdk1.6.0_10\jre\bin\java" -Xmx512m -cp %CLASSPATH% com.google.gwt.dev.HostedMode -gen "D:\java\gwt-maven-plugin\target\it\gwt-compile\target\.generated" -logLevel INFO -style OBF -port 8888 -war "D:\java\gwt-maven-plugin\target\it\gwt-compile\src\main\webapp" -startupUrl "hello/Hello.html" com.google.gwt.sample.hello.Hello

Show
nicolas de loof added a comment - 18/Apr/09 2:07 PM Have this exact same configuration and works fine with latest SNAPSHOT : set CLASSPATH="D:\java\gwt-maven-plugin\target\it\gwt-compile\src\main\java";"D:\java\gwt-maven-plugin\target\it\gwt-compile\src\main\resources";"D:\java\gwt-maven-plugin\target\it\gwt-compile\target\classes";"C:\Documents and Settings\admin\.m2\repository\com\google\gwt\gwt-user\1.6.4\gwt-user-1.6.4.jar";"C:\Documents and Settings\admin\.m2\repository\com\google\gwt\gwt-dev\1.6.4\gwt-dev-1.6.4-windows.jar" "C:\Program Files\Java\jdk1.6.0_10\jre\bin\java" -Xmx512m -cp %CLASSPATH% com.google.gwt.dev.HostedMode -gen "D:\java\gwt-maven-plugin\target\it\gwt-compile\target\.generated" -logLevel INFO -style OBF -port 8888 -war "D:\java\gwt-maven-plugin\target\it\gwt-compile\src\main\webapp" -startupUrl "hello/Hello.html" com.google.gwt.sample.hello.Hello
Hide
Permalink
Pavel Genevski added a comment - 09/Apr/10 8:53 AM

I can confirm that I still observe the problem with gwt-maven-plugin 1.2, which as of now seems to be the newest version available on the central repo (http://repo2.maven.org/maven2/org/codehaus/mojo/gwt-maven-plugin/). The root cause is that the plugin does not handle spaces in the path correctly. When I changed the Hudson home directory to a path that does not contain spaces everything worked fine.

Show
Pavel Genevski added a comment - 09/Apr/10 8:53 AM I can confirm that I still observe the problem with gwt-maven-plugin 1.2, which as of now seems to be the newest version available on the central repo (http://repo2.maven.org/maven2/org/codehaus/mojo/gwt-maven-plugin/). The root cause is that the plugin does not handle spaces in the path correctly. When I changed the Hudson home directory to a path that does not contain spaces everything worked fine.

People

  • Assignee:
    nicolas de loof
    Reporter:
    David Boon
Vote (0)
Watch (0)

Dates

  • Created:
    17/Apr/09 9:43 AM
    Updated:
    09/Apr/10 8:53 AM
    Resolved:
    18/Apr/09 2:07 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.