Archive

Archive for the ‘WebLogic’ Category

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

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

Advertisements
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