Search
Calendar
June 2025
S M T W T F S
« May    
1234567
891011121314
15161718192021
22232425262728
2930  
Archives

Posts Tagged ‘MalformedURLException’

PostHeaderIcon weblogic-maven-plugin / java.net.MalformedURLException: no protocol: and

Case

I run mvn weblogic:deploy, with a correct configuration inside pom.xml file, in order to deploy a WAR on a WebLogic 10 server. My development machine runs under Windows XP, the distant server is under Linux. I get the following error:
java.net.MalformedURLException: no protocol: and

Complete stacktrace:

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'weblogic'.
[INFO] ------------------------------------------------------------------------
[INFO] Building myWar Maven Webapp
[INFO]    task-segment: [weblogic:deploy]
[INFO] ------------------------------------------------------------------------
Downloading: http://repository.codehaus.org/weblogic/weblogic/9.0/weblogic-9.0.pom
[INFO] Unable to find resource 'weblogic:weblogic:pom:9.0' in repository codehaus.org (http://repository.codehaus.org)
Downloading: http://repo1.maven.org/maven2/weblogic/weblogic/9.0/weblogic-9.0.pom
[INFO] Unable to find resource 'weblogic:weblogic:pom:9.0' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/weblogic/weblogic/9.0/weblogic-9.0.pom
[INFO] Unable to find resource 'weblogic:weblogic:pom:9.0' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repository.codehaus.org/weblogic/webservices/9.0/webservices-9.0.pom
[INFO] Unable to find resource 'weblogic:webservices:pom:9.0' in repository codehaus.org (http://repository.codehaus.org)
Downloading: http://repo1.maven.org/maven2/weblogic/webservices/9.0/webservices-9.0.pom
[INFO] Unable to find resource 'weblogic:webservices:pom:9.0' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/weblogic/webservices/9.0/webservices-9.0.pom
[INFO] Unable to find resource 'weblogic:webservices:pom:9.0' in repository central (http://repo1.maven.org/maven2)
[INFO] [weblogic:deploy]
[INFO] Weblogic Deployment beginning with parameters DeployMojoBase[adminServerHostName = myLocalHost, adminServerProtocol = t3, adminServerPort = 7001, userId = weblogic, password = myPassword, artifactPath = C:\...\target/myWar.war, projectPackaging = war, name = myWar, targetNames = oneTier, remote = true]
[INFO] Weblogic Deployment parameters [-adminurl, t3://myLocalHost:7001, -username, weblogic, -password, myPassword, -verbose, -debug, -name, myWar, -targets, muletier, -upload, -source, C:\...\target/myWar, -deploy]
weblogic.Deployer invoked with options:  -adminurl t3://myLocalHost:7001 -username weblogic -verbose -debug -name myWar -targets muletier -upload -source C:\workarea\development\primeweb\primeweb\projects\strategic\myWar\target/myWar -deploy
[WebLogicDeploymentManagerImpl.<init>():103] : Constructing DeploymentManager for J2EE version V1_4
deployments
[WebLogicDeploymentManagerImpl.getNewConnection():146] : Connecting to admin server at myLocalHost:7001, as user weblogic
[ServerConnectionImpl.getEnvironment():288] : setting environment
[ServerConnectionImpl.getEnvironment():291] : getting context using t3://myLocalHost:7001
[ServerConnectionImpl.getMBeanServer():239] : Connecting to MBeanServer at service:jmx:t3://myLocalHost:7001/jndi/weblogic.management.mbeanservers.domainruntime
[ServerConnectionImpl.getMBeanServer():239] : Connecting to MBeanServer at service:jmx:t3://myLocalHost:7001/jndi/weblogic.management.mbeanservers.runtime
[DomainManager.resetDomain():36] : Getting new domain
[DomainManager.resetDomain():39] : Using pending domain: true
[MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@19ccba
[MBeanCache.addNotificationListener():107] : Disabling mbean caching due to: java.net.MalformedURLException: no protocol: and
[MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@ae1cf
[MBeanCache.addNotificationListener():107] : Disabling mbean caching due to: java.net.MalformedURLException: no protocol: and
[ServerConnectionImpl.initialize():171] : Connected to WLS domain: myMainDomain
[ServerConnectionImpl.setRemote():482] : Running in remote mode
[ServerConnectionImpl.init():161] : Initializing ServerConnection : weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl@a0e990
[BasicOperation.dumpTmids():690] : Incoming tmids:
[BasicOperation.dumpTmids():692] :   {Target=muletier, WebLogicTargetType=server, Name=myWar}, targeted=true
[BasicOperation.deriveAppName():139] : appname established as: myWar
<Aug 16, 2010 11:46:42 AM CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, myWar [archive: C:\workarea\development\primeweb\primeweb\projects\strategic\myWar\target\myWar], to muletier .>
[ServerConnectionImpl.upload():658] : Uploaded app to C:\win32app\bea\user_projects\domains\myMainDomain\.\servers\adminServer\upload\myWar
[BasicOperation.dumpTmids():690] : Incoming tmids:
[BasicOperation.dumpTmids():692] :   {Target=muletier, WebLogicTargetType=server, Name=myWar}, targeted=true
[BasicOperation.loadGeneralOptions():607] : Delete Files:false
Timeout :3600000
Targets:
muletier
ModuleTargets={}
SubModuleTargets={}
}
Files:
null
Deployment Plan: null
App root: C:\win32app\bea\user_projects\domains\myMainDomain\.\servers\adminServer\upload\myWar
App config: C:\win32app\bea\user_projects\domains\myMainDomain\.\servers\adminServer\upload\myWar\plan
Deployment Options: {isRetireGracefully=true,isGracefulProductionToAdmin=false,isGracefulIgnoreSessions=false,rmiGracePeriod=-1,retireTimeoutSecs=-1,undeployAllVersions=false,archiveVersion=null,planVersion=null,isLibrary=false,libSpecVersion=null,libImplVersion=null,stageMode=null,clusterTimeout=3600000,altDD=null,altWlsDD=null,name=myWar,securityModel=null,securityValidationEnabled=false,versionIdentifier=null,isTestMode=false,forceUndeployTimeout=0,defaultSubmoduleTargets=true,timeout=0}

[BasicOperation.execute():424] : Initiating deploy operation for app, myWar, on targets:
[BasicOperation.execute():426] :    muletier
<strong>java.net.MalformedURLException: no protocol: and</strong>
        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)
        at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
        at javax.management.remote.rmi.RMIConnectionImpl$6.run(RMIConnectionImpl.java:1513)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.management.remote.rmi.RMIConnectionImpl.unwrap(RMIConnectionImpl.java:1505)
        at javax.management.remote.rmi.RMIConnectionImpl.access$500(RMIConnectionImpl.java:72)
        at javax.management.remote.rmi.RMIConnectionImpl$7.run(RMIConnectionImpl.java:1548)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.management.remote.rmi.RMIConnectionImpl.unwrap(RMIConnectionImpl.java:1544)
        at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:771)
        at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
        at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
[ServerConnectionImpl.close():334] : Closing DM connection
[ServerConnectionImpl.close():354] : Unregistered all listeners
[ServerConnectionImpl.closeJMX():374] : Closed JMX connection
[ServerConnectionImpl.closeJMX():386] : Closed Runtime JMX connection
[ServerConnectionImpl.closeJMX():398] : Closed Edit JMX connection

Explanation

Indeed, the " and " comes from the address of my local Maven 2 repository: C:\Documents and Settings\myLogin\.m2\repository, which is the default location. I consider this to be a bug of Mojo’s weblogic-maven-plugin plugin.

Fix

You do not have many choices :-(… You have to move your repository to a destination without blank spaces, such as C:\M2_repository.
Then, take care to edit your settings.xml, and add the following block after <settings> tag:

<localRepository>C:\M2_repository</localRepository>

PostHeaderIcon javax.naming.ConfigurationException / java.net.MalformedURLException

Context

I have to send JMS messages on queues on clustered servers: t3://firstServer:1234 and t3://secondServer:5678.

The destination queues are retrieved in Spring, thanks to a property like:

&lt;property name=&quot;providerURL&quot; value=&quot;t3://firstServer:1234,t3://secondServer:5678&quot;/&gt;

Error:

I receive the following error:

javax.naming.ConfigurationException [Root exception is java.net.MalformedURLException: port expected: t3://firstServer:1234,t3://secondServer:5678]

Explanation and fix:

When you send messages on many queues, you must not repeat the protocol (here: t3://)! Fixing the issue is very simple: you have to remove the second t3:// in Spring property:

&lt;property name=&quot;providerURL&quot; value=&quot;t3://firstServer:1234,secondServer:5678&quot;/&gt;