Wildfly 10 - CLI is running in a non-modular environment and cannot load commands from management extensions
matteg opened this issue · 5 comments
Attempting to execute with Wildfly 10.0.0.Final on a Windows 10 PC.
I created the attached batch file using the example .sh file
I receive an ominous warning (see title) followed by a java exception and stacktrace:
C:\s\ProfileCloner>cliCloner test.txt
$0 16Aug2016 Connect to WF10 CLI export utility
C:\s\ProfileCloner>SET CLASSPATH=.;c:\s\java32\lib\tools.jar;c:\s\jclasses\drivers\mysql.jar;C:\s\jclasses\jsoup\jsoup-1.6.3.jar;C:\s\wildfly-10.0.0.Final\bin\client\jboss-cli-client.jar;c:\s\ProfileCloner\profileCloner.jar
C:\s\ProfileCloner>java org.jboss.tfonteyne.profilecloner.Main --controller=GERRYDESKTOPPC --username=matteg --password=secret --file=test.txt --add-deployments=false /from=subsystem/mail mail
Aug 16, 2016 11:42:45 AM org.xnio.Xnio
INFO: XNIO version 3.3.4.Final
Aug 16, 2016 11:42:45 AM org.xnio.nio.NioXnio
INFO: XNIO NIO Implementation Version 3.3.4.Final
Aug 16, 2016 11:42:45 AM org.jboss.remoting3.EndpointImpl
INFO: JBoss Remoting version 4.0.18.Final
Aug 16, 2016 11:42:46 AM org.jboss.as.cli.impl.CommandContextImpl printLine
INFO: Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
java.lang.ArrayIndexOutOfBoundsException: Invalid address pair: mail
at org.jboss.tfonteyne.profilecloner.Address.(Address.java:44)
at org.jboss.tfonteyne.profilecloner.AddressStack.(AddressStack.java:43)
at org.jboss.tfonteyne.profilecloner.GenericCloner.(GenericCloner.java:78)
at org.jboss.tfonteyne.profilecloner.Main.(Main.java:131)
at org.jboss.tfonteyne.profilecloner.Main.main(Main.java:112)
C:\s\ProfileCloner>echo off
Waiting for 0 seconds, press a key to continue ...
C:\s\ProfileCloner>
cliCloner.bat.txt
hi,
You used:
java org.jboss.tfonteyne.profilecloner.Main --controller=GERRYDESKTOPPC --username=matteg --password=secret --file=test.txt --add-deployments=false /from=subsystem/mail mail
but the syntax for the node is: /from=value
so you should use: /subsystem=mail mail
From the help screen:
Examples for "/from=value destinationvalue":
...
Standalone server:
/subsystem=security security
closing as not an issue
(edit: typo)
I should have mentioned that my first test used /subsystem/mail mail as you suggest.
Today I repeated the test and received the same result.
I also tried using /from=/subsystem/Mail Mail in case your program was case sensitive.
Same result.
I am attaching the log from today's test and also a screen image of my Admin console showing the default mail session exists.
20160817-exception.txt
WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
Windows 2008R2
Java 1.8.0_91
window 1:
C:\jboss\w10\bin>set JBOSS_HOME=c:\jboss\w10
C:\jboss\w10\bin>add-user.sh
...
C:\jboss\w10\bin>standalone.bat
(starts all ok)
Window 2:
C:\jboss\w10>set JBOSS_HOME=c:\jboss\w10
C:\jboss\w10>java -cp c:\jboss\w10\profilecloner.jar;.\bin\client\jboss-cli-client.jar org.jboss.tfonteyne.profilecloner.Main -c localhost -u admin -p secret
-f out.txt /subsystem=mail mail
aug 18, 2016 11:13:05 AM org.xnio.Xnio
INFO: XNIO version 3.3.4.Final
aug 18, 2016 11:13:05 AM org.xnio.nio.NioXnio
INFO: XNIO NIO Implementation Version 3.3.4.Final
aug 18, 2016 11:13:05 AM org.jboss.remoting3.EndpointImpl
INFO: JBoss Remoting version 4.0.18.Final
aug 18, 2016 11:13:06 AM org.jboss.as.cli.impl.CommandContextImpl printLine
INFO: Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
C:\jboss\w10>type out.txt
batch
/subsystem="mail":add()
/subsystem="mail"/mail-session="default":add(jndi-name="java:jboss/mail/Default")
/subsystem="mail"/mail-session="default"/server="smtp":add(outbound-socket-binding-ref="mail-smtp")
run-batch
So works for me. Check your script for a start and double check the above syntax.
Looking over your sample, I realised that I had been using the domain version of defining the subsystem.
When I replaced /from=/subsystem/Mail Mail with /subsystem=mail mail everything worked fine.
If I may request - would it be possible to change your system to:
- Support using the same parameters whether the server is running in domain mode or standalone mode. This would avoid the problem altogether for those of us who always use standalone mode.
- Catch the exception and suggest that the user verify they are really running in domain mode .... are they perhaps running standalone ?
The tool is largely unaware of it being in domain or standalone mode.
The only time it notices is when you use the shortcut command to clone a full standalone profile
from the doc:
profile
The latter being a shortcut to clone all subsystems in individual batches
Other than this, the syntax is identical: /somenode=somename[/...] destinationname