Archive

Archive for the ‘WebLogic’ Category

Unable to start WLST: “Problem invoking WLST – Traceback (most recent call last)”

The above error means that the correct CLASSPATH has not been set in order to start WLST because of environment not being properly set. The same error can occur for other utilities such as weblogic.Deployer, utils.dbping or even weblogic.Server etc. I was using this decrypt weblogic admin password.

Exact Error was as below

$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Problem invoking WLST - Traceback (most recent call last):
  File "/tmp/WLSTOfflineIni7376338350886613784.py", line 3, in <module>
    import os
ImportError: No module named os

-bash-4.1$

The root cause is always the same, Correct environment not being properly Set and hence the required classes are not loaded.
To fix this, set your environment explicitly using

1. Make sure the right environment is set by running the setWLSEnv.sh script. This is located under @MW_HOME/wlserver/server/bin

The setWLSEnv.sh script needs to be sourced in order to execute the script in the context of the running shell, and have the actual environment of the shell be set. It has to be executed as either ” ./setWLSEnv.sh” (notice the extra dot) or “source ./setWLSEnv.sh” and then the CLASSPATH can be confirmed in the current shell with the “env” command.

Simply executing the script “./setWLSEnv.sh” will only display the output on the screen.

Once the environment is set, I was able to run the java weblogic.WLST successfully

-bash-4.1$ . ./setWLSEnv.sh
CLASSPATH=/xxxxxx/fmw/jdk1.7.0_51/lib/tools.jar:/xxxxxx/fmw/product/12/wlserver/server/lib/weblogic_sp.jar:/xxxxxx/fmw/product/12/wlserver/server/lib/weblogic.jar:/xxxxxx/fmw/product/12/wlserver/server/webservices.jar:/xxxxxx/fmw/product/12/oracle_common/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/xxxxxx/fmw/product/12/oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/xxxxxx/product/12/wlserver/modules/features/oracle.wls.common.nodemanager_1.0.0.0.jar:

PATH=/xxxxxx/fmw/product/12/wlserver/server/bin:/xxxxxx/fmw/product/12/oracle_common/modules/org.apache.ant_1.7.1/bin:/xxxxxx/fmw/jdk1.7.0_51/jre/bin:/xxxxxx/fmw/jdk1.7.0_51/bin:/xxxxxx/fmw/jdk1.7.0_51//usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/xxxxxx/fmw/product/12/oracle_common/modules/org.apache.maven_3.0.4/bin

Your environment has been set.
-bash-4.1$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline>

Hope this helps.
-Anand M

Advertisement
Categories: WebLogic Tags: ,

java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLParserExtension

June 20, 2017 2 comments

I was working on to clone a web application running on Weblogic 12.1.1. Objective was to create a new DEV instance for already a working UAT instance.

I installed the Weblogic 12.1.1 on Oracle Linux 5.11 and installation completed successfully including the domain configuration.

Later on when I started deploying the application (WAR file), I got an error in the Weblogic log despite application deployment showing ‘success’. Below is the error I got in the log.

Caused By: com.sun.xml.ws.server.ServerRtException: exception during WSDL parsing: file:/u01/fmw/oracle/product/12/user_projects/domains/mydomain/servers/ManagedServer_1/tmp/_WL_user/vertex-remote-services/hkmfe6/war/WEB-INF/wsdl/VertexIncSystemUserPreferenceService_6_0.wsdl
        at com.sun.xml.ws.server.EndpointFactory.getWSDLPort(EndpointFactory.java:532)
        at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:175)
        at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
        at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
        at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
        Truncated. see log file for complete stacktrace
Caused By: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLParserExtension is specified in jar:file:/u01/fmw/oracle/product/12/oracle_common/modules/com.oracle.webservices.wls.wls-ws-metainf-services-impl_12.1.3.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.parser.WSDLParserExtensionbut could not be instantiated: <strong>java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLParserExtension</strong> to com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension
        at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
        at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
        at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:379)
        at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:225)
        at com.sun.xml.ws.server.EndpointFactory.getWSDLPort(EndpointFactory.java:510)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLParserExtension to com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension

To troubleshoot, first tried to see what is defined under “container description” inside ‘weblogic.xml’ file of the application. This file is located in WEB-INF directory of the WAR file and it is already set to TRUE

<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>

Now after further investigation and going through some other forums, I was clear with the error that it is due to the conflict of application related classes with that of system classes (Weblogic owned libraries of class)
I looked into the list of all Weblogic(system) classes. Location of the file is $MW_HOME/wlserver_12.1/server/lib/weblogic.jar.
Extracted the weblogic.jar into a temp location (jar -xvf weblogic.jar) and once the jar file is extracted, related system class files are located in /META-INF/services and prepared the list of all the class files.

Extracted the application WAR file and traversed to the location of class files (in my case it is – /temp/vertex-remote-services/WEB-INF/lib)
created a small shell script – idea was to look for each class files which are present in weblogic.jar (System class files) see find if it is there in application WAR file as well.

#! /usr/bin/ksh
_jarfile="jarlist.txt" ### Contains the list of system class files obtained above
while read _list;do
for i in *.jar; do jar -tvf "$i" | grep -Hsi ""${_list}"" && echo "$i"; done
done < $_jarfile

Whatever files found in both the places, corresponding class file is removed from weblogic.jar. This will avoid the conflict and hence the error.
Go to weblogic.jar location ($MW_HOME/wlserver_12.1/server/lib/weblogic.jar) and run below command

$ zip -d weblogic.jar META-INF/services/com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension
deleting: META-INF/services/com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension

This way removed all the conflicting class file from the system CLASS libraries. Stopped and started the managed server and deployed the application. This completed successfully and all the “ClassCastException” were gone.

P.s- I was getting similar errors even with WebLogic 12.1.3 and did the same for 12.1.3 as well to get rid of all the errors.

-Happy learning
Anand

Categories: WebLogic Tags:

Decrypt weblogic admin password

November 22, 2016 Leave a comment

Pls follow below steps to decrypt Weblogic admin password

Step 1:- Create a file called – decryptPass.py and udpate the file with below cotents


import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService

def decrypt(domainHomeName, encryptedPwd):
domainHomeAbsolutePath = os.path.abspath(domainHomeName)
encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
clear = ces.decrypt(encryptedPwd)
print "RESULT:" + clear

try:
if len(sys.argv) == 3:
decrypt(sys.argv[1], sys.argv[2])
else:
print "INVALID ARGUMENTS"
print " Usage: java weblogic.WLST decryptPassword.py DOMAIN_HOME ENCRYPTED_PASSWORD"
print " Example:"
print " java weblogic.WLST decryptPassword.py D:/Oracle/Middleware/user_projects/domains/base_domain {AES}819R5h3JUS9fAcPmF58p9Wb3syTJxFl0t8NInD/ykkE="
except:
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise

Step 2:- Set Domain environment variable

cd $FMW_HOME/user_projects/domains/<domain_name>


. setDomainEnv.sh

Once it is properly set, do echo $DOMAIN_HOME and you will find it getting properly displayed

Step 3:- Get encrypted password value from boot.properties file


$ grep password $DOMAIN_HOME/servers/AdminServer/security/boot.properties | sed -e "s/^password=\(.*\)/\1/"

{AES}udb6nZLDw24HiRRrZkojuoiLNiu/MfAIZpcU=

Step 4:- Decrypt the encrypted password obtained in Step 3 (Run the command from the location where the decryptPass.py is kept)


java weblogic.WLST decryptPass.py $DOMAIN_HOME {AES}udb6nZLDw24HiRRrZkojuoiLNiu/MfAIZpcU=

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

RESULT:r41cOWqpc

Hope this helps. Happy reading!

-Anand M

WebLogic Server 12c (Rel 12.1.1.) installation on RHEL 5 Update 3

Software – Following software are needed for WebLogic Server (WLS) 12c (Release 12.1.1) on RHEL 5 Update 3

  1. WebLogic Server 12c Release 12.1.1 – Generic Installer
    1. http://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html
      1. For Licensed customer, s/w must be downloaded from Oracle e-Delivery
    2. JDK (User here is 7u2 Linux64 RPM) – Download it from
      1. http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Please refer the below link for complete stepwise (with screenshots) document on the installation.

https://anandmandilwar.files.wordpress.com/2013/05/weblogic12c_installation_on_rhel51.pdf

-Anand M

Categories: WebLogic