ALSB 3.0 & WLST
Hi,
I'm trying to move my WLST scripts from ALSB 2.6 to 3.0
(environment Solaris 10).
When I try to run WLST from ant I got the below error:
[java] Initializing WebLogic Scripting Tool (WLST) ...
[java] Welcome to WebLogic Server Administration Scripting Shell
[java] Type help() for help on available commands
[java] Problem invoking WLST - Traceback (innermost last):
[java] File "/products/software/terraferma/release3/EventBus/scripts/admin.py", line 2, in ?
[java] ImportError: No module named wli
I've set up my environment running:
. /software/bea100/weblogic/server/bin/setWLSEnv.sh
My admin.py at line 2 contains an import statement:
from com.bea.wli.config.mbeans import SessionMBean
Maybe the classpath is set wrongly, but running simply setWLSEnv.sh in 2.6 didn't raise any error.
The classpath and path are:
CLASSPATH=/software/bea100/patch_wss110/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/software/bea100/patch_wlw1020/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/software/bea100/patch_wls1001/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/software/bea100/patch_cie640/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/software/bea100/patch_alsb300/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/software/bea100/jdk150_11/lib/tools.jar:/software/bea100/weblogic/server/lib/weblogic_sp.jar:/software/bea100/weblogic/server/lib/weblogic.jar:/software/bea100/modules/features/weblogic.server.modules_10.0.1.0.jar:/software/bea100/modules/features/com.bea.cie.common-plugin.launch_2.1.2.0.jar:/software/bea100/weblogic/server/lib/webservices.jar:/software/bea100/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/software/bea100/modules/net.sf.antcontrib_1.0b2.0/lib/ant-contrib.jar:
PATH=/software/bea100/weblogic/server/bin:/software/bea100/modules/org.apache.ant_1.6.5/bin:/software/bea100/jdk150_11/jre/bin:/software/bea100/jdk150_11/bin:.:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sfw/sbin:/usr/sfw/bin
Thanks in advance
Regards
ferp
I opened a support case, and got the following response...
You are using the old code which you might used for 2.1 version of ALSB. This was depricated from 2.5 onwards and instead of "DeploymentMBean" you need to use SessionManageentMBean and the ALSBConfigurationMBean. This was already documented in our edocs "http://edocs.bea.com/alsb/docs25/deploy/config_appx.html". All the classes which you are refernced are already depricated and are removed in this version.
Please refer the following upgrade guide to upgrade your WLST using the new Deployment API's. (http://e-docs.bea.com/alsb/docs30/pdf/upgrade.pdf)
You can get a sample of how to import / Export from the below link (http://edocs.bea.com/alsb/docs30/javadoc/com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html)
Similar Messages
-
Hi all,
the following lines export a ALSB prj using WLST:
if ALSBConfigurationMBean.exists(projectRef):
bytes = ALSBConfigurationMBean.exportProjects(Collections.singleton(projectRef), None)
file = open(fileName, 'wb')
file.write(String(bytes))
file.close()
The target file is created but if I verify the created file I got an error:
jar tvf /products/.../DummyEvent/DummyEvent-sbconfig.jar
java.util.zip.ZipException: too many length or distance symbols
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:140)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:139)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
at sun.tools.jar.Main.list(Main.java:743)
at sun.tools.jar.Main.run(Main.java:191)
at sun.tools.jar.Main.main(Main.java:903)
Should I change the file.write(String(bytes)) statement?
Thanks
ferpproblem solved:
file = open(fileName, 'wb')
for entry in bytes:
file.write(struct.pack('b', entry))
file.close()
jar tvf /products/.../DummyEvent-sbconfig.jar
23728 Mon Oct 01 15:49:26 CEST 2007 ExportInfo
264 Mon Oct 01 15:49:26 CEST 2007 EventBus-DummyEvent/providers/Provider2/_folderdata.LocationData
11553 Mon Oct 01 15:49:26 CEST 2007 EventBus-DummyEvent/providers/Provider2/DummyEvent-Provider2-SingleXMLFileProvid.ProxyService
686 Mon Oct 01 15:49:26 CEST 2007 EventBus-DummyEvent/consumers/Consumer1/resource/DummyEvent-Consumer1-ConsumerEventTransf.Xquery
254 Mon Oct 01 15:49:26 CEST 2007 EventBus-DummyEvent/providers/_folderdata.LocationData
273 Mon Oct 01 15:49:26 CEST 2007 EventBus-DummyEvent/consumers/Consumer1/resource/_folderdata.LocationData
Regards
ferp -
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. -
Hello everyone,
Trying to purge ALSB alerts using the WLST script extract found on the [Oracle website|http://blogs.oracle.com/MarkSmith/2008/11/osb_alerts_purging_is_essentia.html] yields the following exception, specifically when attempting to
access the com.bea.wli.monitoring.alert MBean using
alsbAlerts = cmo.getWLDFRuntime().getWLDFAccessRuntime().lookupWLDFDataAccessRuntime('CUSTOM/com.bea.wli.monitoring.alert')
The resulting strack trace looks like this:
Traceback (innermost last):
File "<console>", line 1, in ?
weblogic.management.ManagementException:
at weblogic.diagnostics.accessor.DiagnosticAccessRuntime.lookupWLDFDataAccessRuntime(DiagnosticAccessRuntime.java:150)
at weblogic.diagnostics.accessor.DiagnosticAccessRuntime.lookupWLDFDataAccessRuntime(DiagnosticAccessRuntime.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at weblogic.management.jmx.modelmbean.WLSModelMBean.invoke(WLSModelMBean.java:443)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.invoke(WLSMBeanServerInterceptorBase.java:153)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.invoke(WLSMBeanServerInterceptorBase.java:153)
at weblogic.management.mbeanservers.internal.SecurityInterceptor.invoke(SecurityInterceptor.java:443)
at weblogic.management.mbeanservers.internal.AuthenticatedSubjectInterceptor$10.run(AuthenticatedSubjectInterceptor.java:377)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.management.mbeanservers.internal.AuthenticatedSubjectInterceptor.invoke(AuthenticatedSubjectInterceptor.java:375)
at weblogic.management.jmx.mbeanserver.WLSMBeanServer.invoke(WLSMBeanServer.java:310)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1408)
at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1245)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1348)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:782)
at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Caused by: weblogic.management.ManagementException: [Diagnostics:320103]There was an error creating the DiagnosticDataRuntimeMBean instance with the given logical name CUSTOM/com.bea.wli.monitoring.alert.
at weblogic.diagnostics.accessor.DiagnosticDataAccessRuntime.createDiagnosticDataAccessRuntime(DiagnosticDataAccessRuntime.java:114)
at weblogic.diagnostics.accessor.DiagnosticAccessRuntime$1.run(DiagnosticAccessRuntime.java:145)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.diagnostics.accessor.DiagnosticAccessRuntime.lookupWLDFDataAccessRuntime(DiagnosticAccessRuntime.java:141)
... 32 more
weblogic.management.ManagementException: weblogic.management.ManagementException:
This is using WebLogic Server 10.0 and ALSB 3.0
Any ideas what's going on?
Cheers,
JanAfter reading your mail, I assume that you are using JMS reporting provider bundled with OSB. Please be advised that, the bundled version is not full-pledged reporting provider designed to suit all customer needs/use case. More of a bare bones version.
http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/operations/wwimages/reporting_framework.gif--- Will give you better clarity on the architecture. ReportingDataManager is not designed to hold statistics. So OSB will cannot expose any JMX API.
The data/statistics showed in sbconsole are directly picked from Database http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/operations/wwimages/jms_reporting_provider.gif .
So if you wan to purge the details programatically then only option avaialble are
1) JDBC program to delete records from TABLES WLI_QS_REPORT_ATTRIBUTE,WLI_QS_REPORT_DATA (not recommended as reporting provider internal working is not in pubic domain. Said that it would not take much time to understand how report data is stored in the above tables).
2) Write a custom reporting provider which will have capability you are looking. http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/javadoc/index.html (easiest way)
Let me know if you need any clarification on the above.
Thanks
Manoj
Edited by: mneelapu on Apr 24, 2009 2:27 PM -
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 -
How to import into ALSB a resource using WLST
Hi all,
I've an ALSB project that contains my templates (proxy, business services, xsd, etc) and I use a WLST script for creating a new project, reading additional info from a xml file, cloning ALSB stuff from my templates.
The cloning process is working very well and now I'm trying to import xq, xsd, etc in order to replace the old with the new ones.
As starting example I've already download the code sample created by Gregory Haardt.
During the import phase I got an error:
[java] #### [EventBus-DummyEvent] cloning the TransformIntoConsumerEvent proxy template
[java] template : EventBusCore/template/[ConsumerEvent]-[ConsumerName]-TransformIntoConsumerEvent
[java] template cloned into : EventBus-DummyEvent/consumers/Consumer1/resource/DummyEvent-Consumer1-TransformIntoConsumerEvent
[java] #### read resource Zip file: /products/software/terraferma/release3/EventBus/repository/events/DummyEvent/DummyEvent-resources.zip
[java] New XQuery Ref Xquery EventBus-DummyEvent/DummyEvent-IPEventConfig
[java] #### loaded resources in project: EventBus-DummyEvent
[java] Diagnostics for Policy EventBus-DummyEvent/DummyEvent-IPEventConfig
[java] ERROR: <0> invalid ws-policy: policy must have a 'wsu:Id' attribute.
[java] ================================================
[java] #### ERROR - creation error: IPEvent project <EventBus-DummyEvent>, one or more files could not be imported properly
[java] ================================================
[java] No stack trace available.
[java] Unexpected error: defClass.CreationFailure
[java] No stack trace available.
[java] Problem invoking WLST - Traceback (innermost last):
[java] File "/products/software/terraferma/release3/EventBus/scripts/cloning.py", line 662, in ?
[java] File "/products/software/terraferma/release3/EventBus/scripts/cloning.py", line 131, in cloning
[java] File "/products/software/terraferma/release3/EventBus/scripts/cloning.py", line 621, in loadResources
[java] CreationFailure: 'IPEvent project <EventBus-DummyEvent>, one or more files could not be imported properly'
The zip contains the new xquery:
jar tvf .../DummyEvent-resources.zip
7575 Fri Sep 21 14:22:20 CEST 2007 DummyEvent-IPEventConfig.xml
and the script is:
# create the new XQuery ref
queryName = IPEventProjectName + '/' + IPEventType + '-IPEventConfig'
newXQueryName = queryName.split("/")
newXQueryRef = Ref(TypeIds.XQUERY_REF, newXQueryName)
print "New XQuery Ref", newXQueryRef
bytes = readBinaryFile(resourceZip)
result = ALSBConfigurationMBean.importZip(projectRef, bytes, None)
print "#### loaded resources in project:", IPEventProjectName
# check for errors
diags = result.getFailed()
if diags != None and diags.isEmpty() == false:
printDiagMap(diags)
failed = 'IPEvent project <' + IPEventProjectName + '>, one or more files could not be imported properly'
raise CreationFailure(failed)
Do I need to create a Ref object for any resource to be imported? What is the meaning of 'invalid ws-policy'?
Thanks
ferpsolved ...
I changed the file extension of the xquery inside the zip file from .xml to .xquery:
jar tvf /.../DummyEvent-resources.zip
0 Fri Sep 28 14:07:36 CEST 2007 resource/
548 Fri Sep 28 14:09:44 CEST 2007 resource/DummyEvent-IPEvent.xsd
7575 Fri Sep 21 14:22:20 CEST 2007 resource/DummyEvent-IPEventConfig.xquery
I've also noted that if I organize the artifacts inside the zip within folders that structure is preserved in ALSB:
[java] #### loaded resources in project: EventBus-DummyEvent
[java] #### ... XMLSchema EventBus-DummyEvent/resource/DummyEvent-IPEvent
[java] #### ... Xquery EventBus-DummyEvent/resource/DummyEvent-IPEventConfig
Best
ferp -
Help creating project specific ALSB Customization file using WLST
I asked this question in August in another forum and was redirected here, but never followed up. I'm hopeful someone has done this...
Is it possible to create an ALSB CUstomization file for a single project using WLST?
If so, does anyone have an example they would be wiling to share. I've been beating my head against the wall for almost 2 days (well, months now...) , and I'm REALLy starting to get a headache from it now....
We're running WLS 9.2 MP2 and ALSB 2.6 RP1
Any help is greatly appreciated,
BrianBrian, OSB specific questions are best directed in the SOA Suite forum:
SOA Suite
It looks like there is an ALSBConfigurationMBean with a customize method, but I have not worked with it and it does not sound like that will give you precisely what you want:
http://edocs.bea.com/alsb/docs261/javadoc/com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#customize(java.util.List) -
Hi there,
I'm new in BEA's technologies world and i'm looking for a way to configure mi AquaLogic Service Bus domain's services without using the SB Console.
I'm reading about the WLST (WebLogic Scripting Tool) and there's so much information that I can't get what I want.
I realize some tests but I didn't succeed.
Is there a way to edit my proxy and business services (also routing, transformation, validations, etc) of ALSB without using the SB Console? Can I do it with WLST?
Does anybody have any example code for doing this? Or can tell me how can i do it?
Thanks a lot!
Ariel (from Argentina)Hi Ariel,
You can use WLST to clone and modify existing services in ALSB. To my understanding it's not possible to actually create new services using WLST. The following link has an example that's a good starting point for using WLST on ALSB(2.6), the script needs some minor modifications to run on 3.0:
https://codesamples.projects.dev2dev.bea.com/servlets/tracking/remcurreport/true/template/ViewIssue.vm/id/S320/nbrresults/40
If your only restriction is not using the (web)console you can also try using Workspace, the link below is to a blog to get started with that:
http://blogs.oracle.com/christomkins/2008/04/oracle_service_bus_v30_getting.html
Hope that's of any help to you.
-cheers
-jeroen(from Canada) -
How to update references into ALSB using WLST
Hi all,
the import phase is ok and now I'm trying to update references of imported resources.
- for Refs.BUSINESS_SERVICE_TYPE no problem: I'm able to update a business service reference within a cloned proxy referencing the imported business service
- for Refs.XMLSCHEMA_TYPE the same is harder ... I can update the schema reference within a cloned proxy with the imported schema but if the element of the imported schema is different I got an error:
I've a cloned proxy P that references
Validate ... against [ dummyProviderEvent-Provider1 ] ( Element = "dummyProviderEvent" )
References to be updated:
- from dummyProviderEvent-Provider1 to TestProviderEvent-Provider1
- from Element = "dummyProviderEvent" to a new one
Error:
[java] [Critical] Resources with validation errors
[java] 1 - ProxyService EventBus-DummyEvent/providers/Provider2/DummyEvent-Provider2-SingleXMLFileProvider CannotCommit
[java] + CannotCommit [ProviderEvent-ProviderName-SingleXMLFileProviderPipeline, Request Pipeline, Prepare, Validate action] Type {http://provider1}dummyProviderEvent does not exist /xml-fragment/router
I would like to avoid to:
i) export the proxy
ii) manipulate the exported xml changing directly the reference (if tomorrow xml changes in a new version of ALSB ...)
iii) import the proxy
Is it possible to do it using ALSBConfigurationMBean.mapReferences instead of export/import choice?
Another question. Is it possible to change also pipeline/stage names or enabling/disabling proxy/bus services via WLST ?
Thanks
ferpHi,
Updating the Business grpahics(BG) depends upon how your populating the context associated with BG.
For my knowledge there is no way we can show graphical chart directly from an URL.
So read the data from the URL and store it a file or database and then populate the context associated with BG.
Before populating just invalidate the context so that it will load the context again with out any duplicate data.
Regards, Anilkumar -
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') -
WLST & ALSB AttributeError: 'None' object has no attribute 'exportProjects'
I have the following WLST script that exports an ALSB 2.6 project and a Customization file for that project. The script was downloaded from the BEA website sometime ago, and I had it working fine. A recent change broke it, and I'm not sure why. I'm hoping someone can help me out here...
The script is below:
<blockquote>
<p>
from java.io import FileInputStream
from java.io import FileOutputStream
from java.util import ArrayList
from java.util import Collections
</p>
<p>
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 FindAndReplaceCustomization
</p>
<p>
import sys
</p>
<p>
#=======================================================================================
# Utility function to load properties from a config file
#=======================================================================================
def exportAll(exportConfigFile):
try:
print "Loading export config from :", exportConfigFile
exportConfigProp = loadProps(exportConfigFile)
adminUrl = exportConfigProp.get("adminUrl")
exportUser = exportConfigProp.get("exportUser")
exportPasswd = exportConfigProp.get("exportPassword")
</p>
<p>
exportJar = exportConfigProp.get("exportJar")
customFile = exportConfigProp.get("customizationFile")
</p>
<p>
passphrase = exportConfigProp.get("passphrase")
project = exportConfigProp.get("project")
</p>
<p>
<strong># connectToServer(exportUser, exportPasswd, adminUrl)
connect(userConfigFile='connect.properties', userKeyFile='key.properties', url='t3://patten:30001')
</strong> ALSBConfigurationMBean = findService("ALSBConfiguration", "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
print "ALSBConfiguration MBean found"
</p>
<p>
print project
if project == None :
ref = Ref.DOMAIN
collection = Collections.singleton(ref)
if passphrase == None :
print "Export the config"
theBytes = ALSBConfigurationMBean.export(collection, true, None)
else :
print "Export and encrypt the config"
theBytes = ALSBConfigurationMBean.export(collection, true, passphrase)
else :
ref = Ref.makeProjectRef(project);
print "Export the project", project
collection = Collections.singleton(ref)
print "MADE IT HERE", project
<strong> theBytes = ALSBConfigurationMBean.exportProjects(collection, passphrase)
</strong> print "MADE IT HERE 2", project
</p>
<p>
aFile = File(exportJar)
out = FileOutputStream(aFile)
out.write(theBytes)
out.close()
print "ALSB Configuration JAR file: "+ exportJar + " has been exported"
</p>
<p>
if customFile != None:
print collection
customList = ArrayList()
query = EnvValueQuery(None, Collections.singleton(EnvValueTypes.WORK_MANAGER), collection, false, None, false)
customEnv = FindAndReplaceCustomization('Set the right Work Manager', query, 'Production System Work Manager')
customList.add(customEnv)
query = EnvValueQuery(None, Collections.singleton(EnvValueTypes.SERVICE_URI), collection, false, 'winthrop.namerica.idexxi.com:50002', false)
customEnv = FindAndReplaceCustomization('Update To the Correct Server and Port Number', query, 'wesley.namerica.idexxi.com:50005')
print 'EnvValueCustomization created'
customList.add(customEnv)
print customList
aFile = File(customFile)
out = FileOutputStream(aFile)
Customization.toXML(customList, out)
out.close()
</p>
<p>
print "ALSB Dummy Customization file: "+ customFile + " has been exported"
except:
raise
dumpStack()
#=======================================================================================
# Utility function to load properties from a config file
#=======================================================================================
</p>
<p>
def loadProps(configPropFile):
propInputStream = FileInputStream(configPropFile)
configProps = Properties()
configProps.load(propInputStream)
return configProps
</p>
<p>
#=======================================================================================
# Connect to the Admin Server
#=======================================================================================
</p>
<p>
def connectToServer(username, password, url):
connect(username, password, url)
domainRuntime()
</p>
<p>
# EXPORT script init
try:
exportAll(sys.argv[1])
</p>
except:
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise
When I connect to the admin server using the "connectToServer" command (commented out in the code above) the script works fine. When I tried to use the "connect" command, using a connect.properties file instead of a plain text userid and password, the line:
<strong>theBytes = ALSBConfigurationMBean.exportProjects(collection, passphrase)
</strong>fails and I get an error that says: <strong>AttributeError: 'None' object has no attribute 'exportProjects'
</strong>Can someone explain to me the difference between these two commands, and if there is anything I can do to tweak this code to get it working using 'connect' vs. 'connectToServer' syntax?
</blockquote>I'm getting the following error while doing an export from alsb2.1 env. using wlst invoked via ant:
C:\Users\vxvm\import_export_test_ALSB21\import-export>ant export
Buildfile: build.xml
export:
[echo] exportscript: export.py
[java]
[java] Initializing WebLogic Scripting Tool (WLST) ...
[java]
[java] Welcome to WebLogic Server Administration Scripting Shell
[java]
[java] Type help() for help on available commands
[java]
[java] Loading export config from : export.properties
[java] Connecting to t3://localhost:7003 with userid weblogic ...
[java] Successfully connected to Admin Server 'AdminServer' that belongs to
domain 'alsb21_domain'.
[java]
[java] Warning: An insecure protocol was used to connect to the
[java] server. To ensure on-the-wire security, the SSL port or
[java] Admin port should be used instead.
[java]
[java] Location changed to domainRuntime tree. This is a read-only tree wit
h DomainMBean as the root.
[java] For more help, use help(domainRuntime)
[java]
[java]
[java] ALSBConfiguration MBean found
[java] None
[java] Export the config
[java] Unexpected error: exceptions.AttributeError
[java] No stack trace available.
[java] Problem invoking WLST - Traceback (innermost last):
[java] File "C:\Users\vxvm\import_export_test_ALSB21\import-export\export
.py", line 96, in ?
[java] File "C:\Users\vxvm\import_export_test_ALSB21\import-export\export
.py", line 42, in exportAll
[java] AttributeError: 'NoneType' object has no attribute 'export'
[java]
[java] Java Result: 1
BUILD SUCCESSFUL
Here is my export.py:
from java.io import FileInputStream
from java.io import FileOutputStream
from java.util import ArrayList
from java.util import Collections
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 FindAndReplaceCustomization
import sys
#=======================================================================================
# Utility function to load properties from a config file
#=======================================================================================
def exportAll(exportConfigFile):
try:
print "Loading export config from :", exportConfigFile
exportConfigProp = loadProps(exportConfigFile)
adminUrl = exportConfigProp.get("adminUrl")
exportUser = exportConfigProp.get("exportUser")
exportPasswd = exportConfigProp.get("exportPassword")
exportJar = exportConfigProp.get("exportJar")
customFile = exportConfigProp.get("customizationFile")
passphrase = exportConfigProp.get("passphrase")
project = exportConfigProp.get("project")
connectToServer(exportUser, exportPasswd, adminUrl)
ALSBConfigurationMBean = findService("ALSBConfiguration", "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
print "ALSBConfiguration MBean found"
print project
if project == None :
ref = Ref.DOMAIN
collection = Collections.singleton(ref)
if passphrase == None :
print "Export the config"
theBytes = ALSBConfigurationMBean.export(collection, true, None)
else :
print "Export and encrypt the config"
theBytes = ALSBConfigurationMBean.export(collection, true, passphrase)
else :
ref = Ref.makeProjectRef(project);
print "Export the project", project
collection = Collections.singleton(ref)
theBytes = ALSBConfigurationMBean.exportProjects(collection, passphrase)
aFile = File(exportJar)
out = FileOutputStream(aFile)
out.write(theBytes)
out.close()
print "ALSB Configuration file: "+ exportJar + " has been exported"
if customFile != None:
print collection
query = EnvValueQuery(None, Collections.singleton(EnvValueTypes.WORK_MANAGER), collection, false, None, false)
customEnv = FindAndReplaceCustomization('Set the right Work Manager', query, 'Production System Work Manager')
print 'EnvValueCustomization created'
customList = ArrayList()
customList.add(customEnv)
print customList
aFile = File(customFile)
out = FileOutputStream(aFile)
Customization.toXML(customList, out)
out.close()
print "ALSB Dummy Customization file: "+ customFile + " has been created"
except:
raise
#=======================================================================================
# Utility function to load properties from a config file
#=======================================================================================
def loadProps(configPropFile):
propInputStream = FileInputStream(configPropFile)
configProps = Properties()
configProps.load(propInputStream)
return configProps
#=======================================================================================
# Connect to the Admin Server
#=======================================================================================
def connectToServer(username, password, url):
connect(username, password, url)
domainRuntime()
# EXPORT script init
try:
exportAll(sys.argv[1])
except:
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise
and export.properties:
# OSB Admin Security Configuration #
adminUrl=t3://localhost:7003
exportUser=weblogic
exportPassword=welcome3
#exportConfigFile=true
# OSB Jar to be exported #
exportJar=sbconfig.jar
includeDependencies=true
# Optional passphrase and project name #
#passphrase=123
# Optional, create a dummy customization file #
#customizationFile=devcustomize.xml
Can someone help me out in resolving the above issue,Thanks! -
ALSB Newbie: WLST script for SLA Alerts
Hi,
I am new to ALSB 2.6. Can anybody give me an idea how to write a WLST script to automate creation of SLA Alerts for all the proxy services(60) and business services(60).
Thanks,
SunnyHi,
I am new to ALSB 2.6. Can anybody give me an idea how to write a WLST script to automate creation of SLA Alerts for all the proxy services(60) and business services(60).
Thanks,
Sunny -
Create a ALSB 3.0 domain using WLST
Hi,
I have created a ALSB domain using config.sh and then I used the following script to create the template
# create doman template
readDomain('/usr/local/bea/user_projects/domains/z2esbadmin')
writeTemplate('/home/was/work/wlst/z2esbadminTemplate.jar')
exit()
The template jar file is created successfully without any warning/error
When I tried to create the domain using the template with the following comand:
createDomain('z2esbadminTemplate.jar','/home/was/work/user_projects/domains/z2esb', 'weblogic', 'weblogic')
exit()
I got the following error message:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Error: create() failed. Do dumpStack() to see details.
Problem invoking WLST - Traceback (innermost last):
File "/home/mcas/weblogic/wlst/createEsbDomain.py", line 1, in ?
File "/tmp/WLSTOfflineIni25221.py", line 96, in createDomain
com.bea.plateng.domain.script.jython.WLSTException: com.bea.plateng.domain.script.ScriptException: com.bea.plateng.domain.ValidateException: Property "User name" of User with original name "" is invalid. The property value is duplicated.
at com.bea.plateng.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:51)
at com.bea.plateng.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1468)
at com.bea.plateng.domain.script.jython.WLScriptContext.create(WLScriptContext.java:672)
at com.bea.plateng.domain.script.jython.WLScriptContext.createDomain(WLScriptContext.java:507)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:160)
at org.python.core.PyMethod.__call__(PyMethod.java:96)
at org.python.core.PyObject.__call__(PyObject.java:248)
at org.python.core.PyObject.invoke(PyObject.java:2016)
at org.python.pycode._pyx5.createDomain$21(/tmp/WLSTOfflineIni25221.py:96)
at org.python.pycode._pyx5.call_function(/tmp/WLSTOfflineIni25221.py)
at org.python.core.PyTableCode.call(PyTableCode.java:208)
at org.python.core.PyTableCode.call(PyTableCode.java:404)
at org.python.core.PyFunction.__call__(PyFunction.java:184)
at org.python.core.PyObject.__call__(PyObject.java:314)
at org.python.pycode._pyx18.f$0(/home/mcas/weblogic/wlst/createEsbDomain.py:1)
at org.python.pycode._pyx18.call_function(/home/mcas/weblogic/wlst/createEsbDomain.py)
at org.python.core.PyTableCode.call(PyTableCode.java:208)
at org.python.core.PyCode.call(PyCode.java:14)
at org.python.core.Py.runCode(Py.java:1135)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:167)
at weblogic.management.scripting.WLST.main(WLST.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at weblogic.WLST.main(WLST.java:29)
Caused by: com.bea.plateng.domain.script.ScriptException: com.bea.plateng.domain.ValidateException: Property "User name" of User with original name "" is invalid. The property value is duplicated.
at com.bea.plateng.domain.script.ScriptExecutor.create(ScriptExecutor.java:897)
at com.bea.plateng.domain.script.jython.ScriptProxyFactory.deepCreateProxy4SecurityType(ScriptProxyFactory.java:135)
at com.bea.plateng.domain.script.jython.WLScriptContext.create(WLScriptContext.java:646)
... 27 more
Caused by: com.bea.plateng.domain.ValidateException: Property "User name" of User with original name "" is invalid. The property value is duplicated.
at com.bea.plateng.domain.aspect.XBeanConfigAspect.selfValidate(XBeanConfigAspect.java:630)
at com.bea.plateng.domain.aspect.AbstractConfigAspect.validate(AbstractConfigAspect.java:1130)
at com.bea.plateng.domain.aspect.AbstractConfigAspect.selfSetValue(AbstractConfigAspect.java:1615)
at com.bea.plateng.domain.aspect.AbstractConfigAspect.setValueInternal(AbstractConfigAspect.java:1574)
at com.bea.plateng.domain.aspect.AbstractConfigAspect.setValue(AbstractConfigAspect.java:748)
at com.bea.plateng.domain.aspect.AbstractConfigAspect.setValue(AbstractConfigAspect.java:757)
at com.bea.plateng.domain.aspect.FilteredConfigAspect.setValue(FilteredConfigAspect.java:431)
at com.bea.plateng.domain.operation.HTableEditOperation.createSimpleConfigAspects(HTableEditOperation.java:265)
at com.bea.plateng.domain.operation.HTableEditOperation.createSimpleConfigAspects(HTableEditOperation.java:221)
at com.bea.plateng.domain.script.ScriptExecutor.create(ScriptExecutor.java:873)
... 29 more
Caused by: java.beans.PropertyVetoException: The property value is duplicated.
at com.bea.plateng.domain.event.aspect.UniqueValueValidateListener.valueChanged(UniqueValueValidateListener.java:127)
at com.bea.plateng.domain.event.aspect.ConfigAspectValueListener.vetoableChange(ConfigAspectValueListener.java:138)
at com.bea.plateng.common.comdev.MVetoableChangeSupport.fireVetoableChange(MVetoableChangeSupport.java:189)
at com.bea.plateng.common.comdev.MVetoableChangeSupport.fireVetoableChange(MVetoableChangeSupport.java:156)
at com.bea.plateng.common.comdev.MVetoableChangeSupport.fireVetoableChange(MVetoableChangeSupport.java:139)
at com.bea.plateng.domain.aspect.XBeanConfigAspect.selfValidate(XBeanConfigAspect.java:620)
... 38 more
com.bea.plateng.domain.script.jython.WLSTException: com.bea.plateng.domain.script.jython.WLSTException: com.bea.plateng.domain.script.ScriptException: com.bea.plateng.domain.ValidateException: Property "User name" of User with original name "" is invalid. The property value is duplicated.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I did exactly the same thing for a normal weblogic domain (not alsb) and it works fine. Do I have to do something different for creating ALSB 3.0 domain?
Thanks,
NathanWell, we've had exactly the same issues.
From our experience even the most trivial tasks involving ALSB/OSB, WLST and Templates fail. Not just a single error, but every time we've tried something different to work around an issue we came across the script blew up with yet another error. After a couple of painful days we came to the conclusion that at least with WL10/ALSB3 templates and scripting are just too premature and too buggy to be of any use.
And at least from the ALSB Release Notes and Metalink it doesn't look like these issues have been addressed with subsequent releases.
We've resorted to creating the domain from scratch instead of using templates of our own domains created with the config wizard.
Cheers,
Jan -
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?? -
Generating customization file from WLST source
Hi all,
starting from http://e-docs.bea.com/alsb/docs30/javadoc/index.html?com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html I'm trying to translate the below java code:
for (QualifiedEnvValue qev : alsbSession.findEnvValues(evquery)) {
if (qev.getValue() instanceof String && qev.getValue().toString().startsWith(prefix)) {
into WLST code ...
But the problem is the translation of 'instanceof String'.
I'm trying in different ways but I got always an error.
I tried with:
1) if isinstance(myValue, str): -> str is unknown
2) if isinstance(myValue, String):
and from java.lang import String
-> no error but the behaviour is different from what I expect
Any hints ?
Regards
ferpHi all,
starting from http://e-docs.bea.com/alsb/docs30/javadoc/index.html?com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html I'm trying to translate the below java code:
for (QualifiedEnvValue qev : alsbSession.findEnvValues(evquery)) {
if (qev.getValue() instanceof String && qev.getValue().toString().startsWith(prefix)) {
into WLST code ...
But the problem is the translation of 'instanceof String'.
I'm trying in different ways but I got always an error.
I tried with:
1) if isinstance(myValue, str): -> str is unknown
2) if isinstance(myValue, String):
and from java.lang import String
-> no error but the behaviour is different from what I expect
Any hints ?
Regards
ferp
Maybe you are looking for
-
Unnecessary black lines being printed in the printed document
I have an year old HP M1136 Laser jet printer ( Serial No. - CND8B9QJ65 ) and use orignal HP cartridges. And I use Windows 7 ultimate (32-bit) as my operating system. I guess, The problem isn't regarding the software. It might have something to do w
-
About Jdeveloper10g new feaure with Jhs9.0.5.1 compatibility
In Jdeveloper10g have new feaure about Visual Editor, that will allows developer to work in both visual and code views separately or simultaneously. But I try this feature in Jhs9.0.5.1 with BC4J/Struts solution, the JSP seems did not have this feaur
-
Orace 10g offline_force backup failed
hi after colocation of server in datacenter our production sap backup fail every day we take offline_force backup in tape device. i check tape & tape drive also it is working, i copy aix os file in tape it is succesfully finished.but database backu
-
How to stop typing on JTextField at...
Hello, I have JTextField and want to limit inputting after certain number of text. Say, I want to limit after 10 characters are inputted. How to do this? I try setColumns method but does not give the effect I want. Anybody knows please post! Thanks,
-
Access !! help needed :( warehouse )
Hello everyone, i have a little question about access , I wish some body can help me so ,I have Access Warehouse Management Program Where is the user inserts materials, from customer, with purchase price, then he sell some with different price, How d