MWD 10.5 CipherUtil for https

Hello,
I try to put my MWS server in https.
For this according to the documentation (available in techforum website) :
I have to execute this command line to ecrypt the certificate password :

java -cp “Software AG directory \common\lib\wm-caf-common.jar;
Software AG directory \common\lib\ext\log4j.jar;
Software AG directory \common\lib\wm-scg-security.jar;
Software AG directory \common\lib\wm-scg-core.jar;
Software AG directory \common\lib\ext\enttoolkit.jar”
com.webmethods.caf.common.CipherUtil password_to_encrypt

But it doesn"t work. The fact is if I take a look to filder where I’m supposed to find the jar, I don’t find them.

Hi Vital,

I have found a hint in my local documentation that the command is not working correctly.

Can you try the following command from the base directory of your installation:

java -cp common/lib/wm-caf-common.jar:common/lib/ext/log4j.jar com.webmethods.caf.common.CipherUtil

refers to the password you want to encrypt.
Eventually you need to provide the exact path to your java program when it is not in the search path variable.

Regards,
Holger

Yes I saw that but inn 10.5 version I haven’t the log4j.jar in common/lib/ext folder.

Hi Vital,

does the command work when log4j.jar is omitted from the classpath?

Otherwise search in your installation if there is a log4j.jar somewhere else in another folder.

Regards,
Holger

OK,
I tired ur command line

I received :

Error : impossible to find or load the main class com.webmethods.caf.common.CipherUtil

I tried what the documentation MWS AG(10.5)

I have the following error :

Hi Vital,

in this case check if there is a slf4j.jar somewhere under common directory.

Looks like they have used another logging mechanism now (slf4j instead of log4j).

Main jar required seems to be the wm-caf-common.jar.
Start with only providing this one in the classpath and then add jars when there are some classes missing.
This is the way I have derived the command provided earlier here, which only contains wm-caf-common.jar and log4j.jar.

Regards,
Holger

Hello Holder,
Thanks for your reply,
In common\lib\ext, I haven’t the slf4j.jar, I have the following jar which look like :

  • slf4j-api.jar
  • slf4j-ext.jar
  • slf4j-jdk14.ar
  • slf4j-log4j.jar

Hi Vital,

there are 2 options to find which one(s) is/are needed:
Either by Try-And-Error
Or by checking the contents of the jars with zip tool or “jar tvf” (to list content) to findout which jar contains the missing class(es).

Just start with wm-caf-common.jar and see which class is reported as missing and add the jars one by one until success.
Mist likely this will be slf4j-api.jar and/or slf4j-log4j.jar.

Regards,
Holger

1 Like

Hello Holger,
Thanks for your reply.
I used jar tfv (very usefull; I did’nt know).
I tried for the 4 jar files and no one of them seems to containe CipherUrtil class.

Because of my previous command return

Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

According to your advices, I tried the followinf commande line :

jvm\jvm\bin\java.exe -cp common\lib\wm-caf-common.jar;common\lib\ext\slf4j-api.jar;common\lib\wm-scg-security.jar;common\lib\wm-scg-core.jar;common\lib\ext\enttoolkit.jar com.webmethods.caf.common.CipherUtil password_to_encrypt

Because the java tfv command line for slf4j-api references the org/slf4j/LoggerFactory.class.

So After trying that, I have the followinf error :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
{AES}g2crJA/aj+fx/8FwFHE9IbjusY5830koFdRJ2qSPirg=

In a way this is refere to a class that SLF4J tools can not load.
But in other way, it look like if the system return me the password (encrypt) with the prefixe {AES}

It seems that the file org.slf4j.impl.StaticLoggerBinder is in common\lib\ext\slf4j-log4j.jar files.

So I use this command line to load the 4 slf4j filles :

jvm\jvm\bin\java.exe -cp common\lib\wm-caf-common.jar;common\lib\ext\slf4j-api.jar;common\lib\ext\slf4j-log4j.jar;common\lib\ext\slf4j-ext.jar;common\lib\ext\slf4j-jdk14.jar;common\lib\wm-scg-security.jar;common\lib\wm-scg-core.jar;common\lib\ext\enttoolkit.jar com.webmethods.caf.common.CipherUtil password_to_encrypt

It returns :

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/SoftwareAG105/common/lib/ext/slf4j-log4j.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/SoftwareAG105/common/lib/ext/slf4j-jdk14.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: [b]See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.[/b]
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: [b]org/apache/log4j/Level[/b]
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
        at com.webmethods.caf.common.CipherUtil.<clinit>(CipherUtil.java:39)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
        ... 6 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
        at com.webmethods.caf.common.CipherUtil.<clinit>(CipherUtil.java:39)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
        ... 6 more

There is two problems :

  • First the slf4j-log4j.jar and slf4j-log4j.jar contains the same StaticLoggerBinder.class
  • the Level classe dose not exist in the 4 files.