WTC Configuration with WLST script
Hi,
Can any one help me to write WLST script to create WTC configuration.
Regards,
Siva Prasad Reddy
Use the MBean reference manual to find the appropriate configuration mbeans. Use the WLST reference manual to find the appropriate command syntax
- connect
- edit
- startEdit
at domain level
wserver = cmo.createWTCServer("wtcname")
then either cd into the created WTCServer or use the returned wserver
then call methods like createWTCLocalTuxDom and createWTCRemoteTuxDom as needed.
cd into those subdirectories as needed.
you may also want to turn on WLST console recording and perform the steps in the WLS console. a WLST script will be generated that you can then further customize.
Similar Messages
-
Create Customization File in OSB 10g with WLST script
Is it possible to create a customization file the same as created from the OSB console with a WLST script?
Can someone show me the syntax to do this? I need to turn this request around quickly and don't have time for a lot of trial and error.
Edited by: DoubleT on Sep 29, 2009 6:44 PMI resolved my problem. The solution is follow (Java language):
Set<Ref> domainRefs = alsbConfMB.getRefs(businessServiceQuery);
EnvValueQuery evquery = new EnvValueQuery(null, // search across all
// resource types
envValueTypesToSearch, domainRefs, // search only in found refs.
false, // Search all resources
null, // the string we want to replace
false // not a complete match of URI.
Collection<QualifiedEnvValue> founds = alsbConfMB.findEnvValues(evquery);
List<QualifiedEnvValue> qualifiedEnvValueList = new ArrayList<QualifiedEnvValue>();
for (QualifiedEnvValue qev : founds) {
if (qev.getEnvValueType().equals(EnvValueTypes.SERVICE_URI)) {
qualifiedEnvValueList.add(qev);
EnvValueCustomization projectEnvValsCustomization = new EnvValueCustomization("Customizations File for businss services ", qualifiedEnvValueList);
List<Customization> customizationList = new ArrayList<Customization>();
customizationList.add(projectEnvValsCustomization);
OutputStream fileOutputStream = new FileOutputStream("testCustomization.xml");
Customization.toXML(customizationList, fileOutputStream);
fileOutputStream.close(); -
Issues with WLST script - configToScript.py
Hi folks,
If you know can you please help me here.
I am trying to use configToScript() to create a script for existing domain to convert to script. I can create the script, but when i ran the script. It is failing, do you know what are the changes to be made to make this work.
And Is there a sample script to edit the current domain.
Thanks,
H.Hello dominique,
Couple of ways to do this:
1) java weblogic.WLST config.py
Or
2) java weblogic.WLST
wls:/offline> execfile("config.py")
thanks,
-satya
Dominique Jean-Prost wrote:
Hello,
I've just discovered wlst thanks to WLDJ. Previously I used to work with WLShell.
Anyway, I've managed to use configToScript, and I now have the propseties file and the .py file. How do I use the .py ? How do I rerun the script so that I get a new Server ?
Regards,
Dom -
Proxy automatic configuration with PAC script file
Dears,
Regarding HTTP communications, I would like to auto-detect proxy settings based on system settings.
I can get information on manually configured proxy, using the following code:
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
public class Test {
public static void main(String[] args) {
System.setProperty("java.net.useSystemProxies", "true");
try {
List<Proxy> list = ProxySelector.getDefault().select(new URI("http://www.google.be/"));
for(int i=0; i<list.size(); i++){
System.out.println(list.get(i));
} catch (URISyntaxException e) {
e.printStackTrace();
}But ...
I haven't found a way yet to get proxy information from automatic proxy configuration script (pac files).
Has anyone encountered/solved this problem yet?
Many thanks for your help,
Ericwell the simple fact, as far as i know, is there just is no autoproxydetection out of the box library for standalone java apps.
there are some libraries out there, but none of which integrate all the functionality as the java plugin/webstart does. and i could not be able to integrate the webstart jar (javaws.jar, deploy.jar, etc.) into a standalone app. a promising project is the "proxy vole" project on kenai, but that's only beta and not all necessary stuff is there.
i noticed that the eclipse project has some proxy autodetection code and there are a few hints & tricks sites out on the web, explaining how you can do proxy autodetection yourself, like reading, at least for windows, registry keys and a dll to process a proxy pac file, but for instance, no support for windows WAPD through DNS/DHCP.
I've spent quite some hours to do research on all these things, and it's just missing for standalone apps. i was really surprised that sun does not provide the same stuff for standalone apps as they do for webstart apps, which in my opinion is really really dissapointing. maybe they plan to do that, but i wasn't able to find any information about that.
well, that's all i know so far. -
OSB - ALSB / WLST / Security / add entry with WLST in Access Control
Hello,
I try to reproduce with WLST script the input from the consol to declare user on Access Control proxy (security).
sbconsol->$Proxy Service->Security->General Confiruration->Access Control->Transport Access Control->Add Conditions
* First implementation without success with the com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean : accessControlSecurity1()
* Second try with the service definition of the proxy service but cannot parse with Xpath accessControl Security2()
any idee ???
test case :
prerequisit
create an ALSB domain 10.3 (admin one with username='weblogic' password='weblogic' url='t3://localhost:7001') and create a proxy service on the default project
conf/setEnv.cmd
@CLS
@echo ON
@set BEA_HOME=D:\PRODUCT\MIDDLEWARE\SOA\OSB_10.3
@set WL_HOME=%BEA_HOME%\wlserver_10.3
@set OSB_HOME=%BEA_HOME%\osb_10.3
@set SCRIPTING_HOME=E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security
@set OSB_LIB=%OSB_HOME%/lib/sb-kernel-api.jar;%BEA_HOME%/modules/com.bea.alsb.statistics_1.0.1.0.jar;%OSB_HOME%/lib/sb-kernel-resources.jar;%OSB_HOME%/lib/sb-kernel-common.jar;%OSB_HOME%/lib/sb-kernel-impl.jar;%OSB_HOME%\lib\sb-security.jar;%OSB_HOME%/modules/com.bea.common.configfwk_1.3.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.1.0.jar;%OSB_HOME%/lib/modules/com.bea.alsb.resources.archive.jar;
@set TOOL_LIB=%SCRIPTING_HOME%\lib\log4j-1.2.15.jar;%SCRIPTING_HOME%\lib\jsch-0.1.43.jar;%SCRIPTING_HOME%\lib\db2jcc.jar
@set CLASSPATH=%OSB_LIB%;%TOOL_LIB%;%CLASSPATH%
@set CLASSPATH=%SCRIPTING_HOME%\lib\db2jcc.jar;%TOOL_LIB%;%CLASSPATH%
@set MODULE_LIB=%SCRIPTING_HOME%\lib
@call %WL_HOME%\server\bin\setWLSEnv.cmd > nul 2<&1
launch.cmd
@CLS
@echo OFF
@SETLOCAL
@call "conf\setEnv.cmd" > nul 2<&1
set PWD=%~dp0
%JAVA_HOME%\bin\java -Dmodule.lib=%MODULE_LIB% weblogic.WLST -skipWLSModuleScanning lib/security.py
lib/security.py
from com.bea.wli.monitoring import StatisticType
from java.util import HashMap
from java.util import HashSet
from java.util import ArrayList
from java.util import Collections
from java.io import FileInputStream
from java.io import FileOutputStream
from java.lang import String
from java.lang import Boolean
from com.bea.wli.sb.util import EnvValueTypes
from com.bea.wli.config.env import EnvValueQuery;
from com.bea.wli.config import Ref
from com.bea.wli.config.customization import Customization
from com.bea.wli.config.customization import EnvValueCustomization
from com.bea.wli.config.customization import FindAndReplaceCustomization
from com.bea.wli.sb.management.configuration import SessionManagementMBean
from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
from com.bea.wli.sb.management.query import BusinessServiceQuery
from com.bea.wli.sb.management.query import ProxyServiceQuery
from com.bea.wli.sb.management.configuration import ServiceConfigurationMBean
import os
# before, create an ALSB domain 10.3 with a proxy service in the default project and add an Acces Control Policy in the consol
# sbconsol->Project Explorer->default->${proxy service}->Security->Access Control->Create Session->Add Conditions->User->USR_1->Add
# when we try to modify the Acces Control Policy of the proxy service with the ServiceSecurityConfigurationMBean
def accessControlSecurity1( domain_name ):
# connection
print "\n\n\n***********************************************************************************************"
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
domainRuntime()
# create a session
sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
SessionMBean.createSession(sessionName)
# get the ServiceSecurityConfigurationMBean
serviceSecurityConfigurationMBean = findService(String("ServiceSecurityConfiguration.").concat(sessionName), "com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean")
# get the XACMLAuthorizer
working_directory=pwd()
serverConfig()
xacmlAuthorizer = cd('/SecurityConfiguration/%s/Realms/myrealm/Authorizers/XACMLAuthorizer' % domain_name )
cd(working_directory)
domainRuntime()
# get service ref
ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
bsQuery = ProxyServiceQuery()
bsQuery.setPath("default/*")
refs = ConfigurationMBean.getRefs(bsQuery)
for ref in refs:
print 'ref=%s'%ref
# use the security Mbean to add : USER_A,USER_B,USER_C to the policy
policyHolder = serviceSecurityConfigurationMBean.newAccessControlPolicyHolderInstance(xacmlAuthorizer)
policyHolder.setPolicyExpression("Usr(USER_A,USER_B,USER_C)")
policyScope = serviceSecurityConfigurationMBean.newDefaultMessagePolicyScope(ref)
serviceSecurityConfigurationMBean.setAccessControlPolicy(policyScope,policyHolder)
# print the service definition
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
print serviceDefinition
# we can see the security entry in the service definition has follow
# <xml-fragment xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
# <ser:coreEntry isProxy="true" isEnabled="true" isAutoPublish="false">
# <ser:description/>
# <ser:security>
# <con:access-control-policies xmlns:con="http://www.bea.com/wli/sb/services/security/config">
# <con:message-level-policies>
# <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config">
# <con:policy provider-id="XACMLAuthorizer">
# <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
# </con:policy>
# </con1:default-policy>
# </con:message-level-policies>
# </con:access-control-policies>
# </ser:security>
# but when we commit
SessionMBean.activateSession(sessionName, "description for session activation")
# we got the following exception
# Unexpected error: com.bea.wli.config.session.SessionConflictException
# No stack trace available.
# Problem invoking WLST - Traceback (innermost last):
# File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 246, in ?
# File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 105, in accessControlSecurity1
# com.bea.wli.config.session.SessionConflictException: Conflicts for session SessionScript1363339726764
# [Non-Critical] Concurrent Modification Conflicts
# NONE
# [Critical] Resources with validation errors
# 1 - ProxyService test/PS_TEST_bis CannotCommit
# + CannotCommit [OSB Security:386836]Unnecessary proxy wide message access control policy found for service "test/PS_TEST_bis". Hint: The service is neither an active security
# intermediary nor has custom authentication enabled. ServiceDiagnosticLocation[SECURITY_TAB]:DiagnosticLocation:<con:message-level-policies xmlns:ser="http://www.bea.com/wli/sb/services" xml
# ns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env" xmlns:con="http://www.bea.com/wli/sb/services/security/config">
# <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/
# config">
# <con:policy provider-id="XACMLAuthorizer">
# <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
# </con:policy>
# </con1:default-policy>
# </con:message-level-policies>
# [Info] Informational messages
# NONE
# at com.bea.wli.config.session.SessionManager.commitSessionUnlocked(SessionManager.java:358)
# at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:339)
# at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:297)
# at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:306)
disconnect()
# when we try to modify the Acces Control Policy of the proxy service whith the service XML definition
def accessControlSecurity2( domain_name ):
# connection
print "\n\n\n***********************************************************************************************"
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
domainRuntime()
# create a session
sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
SessionMBean.createSession(sessionName)
# get service ref
ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
bsQuery = ProxyServiceQuery()
bsQuery.setPath("default/*")
refs = ConfigurationMBean.getRefs(bsQuery)
for ref in refs:
print 'ref=%s'%ref
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
# parsing the proxy definition
nsSer = "declare namespace ser='http://www.bea.com/wli/sb/services'"
nsXsi = "declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'"
nsTran = "declare namespace tran='http://www.bea.com/wli/sb/transports'"
nsEnv = "declare namespace env='http://www.bea.com/wli/config/env'"
nsCon = "declare namespace con='http://www.bea.com/wli/sb/services/security/config'"
nsCon1 = "declare namespace con1='http://www.bea.com/wli/sb/services/security/config'"
# when we try to parse the following Xpath Expression, it' working but not sufficent to access the <con:policy-expression> element
confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy"
confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
print "WORKING{%s}" % confElem
# get the result
# <xml-fragment xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config" xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
# <con:policy provider-id="XACMLAuthorizer">
# <con:policy-expression>Usr(USER_1,USER_2,USER_3)</con:policy-expression>
# </con:policy>
# </xml-fragment>
# and when we try to acces the <con:policy> element whith the following Xpath expression we got an empty result
confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy/con:policy"
confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
print "DON'T WORKING{%s}" % confElem
# get empty result
# array([], org.apache.xmlbeans.XmlObject)
# want to modify the value like this on the <con:policy-expression> but cannot reach it ...
#confValue="Usr(USER_A,USER_B,USER_C)"
#confElem.setStringValue(confValue)
# commit
SessionMBean.activateSession(sessionName, "description for session activation")
disconnect
# print the service definition
def printServiceDefinition( domain_name ):
# connection
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
domainRuntime()
# create a session
sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
SessionMBean.createSession(sessionName)
# get service ref
ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
bsQuery = ProxyServiceQuery()
bsQuery.setPath("default/*")
refs = ConfigurationMBean.getRefs(bsQuery)
for ref in refs:
print 'ref=%s'%ref
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
print serviceDefinition
# commit
SessionMBean.activateSession(sessionName, "description for session activation")
disconnect
#accessControlSecurity1('cluster_domain')
accessControlSecurity2('cluster_domain')Hello,
I try to reproduce with WLST script the input from the consol to declare user on Access Control proxy (security).
sbconsol->$Proxy Service->Security->General Confiruration->Access Control->Transport Access Control->Add Conditions
* First implementation without success with the com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean : accessControlSecurity1()
* Second try with the service definition of the proxy service but cannot parse with Xpath accessControl Security2()
any idee ???
test case :
prerequisit
create an ALSB domain 10.3 (admin one with username='weblogic' password='weblogic' url='t3://localhost:7001') and create a proxy service on the default project
conf/setEnv.cmd
@CLS
@echo ON
@set BEA_HOME=D:\PRODUCT\MIDDLEWARE\SOA\OSB_10.3
@set WL_HOME=%BEA_HOME%\wlserver_10.3
@set OSB_HOME=%BEA_HOME%\osb_10.3
@set SCRIPTING_HOME=E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security
@set OSB_LIB=%OSB_HOME%/lib/sb-kernel-api.jar;%BEA_HOME%/modules/com.bea.alsb.statistics_1.0.1.0.jar;%OSB_HOME%/lib/sb-kernel-resources.jar;%OSB_HOME%/lib/sb-kernel-common.jar;%OSB_HOME%/lib/sb-kernel-impl.jar;%OSB_HOME%\lib\sb-security.jar;%OSB_HOME%/modules/com.bea.common.configfwk_1.3.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.1.0.jar;%OSB_HOME%/lib/modules/com.bea.alsb.resources.archive.jar;
@set TOOL_LIB=%SCRIPTING_HOME%\lib\log4j-1.2.15.jar;%SCRIPTING_HOME%\lib\jsch-0.1.43.jar;%SCRIPTING_HOME%\lib\db2jcc.jar
@set CLASSPATH=%OSB_LIB%;%TOOL_LIB%;%CLASSPATH%
@set CLASSPATH=%SCRIPTING_HOME%\lib\db2jcc.jar;%TOOL_LIB%;%CLASSPATH%
@set MODULE_LIB=%SCRIPTING_HOME%\lib
@call %WL_HOME%\server\bin\setWLSEnv.cmd > nul 2<&1
launch.cmd
@CLS
@echo OFF
@SETLOCAL
@call "conf\setEnv.cmd" > nul 2<&1
set PWD=%~dp0
%JAVA_HOME%\bin\java -Dmodule.lib=%MODULE_LIB% weblogic.WLST -skipWLSModuleScanning lib/security.py
lib/security.py
from com.bea.wli.monitoring import StatisticType
from java.util import HashMap
from java.util import HashSet
from java.util import ArrayList
from java.util import Collections
from java.io import FileInputStream
from java.io import FileOutputStream
from java.lang import String
from java.lang import Boolean
from com.bea.wli.sb.util import EnvValueTypes
from com.bea.wli.config.env import EnvValueQuery;
from com.bea.wli.config import Ref
from com.bea.wli.config.customization import Customization
from com.bea.wli.config.customization import EnvValueCustomization
from com.bea.wli.config.customization import FindAndReplaceCustomization
from com.bea.wli.sb.management.configuration import SessionManagementMBean
from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
from com.bea.wli.sb.management.query import BusinessServiceQuery
from com.bea.wli.sb.management.query import ProxyServiceQuery
from com.bea.wli.sb.management.configuration import ServiceConfigurationMBean
import os
# before, create an ALSB domain 10.3 with a proxy service in the default project and add an Acces Control Policy in the consol
# sbconsol->Project Explorer->default->${proxy service}->Security->Access Control->Create Session->Add Conditions->User->USR_1->Add
# when we try to modify the Acces Control Policy of the proxy service with the ServiceSecurityConfigurationMBean
def accessControlSecurity1( domain_name ):
# connection
print "\n\n\n***********************************************************************************************"
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
domainRuntime()
# create a session
sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
SessionMBean.createSession(sessionName)
# get the ServiceSecurityConfigurationMBean
serviceSecurityConfigurationMBean = findService(String("ServiceSecurityConfiguration.").concat(sessionName), "com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean")
# get the XACMLAuthorizer
working_directory=pwd()
serverConfig()
xacmlAuthorizer = cd('/SecurityConfiguration/%s/Realms/myrealm/Authorizers/XACMLAuthorizer' % domain_name )
cd(working_directory)
domainRuntime()
# get service ref
ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
bsQuery = ProxyServiceQuery()
bsQuery.setPath("default/*")
refs = ConfigurationMBean.getRefs(bsQuery)
for ref in refs:
print 'ref=%s'%ref
# use the security Mbean to add : USER_A,USER_B,USER_C to the policy
policyHolder = serviceSecurityConfigurationMBean.newAccessControlPolicyHolderInstance(xacmlAuthorizer)
policyHolder.setPolicyExpression("Usr(USER_A,USER_B,USER_C)")
policyScope = serviceSecurityConfigurationMBean.newDefaultMessagePolicyScope(ref)
serviceSecurityConfigurationMBean.setAccessControlPolicy(policyScope,policyHolder)
# print the service definition
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
print serviceDefinition
# we can see the security entry in the service definition has follow
# <xml-fragment xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
# <ser:coreEntry isProxy="true" isEnabled="true" isAutoPublish="false">
# <ser:description/>
# <ser:security>
# <con:access-control-policies xmlns:con="http://www.bea.com/wli/sb/services/security/config">
# <con:message-level-policies>
# <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config">
# <con:policy provider-id="XACMLAuthorizer">
# <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
# </con:policy>
# </con1:default-policy>
# </con:message-level-policies>
# </con:access-control-policies>
# </ser:security>
# but when we commit
SessionMBean.activateSession(sessionName, "description for session activation")
# we got the following exception
# Unexpected error: com.bea.wli.config.session.SessionConflictException
# No stack trace available.
# Problem invoking WLST - Traceback (innermost last):
# File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 246, in ?
# File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 105, in accessControlSecurity1
# com.bea.wli.config.session.SessionConflictException: Conflicts for session SessionScript1363339726764
# [Non-Critical] Concurrent Modification Conflicts
# NONE
# [Critical] Resources with validation errors
# 1 - ProxyService test/PS_TEST_bis CannotCommit
# + CannotCommit [OSB Security:386836]Unnecessary proxy wide message access control policy found for service "test/PS_TEST_bis". Hint: The service is neither an active security
# intermediary nor has custom authentication enabled. ServiceDiagnosticLocation[SECURITY_TAB]:DiagnosticLocation:<con:message-level-policies xmlns:ser="http://www.bea.com/wli/sb/services" xml
# ns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env" xmlns:con="http://www.bea.com/wli/sb/services/security/config">
# <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/
# config">
# <con:policy provider-id="XACMLAuthorizer">
# <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
# </con:policy>
# </con1:default-policy>
# </con:message-level-policies>
# [Info] Informational messages
# NONE
# at com.bea.wli.config.session.SessionManager.commitSessionUnlocked(SessionManager.java:358)
# at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:339)
# at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:297)
# at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:306)
disconnect()
# when we try to modify the Acces Control Policy of the proxy service whith the service XML definition
def accessControlSecurity2( domain_name ):
# connection
print "\n\n\n***********************************************************************************************"
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
domainRuntime()
# create a session
sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
SessionMBean.createSession(sessionName)
# get service ref
ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
bsQuery = ProxyServiceQuery()
bsQuery.setPath("default/*")
refs = ConfigurationMBean.getRefs(bsQuery)
for ref in refs:
print 'ref=%s'%ref
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
# parsing the proxy definition
nsSer = "declare namespace ser='http://www.bea.com/wli/sb/services'"
nsXsi = "declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'"
nsTran = "declare namespace tran='http://www.bea.com/wli/sb/transports'"
nsEnv = "declare namespace env='http://www.bea.com/wli/config/env'"
nsCon = "declare namespace con='http://www.bea.com/wli/sb/services/security/config'"
nsCon1 = "declare namespace con1='http://www.bea.com/wli/sb/services/security/config'"
# when we try to parse the following Xpath Expression, it' working but not sufficent to access the <con:policy-expression> element
confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy"
confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
print "WORKING{%s}" % confElem
# get the result
# <xml-fragment xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config" xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
# <con:policy provider-id="XACMLAuthorizer">
# <con:policy-expression>Usr(USER_1,USER_2,USER_3)</con:policy-expression>
# </con:policy>
# </xml-fragment>
# and when we try to acces the <con:policy> element whith the following Xpath expression we got an empty result
confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy/con:policy"
confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
print "DON'T WORKING{%s}" % confElem
# get empty result
# array([], org.apache.xmlbeans.XmlObject)
# want to modify the value like this on the <con:policy-expression> but cannot reach it ...
#confValue="Usr(USER_A,USER_B,USER_C)"
#confElem.setStringValue(confValue)
# commit
SessionMBean.activateSession(sessionName, "description for session activation")
disconnect
# print the service definition
def printServiceDefinition( domain_name ):
# connection
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
domainRuntime()
# create a session
sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
SessionMBean.createSession(sessionName)
# get service ref
ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
bsQuery = ProxyServiceQuery()
bsQuery.setPath("default/*")
refs = ConfigurationMBean.getRefs(bsQuery)
for ref in refs:
print 'ref=%s'%ref
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
serviceDefinition = servConfMBean.getServiceDefinition(ref)
print serviceDefinition
# commit
SessionMBean.activateSession(sessionName, "description for session activation")
disconnect
#accessControlSecurity1('cluster_domain')
accessControlSecurity2('cluster_domain') -
Creation of Customisation file from WLST Script in OSB
Hi,
Please help in creating Customisation file in OSB from WLST ScriptsHi,
Please refer -
Create Customization File in OSB 10g with WLST script
http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/deploy/config_appx.html
http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/javadoc/com/bea/wli/config/customization/Customization.html
Regards,
Anuj -
ALSB Deployment using WLST scripts
Hi
Any body can help me with WLST scripts for Deployments on ALSB ?Also, for ALSB particular questions, you should use the SOA Suite forum:
SOA Suite -
Configuring Credential mapper using WLST script
Is it possible to use a wlst script to define a new credential mapper.i.e.to [perform the following steps:
Check Use cross-domain protocol.
And then fill in the the values of the attributes which follow like remote host remote user and remote password.
I tried using the wlst recording for the same.However got the following message.
A security change to a role, policy, user, group or credential mapping was made, but this change was not recorded.
I was wondering if we can access the security MBeans using WLST.
Please advise.
Thanks in advance.It is possible if you export the properties with:
connect(url='t3://localhost:7001',adminServerName='AdminServer',timeout=60000)
serverConfig()
cd('/')
currentDomainName=cmo.getName()
cd('serverConfig:/SecurityConfiguration/' + currentDomainName + '/Realms/myrealm/CredentialMappers/DefaultCredentialMapper')
prop=Properties()
cmo.exportData('DefaultCreds','/tmp/credentialmapper_properties.txt',prop)Edit them, then import them with:
cmo.importData('DefaultCreds','/tmp/credentialmapper_properties.txt',prop)You can list the Credential Mapper configuration with:
connect(url='t3://localhost:7441',adminServerName='AdminServer',timeout=60000)
serverConfig()
cd('/')
currentDomainName=cmo.getName()
cd('serverConfig:/SecurityConfiguration/' + currentDomainName + '/Realms/myrealm/CredentialMappers/DefaultCredentialMapper')
cursor=cmo.listMappingsByPattern('*',10)
while cmo.haveCurrent(cursor):
# A resource ID looks like: 'type=<remote>, protocol=cross-domain-protocol, remoteHost=testDomain'
current_mapping_resource_id=cmo.getCurrentMappingResourceID(cursor)
cmo.getRemoteUserName(current_mapping_resource_id,'cross-domain')
cmo.advance(cursor)
cmo.close(cursor)See also: [url http://download.oracle.com/docs/cd/E12839_01/web.1111/e13707/security_data_migration.htm]Securing WebLogic Server 11g Release 1 (10.3.1) - Migrating Security Data
Edited by: Mircea Vutcovici on Jun 22, 2011 3:49 PM -
Import subprocess in jython script invoked with WLST
Weblogic 10.3.6
I'm trying to figure out if it's impossible for me to use subprocess.pipe and popen when Im invoking the script with WLST. It says there's no module of subprocess. Works fine running it as a python script.
Thanks!i tried with spaces also..and also added context also in the script..but still getting the same error
import os
scen_name="DVM"
scen_ver="001"
cont="E1APS"
odiscen="startcmd.bat OdiStartScen -SCEN_NAME="+scen_name+" -SCEN_VERSION="+scen_ver+" -CONTEXT="+cont
if os.system(odiscen) <> 0:
raise odiscen -
WLST script to create DBAdapter configuration
Has anybody tried to create a DBAdapter configuration using a WLST script.
Works fine if you create it manually using the console, but you are not able to record the steps using the record functionality (Script is empty).Hello,
hopefully you have already got answer to your question from some other source, but here's any way how I update DbAdapter configuration.
I generate deployment plan for DbAdapter in development time by admin console like you have done.
Copy the deployment plan to production environment, then use wlst or weblogic.Deployer to update adapter:
source <domain location>/bin/setDomainEnv.sh
java weblogic.Deployer -adminurl t3://<admin-url>:<admin server port> -user <admin user> -password <password> -update -name DbAdapter -plan <db plan location>/DBPlan.xml
This way I can do my production environment deployment script based, no need to use GUI.
It's also possible to use wlst instead of weblogic.Deployer, but haven't tried that yet.
Hope this was helpful.
regards, Matti -
Creating SessionMBean error while deploying OSB through WLSt script
Hi All,
I am trying to deploy my OSB by using WLST scripts.
After setting the required properties in files,I ran the import.py script.But I got an error while creating an session bean
I have pasted the whole stcak here.It is going fine till creating a session.After that it is failing:
Any pointers in this regard will be helpful.
****************************the stack************************88
Your environment has been set.
CLASSPATH=E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar;E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys
manifestclasspath\weblogic_patch.jar;E:\Oracle\Middleware\patch_ocp353\profile
s\default\sys_manifest_classpath\weblogic_patch.jar;E:\Oracle\Middleware\jrockit
_160_17_R28.0.0-679\lib\tools.jar;E:\Oracle\Middleware\wlserver_10.3\server\lib\
weblogic_sp.jar;E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar;E:\Or
acle\Middleware\modules\features\weblogic.server.modules_10.3.3.0.jar;E:\Oracle\
Middleware\wlserver_10.3\server\lib\webservices.jar;E:\Oracle\Middleware\modules
\org.apache.ant_1.7.1/lib/ant-all.jar;E:\Oracle\Middleware\modules\net.sf.antcon
trib_1.1.0.0_1-0b2/lib/ant-contrib.jar;;E:\Oracle\Middleware/Oracle_OSB1/lib/sb-
kernel-api.jar;E:\Oracle\Middleware/Oracle_OSB1/modules/com.bea.common.configfwk
_1.3.0.0.jar;E:\Oracle\Middleware/modules/com.bea.common.configfwk.wlinterop_10.
3.1.0
Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: ..\scripts\build.xml
Detected Java version: 1.6 in: E:\Oracle\Middleware\jrockit_160_17_R28.0.0-679\j
re
Detected OS: Windows XP
parsing buildfile C:\osb\build\scripts\build.xml with URI = file:/C:/osb/build/s
cripts/build.xml
Project base dir set to: C:\osb\build\scripts
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apach
e/tools/ant/antlib.xml. It could not be found.
[property] Loading Environment env.
[property] Loading C:\osb\build\dev\ant.properties
Build sequence for target(s) `import' is [import]
Complete build sequence is [import, ]
import:
[echo] importscript: c:/osb/build/scripts/import.py
[echo] importconfig: c:/osb/build/dev/import.properties
dropping E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_classp
ath\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_ocp353\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic_sp.jar from path
as it doesn't exist
dropping E:\Oracle\Middleware\modules\com.bea.common.configfwk.wlinterop_10.3.1.
0 from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_classp
ath\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_ocp353\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic_sp.jar from path
as it doesn't exist
dropping E:\Oracle\Middleware\modules\com.bea.common.configfwk.wlinterop_10.3.1.
0 from path as it doesn't exist
[wlst] <WLSTTask> Executing the command line :
[wlst] E:\Oracle\Middleware\jrockit_160_17_R28.0.0-679\jre\bin\java.exe -Dd
ebug=true -DfailOnError=true -DexecuteScriptBeforeFile=true -DpropertiesFile=c:/
osb/build/dev/import.properties -DfileName=c:/osb/build/scripts/import.py -class
path E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-launcher.jar;E:\O
racle\Middleware\jrockit_160_17_R28.0.0-679\lib\tools.jar;E:\Oracle\Middleware\w
lserver_10.3\server\lib\weblogic.jar;E:\Oracle\Middleware\modules\features\weblo
gic.server.modules_10.3.3.0.jar;E:\Oracle\Middleware\wlserver_10.3\server\lib\we
bservices.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-all.jar;
E:\Oracle\Middleware\modules\net.sf.antcontrib_1.1.0.0_1-0b2\lib\ant-contrib.jar
;E:\Oracle\Middleware\Oracle_OSB1\lib\sb-kernel-api.jar;E:\Oracle\Middleware\Ora
cle_OSB1\modules\com.bea.common.configfwk_1.3.0.0.jar;E:\Oracle\Middleware\modul
es\org.apache.ant_1.7.1\lib\ant-antlr.jar;E:\Oracle\Middleware\modules\org.apach
e.ant_1.7.1\lib\ant-apache-bcel.jar;E:\Oracle\Middleware\modules\org.apache.ant_
1.7.1\lib\ant-apache-bsf.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\l
ib\ant-apache-log4j.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\an
t-apache-oro.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-apach
e-regexp.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-apache-re
solver.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-commons-log
ging.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-commons-net.j
ar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-jai.jar;E:\Oracle\M
iddleware\modules\org.apache.ant_1.7.1\lib\ant-javamail.jar;E:\Oracle\Middleware
\modules\org.apache.ant_1.7.1\lib\ant-jdepend.jar;E:\Oracle\Middleware\modules\o
rg.apache.ant_1.7.1\lib\ant-jmf.jar;E:\Oracle\Middleware\modules\org.apache.ant_
1.7.1\lib\ant-jsch.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant
-junit.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-netrexx.jar
;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-nodeps.jar;E:\Oracle\
Middleware\modules\org.apache.ant_1.7.1\lib\ant-starteam.jar;E:\Oracle\Middlewar
e\modules\org.apache.ant_1.7.1\lib\ant-stylebook.jar;E:\Oracle\Middleware\module
s\org.apache.ant_1.7.1\lib\ant-swing.jar;E:\Oracle\Middleware\modules\org.apache
.ant_1.7.1\lib\ant-testutil.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.
1\lib\ant-trax.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-web
logic.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant.jar;E:\Oracl
e\Middleware\modules\org.apache.ant_1.7.1\lib\xercesImpl.jar;E:\Oracle\Middlewar
e\modules\org.apache.ant_1.7.1\lib\xml-apis.jar weblogic.management.scripting.WL
STInterpreterInvoker
dropping E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_classp
ath\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_ocp353\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic_sp.jar from path
as it doesn't exist
dropping E:\Oracle\Middleware\modules\com.bea.common.configfwk.wlinterop_10.3.1.
0 from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_classp
ath\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_ocp353\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic_sp.jar from path
as it doesn't exist
dropping E:\Oracle\Middleware\modules\com.bea.common.configfwk.wlinterop_10.3.1.
0 from path as it doesn't exist
[wlst] Executing 'E:\Oracle\Middleware\jrockit_160_17_R28.0.0-679\jre\bin\j
ava.exe' with arguments:
[wlst] '-Ddebug=true'
[wlst] '-DfailOnError=true'
[wlst] '-DexecuteScriptBeforeFile=true'
[wlst] '-DpropertiesFile=c:/osb/build/dev/import.properties'
[wlst] '-DfileName=c:/osb/build/scripts/import.py'
[wlst] '-classpath'
[wlst] 'E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-launcher.
jar;E:\Oracle\Middleware\jrockit_160_17_R28.0.0-679\lib\tools.jar;E:\Oracle\Midd
leware\wlserver_10.3\server\lib\weblogic.jar;E:\Oracle\Middleware\modules\featur
es\weblogic.server.modules_10.3.3.0.jar;E:\Oracle\Middleware\wlserver_10.3\serve
r\lib\webservices.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-
all.jar;E:\Oracle\Middleware\modules\net.sf.antcontrib_1.1.0.0_1-0b2\lib\ant-con
trib.jar;E:\Oracle\Middleware\Oracle_OSB1\lib\sb-kernel-api.jar;E:\Oracle\Middle
ware\Oracle_OSB1\modules\com.bea.common.configfwk_1.3.0.0.jar;E:\Oracle\Middlewa
re\modules\org.apache.ant_1.7.1\lib\ant-antlr.jar;E:\Oracle\Middleware\modules\o
rg.apache.ant_1.7.1\lib\ant-apache-bcel.jar;E:\Oracle\Middleware\modules\org.apa
che.ant_1.7.1\lib\ant-apache-bsf.jar;E:\Oracle\Middleware\modules\org.apache.ant
_1.7.1\lib\ant-apache-log4j.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.
1\lib\ant-apache-oro.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\a
nt-apache-regexp.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-a
pache-resolver.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-com
mons-logging.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-commo
ns-net.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-jai.jar;E:\
Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-javamail.jar;E:\Oracle\Mi
ddleware\modules\org.apache.ant_1.7.1\lib\ant-jdepend.jar;E:\Oracle\Middleware\m
odules\org.apache.ant_1.7.1\lib\ant-jmf.jar;E:\Oracle\Middleware\modules\org.apa
che.ant_1.7.1\lib\ant-jsch.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1
\lib\ant-junit.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-net
rexx.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-nodeps.jar;E:
\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant-starteam.jar;E:\Oracle\M
iddleware\modules\org.apache.ant_1.7.1\lib\ant-stylebook.jar;E:\Oracle\Middlewar
e\modules\org.apache.ant_1.7.1\lib\ant-swing.jar;E:\Oracle\Middleware\modules\or
g.apache.ant_1.7.1\lib\ant-testutil.jar;E:\Oracle\Middleware\modules\org.apache.
ant_1.7.1\lib\ant-trax.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib
\ant-weblogic.jar;E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\ant.jar;
E:\Oracle\Middleware\modules\org.apache.ant_1.7.1\lib\xercesImpl.jar;E:\Oracle\M
iddleware\modules\org.apache.ant_1.7.1\lib\xml-apis.jar'
[wlst] 'weblogic.management.scripting.WLSTInterpreterInvoker'
[wlst]
[wlst] The ' characters around the executable and arguments are
[wlst] not part of the command.
dropping E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_classp
ath\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_ocp353\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic_sp.jar from path
as it doesn't exist
dropping E:\Oracle\Middleware\modules\com.bea.common.configfwk.wlinterop_10.3.1.
0 from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_wls1033\profiles\default\sys_manifest_classp
ath\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_oepe1033\profiles\default\sys_manifest_class
path\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\patch_ocp353\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar from path as it doesn't exist
dropping E:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic_sp.jar from path
as it doesn't exist
dropping E:\Oracle\Middleware\modules\com.bea.common.configfwk.wlinterop_10.3.1.
0 from path as it doesn't exist
[wlst] Using input " "
[wlst] <WLSTTask> Loaded and set the properties from c:/osb/build/dev/impor
t.properties
[wlst] <WLSTTask> sys.argv is ['c:/osb/build/scripts/import.py']
[wlst] Connecting to server: t3://localhost:7001
[wlst] Connecting to t3://localhost:7001 with userid weblogic ...
[wlst] Successfully connected to Admin Server 'AdminServer' that belongs to
domain 'base_domain'.
[wlst]
[wlst] Warning: An insecure protocol was used to connect to the
[wlst] server. To ensure on-the-wire security, the SSL port or
[wlst] Admin port should be used instead.
[wlst]
[wlst] Location changed to domainRuntime tree. This is a read-only tree wit
h DomainMBean as the root.
[wlst] For more help, use help(domainRuntime)
[wlst]
[wlst] Starting import of: c:/osb/configuration/sbconfig.jar on ALSB Admin
Server: t3://localhost:7001
[wlst] Read import jar file
[wlst] Import file read successfully c:/osb/configuration/sbconfig.jar
[wlst] Creating unique session name
[wlst] Created session name : ALSBImportScript-1279101189649
[wlst] Creating SessionMBean
[wlst] Unexpected error: java.lang.RuntimeException
[wlst] Unexpected error: java.lang.RuntimeException
[wlst] No stack trace available.
[wlst] Traceback (innermost last):
[wlst] File "c:\osb\build\scripts\import.py", line 179, in ?
[wlst] File "c:\osb\build\scripts\import.py", line 47, in importToALSBDom
ain
[wlst] File "c:\osb\build\scripts\import.py", line 167, in getSessionMBea
n
[wlst] File "<iostream>", line 1162, in findService
[wlst] at weblogic.management.jmx.MBeanServerInvocationHandler.newProxy
Instance(MBeanServerInvocationHandler.java:621)
[wlst] at weblogic.management.jmx.MBeanServerInvocationHandler.invoke(M
BeanServerInvocationHandler.java:418)
[wlst] at $Proxy11.findService(Unknown Source)
[wlst] at weblogic.management.scripting.WLScriptContext.findService(WLS
criptContext.java:209)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[wlst] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[wlst] at java.lang.reflect.Method.invoke(Method.java:597)
[wlst]
[wlst] java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Cl
assNotFoundException: com.bea.wli.sb.management.configuration.DelegatedSessionMa
nagementMBean
[wlst]
[wlst] Exception in thread "Main Thread" java.lang.IllegalStateException: T
raceback (innermost last):
[wlst] File "c:\osb\build\scripts\import.py", line 179, in ?
[wlst] File "c:\osb\build\scripts\import.py", line 47, in importToALSBDom
ain
[wlst] File "c:\osb\build\scripts\import.py", line 167, in getSessionMBea
n
[wlst] File "<iostream>", line 1162, in findService
[wlst] at weblogic.management.jmx.MBeanServerInvocationHandler.newProxy
Instance(MBeanServerInvocationHandler.java:621)
[wlst] at weblogic.management.jmx.MBeanServerInvocationHandler.invoke(M
BeanServerInvocationHandler.java:418)
[wlst] at $Proxy11.findService(Unknown Source)
[wlst] at weblogic.management.scripting.WLScriptContext.findService(WLS
criptContext.java:209)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[wlst] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[wlst] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[wlst] at java.lang.reflect.Method.invoke(Method.java:597)
[wlst]
[wlst] java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Cl
assNotFoundException: com.bea.wli.sb.management.configuration.DelegatedSessionMa
nagementMBean
[wlst]
[wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printErr
or(WLSTInterpreterInvoker.java:110)
[wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executeP
yScript(WLSTInterpreterInvoker.java:103)
[wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLS
TInterpreterInvoker.java:27)
BUILD FAILED
C:\osb\build\scripts\build.xml:13: Java returned: 1
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at weblogic.ant.taskdefs.management.WLSTTask.execute(WLSTTask.java:115)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1307)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1191)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Total time: 16 seconds
C:\osb\build\dev>^AHi,
I tried debugging it and i am still getting the same error. I used the script provided byoracle and the script which is given here.
Below is the error i am getting :
[java] ImportError: cannot import name SessionManagementMBean
I am getting an error at
def getSessionManagementMBean(sessionName):
SessionMBean = findService("SessionManagement", "com.bea.wli.sb.management.configuration.SessionManagementMBean")
SessionMBean.createSession(sessionName)
return SessionMBean
Its able to create a unique session , after that for creating session name its throwing error.
C:\Development\Build\scripts\build.xml:31: Java returned: 1
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at weblogic.ant.taskdefs.management.WLSTTask.execute(WLSTTask.java:115)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Any help on this?? -
List Business Services Endpoints with WLST
Hi,
We're using OSB 11.1.1.3 and 11.1.1.6 in several environments.
We just need to use wlst scripting to keep track of all business services and their endpoint uri's automatically.
We tried using some old scripts but found out that they don't work on 11g installations:
We tried the following code:
connect('weblogic','oracle10','t3://soavm2:7001')
domainRuntime()
sessionName = "FindServicesSession" + str(System.currentTimeMillis())
sessionMBean = findService(SessionManagementMBean.NAME, SessionManagementMBean.TYPE)
sessionMBean.createSession(sessionName)
servConfMBean = findService(ServiceConfigurationMBean.NAME + "." + sessionName, ServiceConfigurationMBean.TYPE)
alsbCore = findService(ALSBConfigurationMBean.NAME, ALSBConfigurationMBean.TYPE)
allRefs=alsbCore.getRefs(Ref.DOMAIN)
for ref in allRefs:
typeId = ref.getTypeId()
if typeId == "BusinessService":
serviceDefinition = servConfMBean.getServiceDefinition(ref)
endpointConfigration = serviceDefinition.getEndpointConfig()
print endpointConfigration
We get a "AttributeError: 'NoneType' object has no attribute 'getServiceDefinition'" error. It seems that it is related to metalink note "How To Modify Service Configurations By OSB JMX API [ID 1431254.1]". However the code provided there is for java through jmx, does anybody has a working example of how to do that on wlst?
Thanks!Hi Marc,
What i found is that we can get list of business services URIs by consulting SERVICE_URI_TABLE...
Here's a script that reads a parameter file (which can have multiple domains information) with connection info and then gets all services and prints a list of the service name and URI on a file for each domain...
# params.txt format:
# user,passwd,admin-url
# Ej:
# weblogic,weblogic1,t3://adminsoa:7001
# weblogic,weblogic100,t3//adminsoa2:7001
import wlstModule
from com.bea.wli.sb.management.configuration import SessionManagementMBean
from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
from com.bea.wli.sb.management.configuration import BusinessServiceConfigurationMBean
from com.bea.wli.sb.util import EnvValueTypes
from com.bea.wli.config import Ref
from com.bea.wli.sb.util import Refs
from xml.dom.minidom import parseString
f1 = open('/tmp/params.txt','r')
for line in f1:
spline=line.split(',')
usr=spline[0]
pwd=spline[1]
url=spline[2].replace("\n","")
try:
connect(usr,pwd,url)
domName=cmo.getName()
domainRuntime()
sessionMBean = findService(SessionManagementMBean.NAME,SessionManagementMBean.TYPE)
sessionName="WLSTSession"+ str(System.currentTimeMillis())
sessionMBean.createSession(sessionName)
alsbSession = findService(ALSBConfigurationMBean.NAME + "." + sessionName, ALSBConfigurationMBean.TYPE)
alsbCore = findService(ALSBConfigurationMBean.NAME, ALSBConfigurationMBean.TYPE)
allRefs=alsbCore.getRefs(Ref.DOMAIN)
fileName='/tmp/'+domName+'_'+url.replace('t3://','').replace(':','')+'_BServicesLista.csv'
f2 = open(fileName, 'w')
f2.write('Name'+','+'URL'+'\n')
for ref in allRefs:
typeId = ref.getTypeId()
if typeId == "BusinessService":
name=ref.getFullName()
uris=alsbSession.getEnvValue(ref, EnvValueTypes.SERVICE_URI_TABLE, None)
xml=parseString(uris.toString())
xmlTag = xml.getElementsByTagName('tran:URI')[0].toxml()
xmlData=xmlTag.replace('<tran:URI>','').replace('</tran:URI>','')
f2.write('\"'+name+'\"'+','+'\"'+xmlData+'\"'+'\n')
f2.close()
except Exception,e:
print "Error trying to connect to " + url + 'Error: ' + str(e)
f1.close()
disconnect()
It's been working for us so far... -
Why do we use WLST Scripting when things can be done manually??
Hi experts ,
It may be a stupid question ,
why do we use WLST scripting for things like deleting Queue _ _ etc , which can be done manually (through console)Please help i am newbie in this technologyIn addition to the practical reasons which Barosa supplied, it is also a best practice for addtional reasons:
<ul><li>removing human errors from typos, omissions, etc
</li>
<li>making certains tasks (domain creation, configuration, application deployments, etc) repeatable, especially ones with many steps
</li>
<li>tasks that are repeatable, once tested, have a high degree of confidence that they will be done exactly the same way next time with a script
</li>
</ul>
There are many more, but hopefully this gives you an idea of the benefits. -
Does and how osb 11g support WLST scripts
Does 11g support WLST scripts to import and export OSB configuration?
Here are the old ones (as I see, dated 03.03.2009). For old 10.3 they worked perfectly.
http://www.oracle.com/technology/products/soa/service-bus/collateral/osbsamples.html
In new release names of few libraries changed (e.g. from com.bea.common.configfwk_1.2.1.0.jar to com.bea.common.configfwk_1.3.0.0.jar), so I simply changed the names in my scripts to use them for 11g. It didn't work. Old scripts (with old libs) don't work for 11g either.
So my question is does OSB still support this kind of deploying, and how can I do that?
Thanks in advance.@ frf
Is it working for you ? The scripts are running fine for me but the values are not geting changed.
This is my custom xml which is created
<?xml version="1.0" encoding="UTF-8"?>
<cus:Customizations xmlns:cus="http://www.bea.com/wli/config/customizations" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xt="http://www.bea.com/wli/config/xmltypes">
<cus:customization xsi:type="cus:FindAndReplaceCustomizationType">
<cus:description>Update to the correct server and port number</cus:description>
<cus:query>
<xt:refsToSearch xsi:type="xt:LocationRefType">
<xt:type>Project</xt:type>
<xt:path>Test OSB Project</xt:path>
</xt:refsToSearch>
<xt:includeOnlyModifiedResources>false</xt:includeOnlyModifiedResources>
<xt:searchString>http://localhost:7001/business/ValidateCoverage/ValidateCoverageService</xt:searchString>
<xt:isCompleteMatch>false</xt:isCompleteMatch>
</cus:query>
<cus:replacement>http://192.20.51.150:7001/business/ValidateCoverage/ValidateCoverageService</cus:replacement>
</cus:customization>
</cus:Customizations>
But import.py is simply not replacing the values in the WSDL -
Updating an ALSB configuration using WLST
I've been using the AquaLogic Service Bus Deployment API (http://e-docs.bea.com/alsb/docs21/deploy/config_appx.html) to export and import an ALSB configuration from my development environment to the test environment. When the system is going to production I want the WLST-scripts to be a part of the installation scripts.
It looks like the import features of ALSB is designed to append and overwrite the imported configuration. Configuration elements that does not exist in the imported configuration will not be deleted from the target configuration. This will, over time, cause the production environment to end up as an enormous garbage can if nobody goes in and cleans it from time to time.
We have as requirements that all installation must be done automatically (untouched by humans), so my question is:
<li>How can I ensure consistency between the configuration I deliver and the production environment?
</li>
The most obvious place to look for such an opportunity should be in the import utility. But, as far as I can see, there is no <i>replace configuration</i> option available for the DeploymentMBean.
BEA develops MBeans for the most of the service components. So it should also exist MBeans that can be used to programmatically configure ALSB without using the DeploymentMBean. So, my second question is:
<li>Does anyone know of an ALSB MBean that is capable to remove a project from the configuration?</li>Hi Helge,
There is indeed an mbean to delete projects, however this mbean and its api is not publicly supported. In other words the api may change or be removed (in favor of another one) in the next release. There are plans to expose a slight variation of this api in the next release. If you cannot wait until then you can use the non-public api with the caveat that it may change, and use it at your own risk. You may need to recompile or rewrite your source code.
The non-public api is:
ALSBConfigMBean.deleteProject(String projectName)
obtaining and using ALSBConfigMBean is similar to the usage of the public ALSBConfigurationMBean. You can obtain the name and the type of this mbean using ALSBConfigMBean.NAME|TYPE.
Maybe you are looking for
-
Help, my email was hacked, now I can't get in at all. Can I reset the password through an alternate email?
-
I can't remember my passwords for macbook pro
just recieved a mac pro from my brother in law, ialso have a macbookpro, having a hard time trying to get the mac pro to see the macbook. seems ther are pass word problems. i dont rember putting a pass word on the macbook at all.
-
ITunes Upgrade: Missing Songs
I catch podcasts with Juice which drops them in to iTunes and changes their Genre to Podcast. I have a smart playlist for my podcasts and grabs all unrated songs with a genre of podcast. Once I listen to an episode if I tag it with one star my smart
-
Safari 3.0.3- refresh acting funny
In previous incarnations of Safari, when I refreshed a page, I'd go back to the point on the page I was last looking at when I refreshed, in the beta however I always end up at the top of the page. Is this a common thing? Or an intentional thing? It
-
Initially I had 3 schemas such as S1 as Source, S2 as Stage & "S3" as Target. I had created interface in which S1 was the source and S2 was used as target schema. The interface was using LKM SQL to Oracle and IKM Oracle Incremental Update as knowledg