Wednesday, August 3, 2011

Executing WLST - offline and online



  I recently got a query on one of my blogs regarding the WLST commands related to SOA suite that can be run in different modes. –offline and online
1.    online (connected to a running Administration Server or Managed Server instance)
2.    offline (not connected to a running server).

 As per the WLST documentation for SOASuite customWLST commands , the  sca_deployComposite and sca_undeployComposite  can be executed offline. So what does this offline and online mean?

The offline and online are specific to WLST. When you use connect() command in WSLT you are connecting to the server and becoming online, but if you wish to remain offline you can use disconnect() and exit the online session. The online and offline should not be implied as the running status of the server. If the server is shutdown these commands will fail as it requires the hostname and port and connects to it. These commands will work even if the soa-infra is shutdown.

The commands work properly when WLST is online. For testing the WLST command offline, I brought down the server and then executing it offline.
 But since the commands require serverURL and it does validate the connection to host and port.

I will show the difference between offline and online mode with sca_undeploy command.

OFFLINE

When you try to do cd('Servers/ soa_server1’) it will give below error
Error: No domain or domain template has been read.

So you will have to give the entire path of the domain

wls:/offline>readDomain('/geo/oracle/fusion/middleware/user_projects/domains/soa_domain’)
wls:/offline>cd('Servers/ AdminServer’)
wls:/offline/soa_domain/Server/AdminServer’>sca_undeployComposite("http://localhost:8001","GeoComposite", "1.0","weblogic","weblogic123",partition=’default’)
serverURL = http://localhost:7001
user = weblogic
partition = default
compositeName = GeoComposite
revision = 1.0  
timeout= -1
set user and password...
compositeDN = default/GeoComposite!1.0
Creating HTTP connection to host:localhost, port:7001
Received HTTP response from the server, response code=200
---->Undeploying composite (default/ GeoComposite!1.0) success.


ONLINE


wls:/offline> connect()
Please enter your username [weblogic] :weblogic
Please enter your password [welcome1] :
Please enter your server URL [t3://localhost:7001] : t3://localhost:7001
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'soa_domain'.

wls:/soa_domain/serverConfig> sca_undeployComposite("http://localhost:8001","GeoComposite", "1.0","weblogic","weblogic123")
serverURL = http://localhost:8001
user = weblogic
partition = default
compositeName = GeoComposite
revision = 1.0
timeout= -1
set user and password...
compositeDN = default/GeoComposite!1.0
Creating HTTP connection to host:localhost, port:8001
Received HTTP response from the server, response code=200
---->Undeploying composite (default/GeoComposite!1.0) success.


Hope this clarifies.

18 comments:

Gustavo said...

Hi Georce, thanks for the post.

I’ve followed your commands and in my case both of them are working only if I have the soa-infra up. However, when the soa-infra is down (soa-infra-wls.ear) I’m not able to use the sca_undeployComposite and always get a 404 error.

Could you please help me? Do I miss something else?

Unknown said...

Can you let me know how you are trying to undeploy, maybe the port specified is incorrect, thats why you are getting the 404 error.

Gustavo said...

Thanks, not problem.

I'm using the Pre-built Virtual Machine for SOA Suite and BPM Suite 11g without modifications. The commands I type in the wslt are:
1. readDomain('/oracle/fmwhome/user_projects/domains/domain1') - OK
2. cd('Servers/AdminServer') - OK
3. sca_undeployComposite('http://localhost:7001','Bpel_Name','1.0','weblogic','welcome1',partition='default') - 404 error

However, when I type the same commands with the soa-infra up it works perfectly.
Do I have to use different ports when the soa-infra is up or down?

Thanks in advance.

Unknown said...

Yaa..the port seems to be different. The WLST documentation doesn't specify these in detail.

Abhinav Chand Mittal said...

Hi Thomas
I have a same problem and i am following the steps mentioned in your blog.But, when i type sca_undeployComposite(....), it throws an error saying Name error
Kindly help, i am stuck and it's too urgent.

Unknown said...

Name error comes bcos the WLST bin folder from where you are running may not have the function defined in the classpath.
Kindly check whether you are executing the WLST commands from the correct bin folder.
weblogic bin wlst doesn't support the sca specific functions.

Abhinav Chand Mittal said...

HI Thomas
Thanks for the quick reply.
Well, i found out that i was in C:\Oracle\Middleware\wlserver_10.3\common\bin. so i have changed the path now and i am able to resolve the name error.
But, now when i use sca_undeployComposite(), i get 404 error.
My admin server is up and soa_server is up(soa_infra is down)..am i missing something?
Regards
Abhinav

Abhinav Chand Mittal said...

HI Thomas
I have verified that the admin server is running on 7001 and soa_server is running on 8001.
But, why am i seeing the error 404 not found.
Can you please help, it's very urgent and the environment is down from yesterday.
Thanks in advance
Regards
Abhinav

Unknown said...

can you tweak with your ports and see.use admin server port :7001 or 8001 , or depending on what is configured for ur server

Unknown said...

wat is the error you are getting when u start soa-infra

Abhinav Chand Mittal said...

Hi Thomas
As you said, i connected to admin server using port 8001 though it is configured with 7001 and then tried with sca_undeployComposite(), but to no avail.
Any other ideas about how to get it resolved.
I appreciate your time and help
Regards
Abhinav

Abhinav Chand Mittal said...

"FabricInit" failed to preload on startup in Web application: "/soa-infra".
I looked at the problem and my problem and the problem described for following this solution match.
Regards
Abhinav

Abhinav Chand Mittal said...

Thomas
Do i need to do all this in offline mode.
I will summarize what i am doing, may be you will be able to help better.
1)My admin server and soa server are up
2)IPM and UCM are down
3)I am running these commands in online mode
Any idea about what am i missing?
Regards
Abhinav

Unknown said...

First thing you need to check i s whether soa-infra is not coming up due to a composite process that you are trying to undeploy.

u need to try un-deploy option with offline mode..
in case that doesnt work out , you can try the work arounds mentioned in

http://georgie-soablog.blogspot.com/2011/05/soa-infra-startup-issue.html

Abhinav Chand Mittal said...

Hi Thomas
<Servlet: "FabricInit" failed to preload on startup in Web application: "/soa-infra".
oracle.fabric.common.FabricException: Error in getting XML input stream: oramds:/deployed-composites/default/InvoiceVerification_rev1.0/SCA-INF/lib/orabpel.jar: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/deployed-composites/default/InvoiceVerification_rev1.0/SCA-INF/lib/orabpel.jar does not exist.
Thats why i am following your blog, i have tried almost everything, but nothing seems to be working.
The offline mode is also not working.
Thanks
Abhinav

Unknown said...

can u send me the commands that you are using wlst offline ..try admin server port

Eduardo Cordeiro said...

Hi, George!
Thanks for the post!!

My scenario is:
- I'm working in a project with SOA Suite 11g
- someone of the team had deployed a component at sometime that the servers was being restarted
- this BPEL component had crashed
- we are trying to restart SOA server but it stay off, with this error:

INFO: SSLSocketFactoryManagerImpl.getSSLSocketFactory Could not obtain keystore location or password
Response code=404, error:null


- I read something in Oracle forum and I'm try to execute another command to search all deployed composites. But this command also don't works fine:

wls:/offline> readDomain('/u01/domains/svc/oss/oss_dev')
wls:/offline/oss_dev> cd('Servers/oss_dev_admin')
cd('Servers/oss_dev_admin')
wls:/offline/oss_dev/Server/oss_dev_admin> sca_listDeployedComposites("localhost","7001","weblogic","welcome1")
host = localhost
port = 7001
user = weblogic
Connecting to: service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime
Cannot find composite lifecycle mbean.

Perhaps you can tell me something about this issue??

Thanks in advance!

Sunny said...

How can we record WLST for SOA operations? In other words can we record the stuff we do EM console through WLST like as we do in Weblogic?.

Thanks
Nanda