Error running Maven project: Unsupported protocol: t3


Error running Maven project: Unsupported protocol: t3



I have a Maven project for monitoring of weblogic servers through JMX. In the maven POM.xml, I specify the dependency for wlfullclient.jar through scope tag due to previous errors.


POM.xml


wlfullclient.jar


scope


<dependency>
<groupId>weblogic</groupId>
<artifactId>wlfullclient</artifactId>
<scope>system</scope>
<systemPath>${basedir}/libs/wlfullclient-11.1.1.4.0.jar</systemPath>
<version>11.1.1.4.0</version>
</dependency>



It builds successfully, however, when running the jar file, I get this error:


jar


java.net.MalformedURLException: Unsupported protocol: t3
at javax.management.remote.JMXConnectorFactory.newJMXConnector(Unknown Source)
at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)



I looked into the MANIFEST file in the built jar file, and noticed it lists all jars in the classpath, except this wlfullclient.jar one (and when I add it and update the manifest, it works).


wlfullclient.jar



Why is this happening? And how to fix it so it won't miss this classpath in the generated jar file?



UPDATES: these are all my dependencies in POM.xml:


POM.xml


<dependency>
<groupId>weblogic</groupId>
<artifactId>wlfullclient</artifactId>
<scope>system</scope>
<systemPath>${basedir}/libs/wlfullclient-11.1.1.4.0.jar</systemPath>
<version>11.1.1.4.0</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.24</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.8</version>
</dependency>
</dependencies>



And here is the MANIFEST.MF in the jar:


MANIFEST.MF


Manifest-Version: 1.0
Built-By: myname
Build-Jdk: 1.7.0_80
Class-Path: libs/slf4j-api-1.7.24.jar libs/logback-classic-1.2.1.jar l
ibs/logback-core-1.2.1.jar libs/mysql-connector-java-5.1.8.jar
Created-By: Apache Maven 3.3.3
Main-Class: main.WLStatusData
Archiver-Version: Plexus Archiver





This is how scope system works. Artifacts with such scope are not packaged together with all other dependencies
– Ivan
2 days ago


system




1 Answer
1



As Ivan has pointed, this is the expected behavior of using system scope. You can learn more here about it (Dependency Scope section).
To include your library jar into the result file you need to install it into your local maven repository with the command mvn install:install-file, more details here and use it as a simple dependency (without system scope and system path)


mvn install:install-file





Then what's the workaround? If I don't define it with scope, I can't even compile the project. It won't 'build success'
– Tina J
2 days ago





I've updated the answer with the description of what can be done
– Viktor Vlasov
2 days ago





In case you have full paths to your other dependencies in your MANIFEST file and they aren't included in the result jar file physically, then I think I need to see the rest of pom.xml for further help.
– Viktor Vlasov
2 days ago





Thanks. I did that now, but still not able to run. BTW, what is packaging field? I assume the other fields are what I have in my POM.xml? I don't have packaging there.
– Tina J
2 days ago


POM.xml





Packaging (if you talk about the parameter in install-file maven call) is the type of artifact you are going to install, in your case it should be jar
– Viktor Vlasov
2 days ago


install-file


jar






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift