Posted by: peteinman | March 13, 2010

weblogic-maven-plugin & “java.net.MalformedURLException: no protocol: and”

I’ve been working with the weblogic-maven-plugin over the past few weeks trying to get a deployment working against Oracle WebLogic Server 10.3.2.

I’m using the 2.3-SNAPSHOT version and everything’s been going fine with local builds and deployments – it works really well.

Running my build from a TeamCity environment started giving me the following error

java.net.MalformedURLException: no protocol: and

At first I thought maybe there was something wrong with the remote WebLogic server I was deploying to, but when I tried to deploy to that instance from MY own PC, it worked perfectly.

After several hours of investigation and comparing debug output between the two systems running the plug-in I was no further forward.

The stack trace which is here was pointing me to the java.net.URL class.

java.net.MalformedURLException: no protocol: and
        at java.net.URL.<init>(URL.java:567)
        at java.net.URL.<init>(URL.java:464)
        at java.net.URL.<init>(URL.java:413)
        at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:751)
        at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
        at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
        at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)

 

I thought this was strange, but then decompiled the “java.net.URL” class which is where I realised that the “no protocol: and” was actually giving me a hint.

On Windows systems, the default maven repository user directory is c:\documents and settings\<username>\.m2

This is where the “and” is coming from.

Changing the default repository to a repository name without spaces solved the problem and I can now deploy nicely from TeamCity.

I’m also using the default repository location on Windows 7, but with Windows 7, the location is now c:\users\<username>\.m2 which doesn’t cause problems as there are no spaces in the path name.

The result is – on Windows systems that use the “C:\documents and settings” convention, don’t use the default repository location when using maven – create your own with a sensible path name!

Advertisements

Responses

  1. Hi.. Is there any alternate for this problem,because i need to deply my project in c:\documents and settings\ only. Is there any work around for this???Please suggest.

  2. I didn’t find a solution, but then it was easy for me to move the maven repository, so I didn’t spend ages looking at it once I’d worked out what the problem is.

    It’s only TeamCity that I’ve had a problem with, local developers working with the default repo location are absolutely fine.

  3. Thanks. I’d have struggled to resolve this without your post 🙂

  4. I could imagine, with out your post, how hard it would be to resolve the issue..Thanks a lot…

  5. how do you “move” your repository???….
    –my M2_HOME points to c:\apache-maven-2.2.1.
    –my settings.xml points to a nexus repo.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: