Weblogic deployment J2EE Deployment SPI:260101]Parameter 'moduleArchive' may not be null - weblogic

I am trying to re-deploy an application to Weblogic 10.3.6 using command line deployment using the following,
java weblogic.Deployer -adminurl myserver:7001 -user deploymyuser
-password welcome1 -targets mytarget -name appname -redeploy
D:/app/deploy/app.ear -upload -remote
I am getting the following errors
<Error> <J2EE Deployment SPI> <BEA-260101> <Parameter 'moduleArchive'
may not be null.>
[J2EE Deployment SPI:260101]Parameter 'moduleArchive' may not be null.
How can I resolve this issue?

Use the switch "-source" with the redeploy command:
java weblogic.Deployer -adminurl myserver:7001 -user deploymyuser -
password welcome1 -targets mytarget -name appname -redeploy
-source D:/app/deploy/app.ear -upload -remote

Related

need to check which cacerts and jks, Application deployed on weblogic programs is using from backend [linux Server]

In my weblogic console, i am seeing location of identity, truststore and cacerts. But there are some other cacerts which Apps running in Weblogic is using. Is there any command in linux to check which all cacerts and keystore location is in use. As below location cacerts is used by Apps running on weblogic, but not mentioned anywhere in weblogic console.
[prdzap#vmtlxap security]$ ls
tsscacerts_fde tsscacerts_ret yutz_prod.jks tsscacerts
[prdzap#vmtlxap security]$ pwd
/app/domains/prdzap/PRDZAP/security
As i found the solution myself, so thought of updating [So that it will help others].
To search any jks file even if its extenetion is changed globally [As below files]
[prdzap#vmtlxap security]$ ls
tsscacerts_fde tsscacerts_ret yutz_prod.jks tsscacerts
We can use the combination of "find","file" and "grep" command
[prdzap#vmtlxap security]$ file tsscacerts_fde
tsscacerts_fde: Java KeyStore
[prdzap#vmtlxap security]$ find . -type f -exec file {} \; | grep -i "Java KeyStore"
./tsscacerts_fde: Java KeyStore
./tsscacerts_ret: Java KeyStore
./yutz_prod.jks: Java KeyStore
./tsscacerts: Java KeyStore

weblogic.Admin: command not found

I am using linux terminal with below code to get server status but i am getting weblogic.Admin: command not found, any lead would be appreciable.
cd /opt/SP/WEB_DATA/weblogic/wls12130/user_projects/domains/pega/bin
. ./setDomainEnv.sh
export CLASSPATH=/WEB_DATA/weblogic/wls12130/wlserver/server/lib/weblogic.jar
ServerState=/opt/SP/WEB_DATA/mw/jdk1.8.0_91/bin/java weblogic.Admin -url http://t3://localhost:7001 -username weblogic -password weblogic1
GET -pretty -type ServerRuntime -property State |grep -i State|awk '{print $2}'| rev | cut -c 1- | rev
weblogic.Admin has been deprecated for a while now. Use wlst instead.
(location of ORACLE_HOME)/wlserver/common/bin/wlst.sh
wls:/offline>connect('weblogic','weblogic1','t3://localhost:7001')
wls:/DOMAIN/serverConfig>state('WLAdmin','Server')
WLAdmin is the name of the admin server
You can place the above commands in a python script and execute it using wlst

how to list glassfish instances?

I have a glassfish domain running, but I cannot get the PID of the associated java process, is this broken or am I doing something wrong? I have FreeBSD 10.1, OpenJDK 1.7.0, and Glassfish 4.1.
$ asadmin list-domains -l
DOMAIN ADMIN_HOST ADMIN_PORT RUNNING RESTART_REQUIRED
domain1 127.0.0.1 4848 true false
Command list-domains executed successfully.
$ asadmin list-instances -l
Nothing to list.
Command list-instances executed successfully.
I can do jps -v, but with that I am not 100% sure the listed PID is my glassfish server...
$ jps -v
62737 Jps -Dapplication.home=/usr/local/openjdk7 -Xms8m
EDIT:
Ok. the jps command is definitely not what I want - that is just showing itself. Also I tried
$ asadmin list-instances -l domain1
remote failure: The target, domain1, is not an instance, cluster, domain, node or config.
Command list-instances failed.
and
$ asadmin list-instances -l 127.0.0.1
remote failure: The target, 127.0.0.1, is not an instance, cluster, domain, node or config.
Command list-instances failed.
Take a look at this issue from the Glassfish JIRA Server.
https://java.net/jira/browse/GLASSFISH-12744

how to deploy war/ear file from command line in weblogic

I want to deploy war/ear file from command line using wslt command into weblogic server. Will any one help on this issue. I need command to do this issue.
set CLASSPATH=D:\Weblogic\Middleware\wlserver_10.3\server\lib\weblogic.jar
//From remote
java weblogic.Deployer -adminurl t3://localhost:8001 -user weblogic -password password123 -deploy C:\Users\User\Documents\sample\dist\sample.war -remote -upload
//From normal
java weblogic.Deployer -adminurl t3://localhost:8001 -username weblogic -password password123 -deploy -name warfilename -targets AdminServer -source C:\apps\sample.war
by using above stuff it is resolved.
Just wanted to add for deploying artifacts as shared-library you can use the following:
java weblogic.Deployer -adminurl t3://localhost:7001 -username [Your username] -password [Your password] -upload -library -targets AdminServer -deploy -source [path to your war file]
import re
warPath = raw_input('enter warpath:')
appPath = raw_input('enter appname:')
weblogicUrl = raw_input('enter weblogicurl:')
userName = raw_input('enter username:')
password = raw_input('enter password')
connect(userName,password,weblogicUrl)
appList = re.findall(appName, ls('/AppDeployments'))
print(len(appList))
if len(appList) > 0:
undeploy(appName, timeout=60000)
deploy(appName,warPath,targets='AdminServer')
exit()

Invoking Jython without Weblogic's WLST

I'm using an AIX machine which has Weblogic 9.21 installed and it also has jython as part of its installation (WLST).
Is there a way to run jython code without having to initialize the WLST first?
I have the following jars too if they bring in any ideas:
['.', '/opt/weblogic921/weblogic92/common/lib/jython.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/server/lib/weblogic.jar', '/opt/weblogic921/weblogic92/common/wlst/modules/jython-modules.jar/Lib', '/opt/weblogic921/weblogic92/common/wlst', '/opt/weblogic921/weblogic92/common/wlst/lib', '/opt/weblogic921/weblogic92/common/wlst/modules']
Right now I'm invoking the jython code using:
java -cp /opt/weblogic921/weblogic92/server/lib/weblogic.jar weblogic.WLST file.py
Paste below code in a shell script say jythonExec.sh and use it
Example Usage : /bin/bash jythonExec.sh file.py
#!/bin/bash
jythonJarLoc=/opt/weblogic921/weblogic92/common/lib/jython.jar
javaLoc=/usr/bin/java
pythonCacheDir=/tmp/pythonCacheDir
if [ ! -f ${jythonJarLoc} ]; then
jythonJarLoc=/opt/weblogic921/weblogic92/server/lib/weblogic.jar
fi
${javaLoc} -cp ${jythonJarLoc} -Dpython.cachedir=${pythonCacheDir} org.python.util.jython $#