Labels

Thursday, September 27, 2012

TestLab Report: How to extract Test Set report along with Overall status, Step status, Description, Expected values, Actual values, Execution date and Execution time based on "RUN ID's".

SELECT CF_ITEM_NAME as "Test Set Folder Name",
CY_CYCLE as "Test Set Name",
TS_NAME as "Test Case Name",
RN_STATUS as "Test Case Status",
ST_STEP_NAME as "Test Step Name",
ST_STATUS as "Test Step Status",
ST_DESCRIPTION as "Test Step Description",
ST_EXPECTED as "Test Step Expected Result",
ST_ACTUAL as "Test Step Actual Result",
RN_RUN_NAME as "Run Name",
RN_HOST as "Test Host Name",
RN_TESTER_NAME as "Tester Name",
ST_EXECUTION_DATE as "Test Step Execution Date",
ST_EXECUTION_TIME as "Test Step Execution Time"
FROM STEP a, TEST b, CYCLE c,RUN d,CYCL_FOLD e
where
a.ST_run_ID=RN_RUN_ID and
c.CY_CYCLE_ID=d.RN_CYCLE_ID and
d.RN_TEST_ID=b.TS_TEST_ID and
e.CF_ITEM_ID=c.CY_FOLDER_ID and
RN_RUN_ID in (run_id1,run_id2....)
ORDER BY RN_RUN_ID,ST_STEP_NAME ASC

Thursday, September 13, 2012

How to Disabling and enabling the Weblogic 12c Administration Console?

For disable:
1. Select your domain name in the Domain Structure panel of the console(as base_domain below).

     2. Select Configuration | General, and click Advanced at the bottom of the page, and unselect Console Enabled.
OR
Using WLST:-
connect(“username”,”password”)
edit()
startEdit()
cmo.setConsoleEnabled(false)
save()
activate()
disconnect()
exit()
3. For enable, you can use WLST. The following code shows how to do it:
connect(“username”,”password”)
edit()
startEdit()
cmo.setConsoleEnabled(true)
save()
activate()
disconnect()
exit()

Best way to take Thread Dumps in Oracle WebLogic12c Server?

Below are the different ways on taking java thread dumps in a WebLogic Server environment.
Thread dumps are very useful to analyze and troubleshoot performance related issues such as server hang, deadlocks, slow running, idle or stuck applications,  etc.
Different ways to take thread dumps in WebLogic Server
Always prefer Operating system(OS) commands rather instead of Admin Console or Java Classes, because if the console is hanging, users won’t be able to connect to it to issue thread dumps.
1. OS Commands for Thread Dumps
i) On Windows,
<ctrl>+<break> — the thread dumps are generated in the server stdout
ii) On Solaris / Linux
first identify the process ID (pid) using   ps -ef | grep java, then run   kill -3 <pid> td_filename 2>&1
2. Using weblogic.WLST ( work only from WLS 9.x onwards)

First set CLASSPATH using setDomain.cmd or setDomain.sh (wlst.sh /wlst.cmd will also do in path C:\Oracle\Middleware\wlserver_12.1\common\bin ). Then run below command
java weblogic.WLST ThreadDumps.py
save below code in ThreadDumps.py file:
connect(“<username>”,”<password>”,”t3://<url>:<port>”)
cd(‘Servers’)
cd(‘AdminServer’)
threadDump()
disconnect()
exit()
threadDump()
The thread dumps get stored in the location from where you run it.
3. From Weblogic Administration Console
navigating to Server -> <server_name> -> Monitoring -> Dump threads stack.
4. From the JRockit Command line
jrcmd <pid> print_threads

Monday, September 10, 2012

What is rt.jar stand for in Java/JDK/JRE?

he most likely answer is, rt stands for RunTime. Some tend to think it stands for RooT, since this jar contains all java build-in classes. But I have yet to find any official Sun documents regarding this acronym.

Whether it stands for RunTime, RooT, or anything else is not important. The question I have is, why would the java creator chose to use such a undescriptive name. Maybe it can make your classpath shorter? But we rarely put rt.jar in system classpath.

Here are 2 reasons I don't like the name rt.jar:
  • While experienced developers take it for granted, java beginners don't know what it is other than it's a jar. So it's one more questions in beginners' mind.
  • The shorter the name, the easier it is to cause naming conflicts, at least visually. While rt.jar will always reside under $JAVA_HOME/jre/lib, it is possible your applications may have another jar also named rt.jar.
I know rt.jar will be with us as long as java is, but just for the sake of discussion, how would you name it differently? Maybe java.jar, or java-core.jar?

PS: What does jar stand for? Jar stands for Java Archive. A jar file usually has file name extension .jar. It contains mainly java class files but any types of files can be included, e.g., XML files, HTML files, properties files, gif/jpg image files, text files, PDF files, and binary files, and so on.

PS: What is the difference between a jar file and a zip file? Basically, a jar file is the same as a zip file, except that the jar file contains a META-INF directory to store metadata or attributes. The most well-known file is META-INF/MANIFEST.MF. You can customize the content of a MANIFEST.MF when creating a jar file, and if you don't, a default one is generated and included. For example:



Manifest-Version: 1.0
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
It's perfectly fine to have other configuration files and directories under META-INF.

Glassfish password file?




AS_ADMIN_MASTERPASSWORD=changeit
AS_ADMIN_PASSWORD=adminadmin
AS_ADMIN_USERPASSWORD=xxx
password.txt contains the above password values. Glassfish application server doesn't allow you to specify password as command line arguments (or at least it gives warning). Instead, it uses the --passwordfile argument to get passwords from a plain text file, which can only be accessed by the owner.

Nobody can memorize these keys, and several times I forgot where I saved this file. So keep a copy here for future copy-paste.

If the keys in the password file are not what glassfish expected, it gives this warning:
Options specified in passwordfile are either invalid or deprecated. Passwordfile can only be used to specify values for password options. Use of passwordfile to specify values for other options is deprecated. Passwordfile should contain the following format AS_ADMIN_=.


You may like this

GlassFish multimode Command for Batch Processing?

GlassFish asadmin multimode command runs a series of asadmin subcommands within one single session. The --file option takes a file containing the list of subcommands.

In the following example, I created 2 files named asadmin-create-resources and asadmin-delete-resources, and pass each of them to asadmin multimode:















# content of file asadmin-create-resources
create-jms-resource --restype javax.jms.QueueConnectionFactory jms/QueueConnectionFactory1
create-jms-resource --restype javax.jms.Queue jms/Queue1
create-jms-resource --restype javax.jms.Queue jms/Queue2
 
 
$ asadmin multimode --file /tmp/asadmin-create-resources
 
 
# content of file asadmin-delete-resources
delete-jms-resource jms/Queue1
delete-jms-resource jms/Queue2
delete-jms-resource jms/QueueConnectionFactory1
 
 
$ asadmin multimode --file /tmp/asadmin-delete-resources
More details are available in asadmin help:
asadmin help multimode
asadmin multimode --help
asadmin multimode -\?

Friday, September 7, 2012

javax.resource.ResourceException: 4

Hi ,
while creating oracle connection pool in glassfish v2.1.1 getting the below error.If any know solution please share.your help is highly appreciated .


sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=23;_ThreadName=httpWorkerThread-8001-4;_RequestID=55bd50e7-6738-4444-a558-7
8b0f9ad0d8b;|
java.lang.RuntimeException: javax.resource.ResourceException: 4
        at com.sun.enterprise.tools.admingui.util.JMXUtil.invoke(JMXUtil.java:124)
        at com.sun.enterprise.tools.admingui.util.JMXUtil.invoke(JMXUtil.java:75)
        at com.sun.enterprise.tools.admingui.handlers.JdbcHandlers.pingJdbcConnectionPool(JdbcHandlers.java:530)
        at sun.reflect.GeneratedMethodAccessor2055.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:422)
        at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:424)
        at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:398)
        at com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:132)
        at com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:80)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
        at javax.faces.component.UICommand.broadcast(UICommand.java:372)
        at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        at com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:132)
        at com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:80)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
        at com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:80)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
        at javax.faces.component.UICommand.broadcast(UICommand.java:372)
        at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:80)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at com.sun.enterprise.tools.admingui.servlet.DelayedInitFacesServlet.service(DelayedInitFacesServlet.java:89)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
        at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:117)
Caused by: javax.resource.ResourceException: 4
        at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:556)
        at com.sun.enterprise.connectors.ConnectorRuntime.testConnectionPool(ConnectorRuntime.java:520)
        at com.sun.enterprise.admin.mbeans.ResourcesMBean.pingConnectionPool(ResourcesMBean.java:2388)
        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:597)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:390)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:373)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:477)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

Thursday, September 6, 2012

Whar are the main differences between weblogic Versions 8 Vs 9/10

Weblogic 8
Weblogic 9/10
Console is an applet and uses JCX JCS JPF and Netui page flows Console is portal and uses JSTL (JSP 2.0)
No folder called config Folder called config is available
No Prepare state for application. Only active state Prepare state for application, This optimises memory utilization.
No app inf lib and classes App inf lib and app inf classes are added
Persistant store is defined Under JMS Persistant store is defined Under JDBC
We have connection pools and datasources We have datasources and connection pools are inside datasources.
We have execute queues. We have work managers
No lock and edit Lock and edit is the new feature
We need to delete and redeploy from admin console We can update the application using admin console
All configuration information is in one config.xml Seperate xml files for domain config and jms modules are added
No concept of JMS modules and sub deployments Jms modules and subdeployments are included.
Queue/topic is configured under distributed destination Queue/topic/dd etc are all clubbed in a JMS modules
Side by side deployment is not possible Side by side deployment is possible
Server dosent come up if deployment fails Server boots in ADMIN mode if deployment failes

weblogic server restart Script using crontab in unix without any manual intervention

#! /bin/ksh
#This script is used for restarting the Weblogic server using CRONTAB
#-------------------------------------------------------------------
# Mail list is used to email the list of users once the restart is done
Maillist=" "
# Mail file is the file which will get emailed to the mail list users
Mailfile= " "
#This is the temporary log file where stopWeblogic.sh result will be stored
> Stop_log
# Stopping the Server
echo "Stopping Weblogic server"
. ./stopWebLogic.sh > Stop_log 2>& 1
sleep 90
echo "Confirming that the Weblogic server stopped"
. ./stopWebLogic.sh >> Stop_log 2>& 1
# Searching for the exception when you shut down the weblogic server for the second time
egrep '[Destination unreachable | "OPUSServer" was shutdown successfully]' Stop_log > /dev/null
if [ $? -eq 0 ]
then
echo "Weblogic server stopped successfully"
# Starting the Server
echo "Trying to start Weblogic server"
#. ./startWebLogic.sh > Start_log 2>& 1 &
. ./startWebLogic.sh > /dev/null
#Getting the process id for startWebLogic.sh process
id=$!
i=0
until [ $i -gt 1 ]
do
sleep 90
grep "Server started in RUNNING mode" /prod/opus/OPUS_CONS1/logs/wl-domain.log > /dev/null
if [ $? -eq 0 ]
then
echo "Weblogic server started successfully"
#Killing the process startWebLogic.sh using process id
#kill -9 $id
#echo "Killed startweb"
break
fi
i=`expr $i + 1`
done
if [ $i -ne 2 ]
then
echo "Weblogic server restarted successfully"
mailx -s "Weblogic_server name Restarted Succesfully" -r $Maillist < $Mailfile

else
echo "Weblogic server failed to start"
mailx -s "Weblogic_server name failed to start" -r $Maillist
fi
else
echo "Failed to stop Weblogic server"
mailx -s "Failed to stop Weblogic server" -r $Maillist
fi
echo "Completed the script"
exit