"java.net.MalformedURLException: unknown protocol: c" in GwtWebInfProcessor

437 views
Skip to first unread message

Al Hadsell

unread,
Jan 5, 2008, 11:16:42 AM1/5/08
to gwt-maven
I'm trying to build the maven-googlewebkit-support JAR from SVN. It's
running in Eclipse on Windows XP. When I do "mvn clean package", I
get test failures from GWTWebInfProcessorTest and
MakeCatalinaBaseTest. The WebInfProcessor error seems to be more
fundamental. Here's the traceback:

-------------------------------------------------------------------------------
Test set: com.totsp.mavenplugin.gwt.support.GwtWebInfProcessorTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.06
sec <<< FAILURE!
testProcess(com.totsp.mavenplugin.gwt.support.GwtWebInfProcessorTest)
Time elapsed: 0.05 sec <<< ERROR!
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:
650)
at
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:
186)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
771)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:
107)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:891)
at
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessor.getWebXml(GwtWebInfProcessor.java:
216)
at
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessor.insertServlets(GwtWebInfProcessor.java:
231)
at
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessor.process(GwtWebInfProcessor.java:
297)
at
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessorTest.testProcess(GwtWebInfProcessorTest.java:
38)
at
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessorTest.testProcess(GwtWebInfProcessorTest.java:
38)
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:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
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:597)
at
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:
213)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:
138)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:
125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
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:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:
290)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:
818)


This is the traditional error on Windows when a program tries to use a
filename (c:\blah) in a context where a URL is expected.

I'm looking at the code in
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessor.getWebXml, but it
has defeated me so far.

I'm trying to build this module because the same error is keeping me
from building any WARs from my GWT project.

Al Hadsell

unread,
Jan 5, 2008, 12:39:40 PM1/5/08
to gwt-maven
I can make it pass the tests by changing line 216 of
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessor from

return this.webXml = builder.build(this.webXmlPath);

to

return this.webXml = builder.build(new
File(this.webXmlPath));

IOW, make it pass a File rather than a String to the SAXBuilder. I
have yet to verify that this works in all contexts. Stay tuned.

Charlie Collins

unread,
Jan 6, 2008, 11:15:08 AM1/6/08
to gwt-maven
A fresh checkout from svn, into a brand new directory, and "mvn clean
install" or "mvn clean package" works fine for me. I am not using
Windows though. I can try this on Windows tomorrow, hopefully, but
don't have a Windows machine nearby today (I know it has built fine on
Windows in the past though).

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar]
[INFO] Building jar: /opt/projects/gwt-maven/maven-googlewebtoolkit-
support/target/maven-googlewebtoolkit-support-1.5.6.jar
[INFO] [install:install]
[INFO] Installing /opt/projects/gwt-maven/maven-googlewebtoolkit-
support/target/maven-googlewebtoolkit-support-1.5.6.jar to /Users/
charliecollins/.m2/repository/com/totsp/gwt/maven-googlewebtoolkit-
support/1.5.6/maven-googlewebtoolkit-support-1.5.6.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Sun Jan 06 11:12:20 EST 2008
[INFO] Final Memory: 8M/16M
[INFO]
------------------------------------------------------------------------

Al Hadsell

unread,
Jan 6, 2008, 12:56:40 PM1/6/08
to gwt-maven
The current version in SVN uses this code (line 216 of
com.totsp.mavenplugin.gwt.support.GwtWebInfProcessor):

return this.webXml = builder.build(this.webXmlPath);

This is invoking the method SAXBuilder.build(String), which takes
a URI as its input.

I changed it to:

return this.webXml = builder.build(new File(this.webXmlPath));

... which invokes SAXBuilder.build(File), which takes a local file as
its input. I would

It's possible that you're using a different implementation of
SAXBuilder
than I am, and that your version can interpret a String filename
correctly.

Here's the documentation for SAXBuilder:
http://www.jdom.org/docs/apidocs/org/jdom/input/SAXBuilder.html
Reply all
Reply to author
Forward
0 new messages