0

Is it possible to deploy applications to Weblogic server from command line(maven) using username other than weblogic admin? E.g For developers a group is created and users are added to that group. These users are developers which are not DBA' s.

Is it possible to deploy applications from command line with developet privileges?

Screenshot of server status

enter image description here

Jacob
  • 14,463
  • 65
  • 207
  • 320

1 Answers1

1

Yes, it is quite possible. Users need a role "Deployer" to deploy/undeploy applications in WebLogic. WebLogic would automatically grant this role to users who belong to group "Deployers"

So for you,

1) if such users exist on external ldap server (like AD, OID, etc), create a group "Deployers" on this external ldap server and make these users members of this group.

2) if such users exist in WebLogic's embedded ldap, then "Deployers" group is already present in weblogic's embedded ldap for completing the user-group mapping. All you need to do is make these users member of this group

Here is my test result:

D:\oracle\wls1036\wlserver_10.3\server\lib>d:\Tools\maven\apache-maven-3.0.5\bin\mvn.bat weblogic:deploy -Dadminurl=t3:/
/192.169.0.1:7001 -Duser=deployeruser1 -Dpassword=weblogic1 -Dtargets=AdminServer -Dsource=d:\tmp\cus_app\testvirtual.wa
r -Dname=testvirtual
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype 10.3.6.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:10.3.6.0:deploy (default-cli) @ weblogic-maven-plugin ---
weblogic.Deployer invoked with options:  -noexit -adminurl t3://192.169.0.1:7001 -user deployeruser1 -deploy -name testv
irtual -source d:\tmp\cus_app\testvirtual.war -targets AdminServer
<May 13, 2013 9:44:50 PM IST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, te
stvirtual [archive: d:\tmp\cus_app\testvirtual.war], to AdminServer .>
Task 4 initiated: [Deployer:149026]deploy application testvirtual on AdminServer.
Task 4 completed: [Deployer:149026]deploy application testvirtual on AdminServer.
Target state: deploy completed on Server AdminServer
Abid
  • 237
  • 2
  • 10
  • I would like to ask a question, is it a must that users has to be present in LDAP? What if a user is created and add that to deployer group? – Jacob May 13 '13 at 18:47
  • 1
    You can add existing users to **"Deployers"** group, or create new users and then add them to this group. I wrote up the answer assuming that you wanted to give Deployer privileges to existing users. – Abid May 14 '13 at 08:39
  • Abid, I will create users and will add to Deployer group. Our WLS is not linked with LDAP. – Jacob May 14 '13 at 09:37
  • Abid, It worked when I tried from command line as using Maven I am still having a few issues though. I do have another question, after a deploy or undeploy from target server I am getting the following errors `java.rmi.RemoteException: [Deployer:149145]Unable to contact 'MY_TARGET'. Deployment is deferred until 'MY_TARGET' becomes available.` What could be the reason for this? Thanks – Jacob May 16 '13 at 07:25
  • 1
    If you are targeting to a cluster and one of the members of the cluster is currently down or not reachable (from AdminServer) for some reason, then you get to see this behavior. If this is so, then once that member starts up (or AdminServer connects back to it) then deployment would move forward. If you can provide more details (like number of managed servers in the domain, cluster composition, status of different managed server and to what targets are you trying to deploy the application), I might help a bit. – Abid May 16 '13 at 08:34
  • Abid, I have attached screen shot of my server status in my question, my managed server is started and before starting managed server I have started nodemanager as well. However when I deploy I am getting `Target state: deploy deferred on Server wls_dev java.rmi.RemoteException: [Deployer:149145]Unable to contact wls_dev. Deployme nt is deferred until 'wls_dev' becomes available.` – Jacob May 16 '13 at 17:31
  • 1
    In WLS case, we have a master deployer component running on AdminServer and slave deployers on respective managed servers. When you execute a deployer utility(like maven, weblogic.Deployer,etc) giving ip and port of AdminServer but target wls_dev for deployment, the deployer utility connects to AdminServer and instructs it to deploy given application to target servers.,, continuing in next comment – Abid May 17 '13 at 14:28
  • 1
    Now in your case, even though console lists wls_dev as RUNNING, you would need to check the AdminServer logs as well as wls_dev logs (under DOMAIN_HOME/servers//logs) to see what communication exception they are getting during deployment, and resolve same. Maybe you need to enable http tunnelling for t3 protocol (default RMI protocol for inter-server communication in WLS), or enable deployment debugs to look under the hood – Abid May 17 '13 at 14:30
  • Abid, Thanks for the detailed explanation. As I couldn't resolve the issue yesterday, I had deleted existing domain and recreated a new domain and managed server. With the new domain so far I did not face any problems thus far. Even I have deployed using maven. Once again thanks a lot for your support and help. Appreciated. – Jacob May 17 '13 at 20:35