tag:blogger.com,1999:blog-19542956448420686122024-03-13T01:37:37.061-03:00Into MiddlewareMy plan is to learn a new thing every two to three weeks. By sharing on this blog, will help me focus and hopefully help some readers. This is a hobby that I have been trying to exercise for quite a while now, but never could get it going for different reasons. Thanks sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-1954295644842068612.post-36849803175888499062016-05-24T09:57:00.001-04:002017-12-26T17:05:22.200-03:00Putty X11 and Tunnel config<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;">Scope: </span><br />
<span style="font-size: large;">While executing a remote host connection with SSH, and starting the whole Oracle's Middle-ware environment, eventually I need to double check if the administration server, and the deployed applications are accessible from the respective IP address. The following scenario describe better the obstacles to finish my task: </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">1. Due to some VPN configuration, I have to use Windows, which in my case the Win. OS is running on a virtual machine. </span><br />
<span style="font-size: large;">2. I only have the SSH protocol ( port 22 ). </span><br />
<span style="font-size: large;">3. As explained above, I had to login into the WLS's Admin's Console, to finish configuration and run a simple check on the Managed Servers' deploy Apps to check the IP access. </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Actions: </span><br />
<span style="font-size: large;">1. Download and install <a href="https://the.earth.li/~sgtatham/putty/latest/x86/putty.exe" target="_blank">Putty</a>, its a nice little software that enables Windows users to connect into a remote Unix like OS through the SSH protocol. </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">2. Search and start putty from your Windows menu search: </span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyNlGbqOU2HZOhvioZFU4OJAOb2rQ9OFYHDtzllaIxMymoKEDX38rBkZgtCMjc7Y_gyS78_dK8wasUvuIbIJ0vlZ8tv2K6dLmYyy7mz4To35szMXAyWgtii6_6-RUNV5jCYIW-SmfFEKE/s1600/Screenshot_2016-04-26_15-32-19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyNlGbqOU2HZOhvioZFU4OJAOb2rQ9OFYHDtzllaIxMymoKEDX38rBkZgtCMjc7Y_gyS78_dK8wasUvuIbIJ0vlZ8tv2K6dLmYyy7mz4To35szMXAyWgtii6_6-RUNV5jCYIW-SmfFEKE/s320/Screenshot_2016-04-26_15-32-19.png" width="256" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: large;">3. Next you need to provide the IP and by default SSL goes to port 22, but if the Unix Administrator had opened the SSH in another port, you could configure the connection to the provided port.</span></div>
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnNf-Z2-XCS9Z2WYz8RHqNUeQkfwf7VWr3_YKo7BMjQLXPu9krCa0ogK_PNIeHdi7Hcx46DFGzT45QJmRZwpP9-tE4TQdHwpTRcFxFfjuSfbhTmQCxfw1usBFFD8sbEOUR2cc_8-NLctQ/s1600/Screenshot_2016-04-26_15-33-33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnNf-Z2-XCS9Z2WYz8RHqNUeQkfwf7VWr3_YKo7BMjQLXPu9krCa0ogK_PNIeHdi7Hcx46DFGzT45QJmRZwpP9-tE4TQdHwpTRcFxFfjuSfbhTmQCxfw1usBFFD8sbEOUR2cc_8-NLctQ/s320/Screenshot_2016-04-26_15-33-33.png" width="320" /></a></div>
<span style="font-size: large;">4. The go to connection/SSH/X11, and select the 'Enable X11 forwarding'. This will enable the X11 port forwarding in case of exporting GUI into local machine. Also you need on Windows the <a href="https://sourceforge.net/projects/xming/files/latest/download" target="_blank">Xming</a> installed and running. </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMhSYOVU0c2w9o8GA8Gtab4eP6su4yyLftcVRiAyoi5yVSIA004wTbH4xiFh5TVarBd0HjbdHgVWqfUGZFTY0ebC2sIQhkWf8Mg-prAt6fFGcf0-k3kxYCnpSqhvIxGEOSBwlFnuArVc0/s1600/Screenshot_2016-04-26_15-34-21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMhSYOVU0c2w9o8GA8Gtab4eP6su4yyLftcVRiAyoi5yVSIA004wTbH4xiFh5TVarBd0HjbdHgVWqfUGZFTY0ebC2sIQhkWf8Mg-prAt6fFGcf0-k3kxYCnpSqhvIxGEOSBwlFnuArVc0/s320/Screenshot_2016-04-26_15-34-21.png" width="320" /></a></div>
<br />
<span style="font-size: large;">5. Then go to the connection/SSH/Tunnels and do the following action: </span><br />
<span style="font-size: large;"><br /></span>
<br />
<div style="text-align: left;">
</div>
<ol style="text-align: left;">
<li><span style="font-size: large;">Add a local port to access, 7001; </span></li>
<li><span style="font-size: large;">Provide the remote Destination IP. Be careful</span><span style="font-size: large;"> with this configuration, Because you could be using the SSH connection to connect to another remote machine so you need to make sure the you provide the same IP as the connected SSH session;</span></li>
<li><span style="font-size: large;">Provide the port in which the service is running on the provided IP; </span></li>
</ol>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv3HRM5F-rE6u30ftdF-493cjJU2wzjZibCa5LxgM7O6lzPcVLau4QEIaVqMMqf37mOk8ZG-3n5pAHsV14oZiJezwvPAjV2_iukzucJyi4_zEljvD08uGVH_LCooPkLCY59WV9AD3P1go/s1600/Screenshot_2016-04-26_15-35-22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv3HRM5F-rE6u30ftdF-493cjJU2wzjZibCa5LxgM7O6lzPcVLau4QEIaVqMMqf37mOk8ZG-3n5pAHsV14oZiJezwvPAjV2_iukzucJyi4_zEljvD08uGVH_LCooPkLCY59WV9AD3P1go/s320/Screenshot_2016-04-26_15-35-22.png" width="320" /></a></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">6. That's it, now you can access the Admin's Console on you localhost at http://localhost:7001/console and any application deployed on the managed server at http://localhost:15101/appName;</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span></div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-1454013264643532622016-03-31T17:45:00.000-03:002016-04-06T12:44:00.161-03:00ODI 12c install Bug: Cyclic dependency detected among featureset libraries oracle.odi.sdk.clientLib.jar<div dir="ltr" style="text-align: left;" trbidi="on">
<br class="Apple-interchange-newline" />
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">I am currently installing WLS 12.2.1 Enterprise with multiple products on multiple environments; During the installation on ODI over FMW Infrastructure, and I faced the following Exception printed out on the installation log located at the tmp directory:</span><br />
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<blockquote class="tr_bq">
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">Caused by: oracle.sysman.oii.oiif.oiifb.OiifbEndIterateException: com.oracle.cie.gdr.libraries.LibraryHandlerException: Cyclic dependency detected among featureset libraries: [/u01/oracle/products/fmw/modules/clients/oracle.odi.sdk.clientLib.jar]</span></blockquote>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">What I know about the problem:</span><br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<br />
<ol style="text-align: left;">
<li><b><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">The issue happen only during the ODI 12c install, and any other product such as SOA and OSB the installation was successfully. By investigating I heard that a college</span><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;"> could run the installation without a problem; </span></b></li>
<li><b><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">I looked into the Oracle Support and found that is a bug on description phase, which means it would take a long time for a final solution: </span><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">Bug 22262514 : ERROR WHEN INSTALLING ODI 12.2.1 ON HP UX 11.31; </span></b></li>
<li><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;"><b>The ODI installation is the only installation with the double jars to install: </b></span></li>
<li><b><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;">The Oracles documentation provided me with the following </span><a href="https://docs.oracle.com/middleware/1221/core/ODING/install.htm#ODING413" style="font-family: tahoma, verdana, helvetica, sans-serif;" target="_blank">step</a><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;"> to install the ODI: </span></b></li>
</ol>
<blockquote class="tr_bq">
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><b><span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;"> </span></b><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 1.615;">/home/Oracle/jdk1.8.0_60/bin/java -jar fmw_12.2.1.0.0_odi.jar</span></span></li>
</ul>
</blockquote>
<br />
What I was doing:<br />
<br />
Since I had to install the application on silent mode, I had something similar to the script bellow:<br />
<br />
<blockquote class="tr_bq" style="text-align: left;">
<span style="font-size: x-small;"><i>#!/bin/bash</i></span> </blockquote>
<blockquote class="tr_bq" style="text-align: left;">
<span style="font-size: x-small;"><i></i><i>export JAVA_HOME=<span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;">/home/Oracle/jdk1.8.0_60</span></i></span> </blockquote>
<blockquote class="tr_bq" style="text-align: left;">
<span style="font-size: x-small;"><i><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;"></span></i><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;"><i>export PATH=$JAVA_HOME/bin:$PATH</i></span></span> </blockquote>
<blockquote class="tr_bq" style="text-align: left;">
<span style="font-size: x-small;"><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;"><i>java -version</i></span></span> </blockquote>
<blockquote class="tr_bq" style="text-align: left;">
<span style="font-size: x-small;"><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;"><i></i></span><i><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;">java -d64 -Xms4g -Xmx4g -jar </span><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;">fmw_12.2.1.0.0_odi.jar -silent etc...</span></i></span></blockquote>
<br />
<div style="text-align: left;">
As you can see, the steps were done correctly and running similar scripts worked on the SOA and OSB installation; After some long hours looking and trying to install a successful ODI install, I remember something about how the JVM actually loads classes. By following the instruction from Oracle in providing a full path of the JDK, the JVM seems to load the second <b>fmw_12.2.1.0.0_odi2.jar</b>, therefore the issue was on my script and how I am calling the <b>fmw_12.2.1.0.0_odi.jar; </b>By setting the global <b>PATH</b> variable, I was not allowing the <b>java</b> command to load all needed classes and jars. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Therefore the solution is simple, was just changing how I was calling the <b>java</b> command or use the <b>-cp</b> to set the classpath: </div>
<div style="text-align: left;">
<br /></div>
<blockquote class="tr_bq" style="text-align: left;">
<i style="font-size: small;"><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;">java </span></i><i style="font-size: small;"><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;">-d64 -Xms4g -Xmx4g -cp <full_path>/fmw_12.2.1.0.0_odi2.jar -jar <full_path>/</full_path></full_path></span><span style="background-color: #f9f9fb; font-family: "menlo" , "monaco" , "courier new" , "courier" , "mono" , serif; line-height: 20.995px;">fmw_12.2.1.0.0_odi.jar -silent etc...</span></i></blockquote>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
If you do the above command and still get an error like bellow, its a good change the you had an failed installation on the FMW Infrastructure previously and you need to delete and reinstall the whole environment again. </div>
<blockquote class="tr_bq" style="text-align: left;">
<span style="font-size: x-small;"><br /></span>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif; font-size: x-small;">oracle.sysman.nextgen.NextGenInstallerException: oracle.sysman.oii.oiif.oiifb.OiifbEndIterateException: com.oracle.cie.gdr.maven.PomException: Errors were found during</span><br />
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif; font-size: x-small;">POM generation. Please check the logs for more informatio</span></blockquote>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<span style="font-family: "tahoma" , "verdana" , "helvetica" , sans-serif;"><br /></span>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: white; width: 948px;" summary=""></table>
<div style="background-color: white; color: #003d5b; font-family: tahoma, verdana, helvetica, sans-serif; font-size: 11px;">
<span class="x1a"></span></div>
<table border="0" cellpadding="0" cellspacing="0" style="width: 948px;" summary=""><tbody>
<tr><td align="left"><div style="margin: 0px;">
<br /></div>
</td></tr>
</tbody></table>
</div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com6tag:blogger.com,1999:blog-1954295644842068612.post-70313818156696492192015-02-18T18:15:00.001-03:002015-02-19T11:56:59.946-03:00WHY Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy<div dir="ltr" style="text-align: left;" trbidi="on">
<code>
</code>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
I have been working on some some J2EE 7 fun projects, and suddenly I run into some problems during deployments on my project with NetBeans 8.0.2 and glassfish 4. As you can see below, the server writes some reflect output stack trace:<br />
<code><span style="font-size: x-small;"><br /></span></code>
<br />
<div style="text-align: left;">
<code><span style="font-size: x-small;">Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy</span></code></div>
</div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.reflect.Executable.declaredAnnotations(Executable.java:546)</span></code></div>
<div style="text-align: left;">
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.reflect.Executable.getAnnotation(Executable.java:520)</span></code></div>
<div>
<code><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.reflect.Method.getAnnotation(Method.java:607)</span></code><br />
<code><span style="font-size: x-small;"><br /></span></code>
<br />
<br />
This ArrayStoreException came wrapped in another exceptions, by reading the stack and taking consideration the moment in which the Exception actually happens we can get some thoughts of what might be going on: <br />
<br />
<br />
<ol style="text-align: left;">
<li>The server does not deploy the application, could be due to missing libs or bad configuration.</li>
<li>The ArrayStoreException with the TypeNotPresentExceptionProxy, tells me that something is missing, but since there is no java.lang.NoClassDefFoundError, it means is not a classpath's path.</li>
<li>The java.lang.reflect.Method.getAnnotation() method, it tells is something to do with annotations.</li>
</ol>
<span style="font-size: x-small;"><br /></span>Its time to look at the Exception wrapper. So it may give some clues where to look for more information:<div style="text-align: left;">
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">Severe: sun.reflect.annotation.TypeNotPresentExceptionProxy</span></div>
<div style="text-align: left;">
<span style="font-size: x-small;">Severe: Exception while deploying the app [ProjectEulerAnswers]</span></div>
<div style="text-align: left;">
<span style="font-size: x-small;">Severe: Exception during lifecycle processing</span></div>
<div style="text-align: left;">
<span style="font-size: x-small;">java.lang.IllegalStateException: sun.reflect.annotation.TypeNotPresentExceptionProxy. Related annotation information: annotation [@javax.ejb.Stateless(name=, description=, mappedName=)] on annotated element [class com.euler._25Beans.q11UPBean] of type [TYPE]</span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><br /></span></div>
<div style="text-align: left;">
The log provided by GlassFish is very clear and confirms all I have learned so far ,and actually prints the name project ProjectEulerAnswer, the culprit for failing deployment and provides the name of a bad Bean (<span style="font-size: x-small;">q11UPBean</span>). </div>
<div style="text-align: left;">
<br /></div>
On the bean q11UPBean, has the following annotations: </div>
<div>
<br /></div>
<div>
/**</div>
<div>
+ <span style="font-size: x-small;">This EJBeuler.jar module is being locally injected from my PorjectEulerAnswers.war Web module</span></div>
<div>
**/</div>
<div>
<div>
<span style="font-size: x-small;">@Stateless</span></div>
<div>
<span style="font-size: x-small;">@LocalBean</span></div>
<div>
<span style="font-size: x-small;">public class q11UPBean extends prop11Gen{</span></div>
</div>
<div>
<span style="font-size: x-small;"><br /></span></div>
<div>
<div>
<span style="font-size: x-small;">@javax.interceptor.Interceptors(LoggingInterceptor.class) //this annotation is from a external module EJBintercept.jar**</span></div>
<div>
<span style="font-size: x-small;"> private Map<String, String[]> walkingleft(String[] lineArray) {</span></div>
</div>
<div>
<span style="font-size: x-small;">//some code here</span></div>
<div>
<span style="font-size: x-small;">}</span></div>
<div>
<span style="font-size: x-small;"><br /></span></div>
<div>
<span style="font-size: x-small;">//some code here</span></div>
<div>
<span style="font-size: x-small;">}</span></div>
<div>
<br /></div>
<div>
As we can notice, it's the usual Stateless local EJB declaration, which we could call EJBeuler, in which should not give any trouble. Then there is an interceptor's annotation, and in this case this Interceptor is living on a different EJB module, we could call EJBintercept. Checking the Libraries on NetBeans and as expected my my EJBeuler does have reference to my EJBintercept, if there weren't it would give me a compile exception.</div>
<div>
<br /></div>
<div>
But accordingly is the ProjectEulerAnswers the one failing, which means the Web Project possible needs the library reference to EJBintercept. Which proven to be true and the solution to my ArrayStoreExcpeiton; Which means that at compile time the container is not capable to check all the second hand annotations references, and throws some Exceptions which is very hard to identify the real issue. </div>
<div>
<br /></div>
<div>
Therefore, when programing with annotation from different modules, we must check if the following example is true: </div>
<div>
<br /></div>
<blockquote class="tr_bq">
<span style="font-size: x-small;">EJBeuler ---- uses compiles Libraries ----> EJBintercep; </span></blockquote>
<blockquote class="tr_bq">
<span style="font-size: x-small;">ProjectEulerAnswers ---- uses compiles Libraries ----> EJBintercep; </span></blockquote>
<blockquote class="tr_bq">
<span style="font-size: x-small;">ProjectEulerAnswers ---- uses compiles Libraries ----> EJBeuler; </span></blockquote>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
<code>
</code></div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-54476889807812957762014-11-27T15:57:00.001-03:002014-11-27T15:57:28.572-03:00Java's parametrize Lambda;<div dir="ltr" style="text-align: left;" trbidi="on">
Lambda is a new feature on the java se - JDK 8; yeat not implemented on the java EE specs. This now tool provides a lot more flexibility for the java programmers to code reuse, but also can generate unnecessary complexity;<br />
<br />
All you really need is an interface with a single method. The annotation @FunctionalInterface (java.lang.annotation.FunctionalInterface - JDK 8), only enforces that the interface must have one and only one abstract method, but you could live without it. To me, is just to tell others programmers not to declare anything else;<br />
<br />
Example:<br />
<div style="text-align: justify;">
<blockquote class="tr_bq">
<i>@FunctionalInterface</i><i>interface Calculator{</i><i> double calculate(int x , int y); </i><i>}</i></blockquote>
</div>
<div style="text-align: justify;">
or<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<blockquote class="tr_bq">
<i>interface Calculator{</i><i> double calculate(int x , int y); </i><i>}</i></blockquote>
</div>
</div>
<div style="text-align: justify;">
Both Works the same, and a consequence it limits other Object Oriented aspect as method overloading; </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<i>Bad Example: </i></div>
<div style="text-align: justify;">
<blockquote class="tr_bq">
<i>interface Calculator{</i><i> double calculate(int x , int y); </i><i> double calculate(Long x , int y); </i><i>}</i></blockquote>
</div>
<div style="text-align: justify;">
Wrapping also seems not to have problems with Lambda expressions:<br />
<br />
<blockquote class="tr_bq">
package lambda.expression;<br />import java.util.ArrayList;<br />import java.util.Iterator;<br />import java.util.List;</blockquote>
<br />
<blockquote class="tr_bq">
//Lambda primitive type<br />@java.lang.FunctionalInterface<br />interface Calculator {<br /> double calculate(long x, int y);<br />}</blockquote>
<br />
<blockquote class="tr_bq">
//lambda generic Object<br />@java.lang.FunctionalInterface<br />interface ObjectImpl<E> {<br /> E doOString(E obj1, E obj2);<br />}</blockquote>
<br />
<blockquote class="tr_bq">
public class Test {<br /> public static void main(String[] argv) {<br /> //This is a very simple example; with declaration type and passing the expression;<br /> Calculator calc = (long x, int y) -> Math.min(x, y);<br /> System.out.printf("%6.2f\n", calc.calculate(255, 7));<br /> <br /> //A little more complex, is the use of collection;<br /> List<Calculator> listCalc = new ArrayList<>();<br /> listCalc.add((x, y) -> x + y);<br /> listCalc.add((x, y) -> x - y);<br /> listCalc.add((x, y) -> x / y);<br /> listCalc.add((x, y) -> x % y);<br /> listCalc.add((x, y) -> Math.hypot(x, y));<br /> Iterator<Calculator> interate = listCalc.iterator();<br /> while (interate.hasNext()) {<br /> Calculator calculator = interate.next();<br /> System.out.printf("%6.2f\n", calculator.calculate(255, 7));<br /> }<br /> //to make your day, Generics is here to add some more complexity;<br /> ObjectImpl<String> objectImpls = (obj1, obj2) -> obj1 + obj2;<br /> String result = objectImpls.doOString("Hello ", "World!!");<br /> System.out.println(result);<br /> //Adding with Integer Object and wrappers;<br /> ObjectImpl<Integer> objectImplsNum = (obj1, obj2) -> obj1 + obj2;<br /> Integer resultint = objectImplsNum.doOString(new Integer(2),3);<br /> System.out.println(resultint);<br /> <br /> }<br />}</blockquote>
</div>
<h4 style="text-align: justify;">
The results: </h4>
<div style="text-align: justify;">
run:<br />
7.00<br />
262.00<br />
248.00<br />
36.00<br />
3.00<br />
255.10<br />
Hello World!!<br />
5<br />
BUILD SUCCESSFUL (total time: 2 seconds)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Lambda like break, continue, label and other features, can turn your code more complex; but its here to stay, and we should understand how it works and use it with precaution; </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
link: <a href="http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#syntax">java.com/se/8</a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
</div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-36788015789967887972013-12-17T14:41:00.000-03:002013-12-17T14:44:20.989-03:00Java Mission Control (jmc) Crashing: SIGSEGV at C [libsoup-2.4.so.1+0x6dab1] soup_session_feature_detac<div class="tr_bq">
I was checking around the new JMC, that comes bundle with the jdk1.7_45; this tool is like a mix of Jrockit Mission Control and jvisualvm. As for now, does not have as many tools as offers the JRMC and the connection is done through JMX, just like you would do while connecting with jvisualvm. </div>
<br />
But, to spoil my fun while running the ./jmc I got :<br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"><br /></span>
<br />
<span style="font-size: x-small;">A fatal error has been detected by the Java Runtime Environment:</span><br />
<div>
<span style="font-size: x-small;">#</span></div>
<div>
<span style="font-size: x-small;"># SIGSEGV (0xb) at pc=0x0000003119a6dab1, pid=9245, tid=140539766241024</span></div>
<div>
<span style="font-size: x-small;">#</span></div>
<div>
<span style="font-size: x-small;"># JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)</span></div>
<div>
<span style="font-size: x-small;"># Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)</span></div>
<div>
<span style="font-size: x-small;"># Problematic frame:</span></div>
<div>
<span style="font-size: x-small;"># C [libsoup-2.4.so.1+0x6dab1] soup_session_feature_detach+0x11</span></div>
<div>
<span style="font-size: x-small;">#</span></div>
<div>
<span style="font-size: x-small;"># Core dump written. Default location: /usr/java/jdk1.7.0_45/bin/core or core.9245</span><br />
<span style="font-size: x-small;"><br /></span>
Yes, its a nice coredump, and with a filedump in which I got the header above. By looking at the filedump, I could check that this .so lib was being use by an or.eclipse.swt.internal.webkit:<br />
<br />
<span style="font-size: x-small;">Stack: [0x00007fd1f6c7f000,0x00007fd1f6d80000], sp=0x00007fd1f6d7cb20, free space=1014kNative frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)C [libsoup-2.4.so.1+0x6dab1] soup_session_feature_detach+0x11<br />Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)j</span><span style="font-size: x-small;"> org.eclipse.swt.internal.webkit.WebKitGTK._soup_session_feature_detach(JJ)V+0j org.eclipse.swt.internal.webkit.WebKitGTK.soup_session_feature_detach(JJ)V+9j org.eclipse.swt.browser.WebKit.create(Lorg/eclipse/swt/widgets/Composite;I)V+920j org.eclipse.swt.browser.Browser.<init>(Lorg/eclipse/swt/widgets/Composite;I)V+81j org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.createPartControl(Lorg/eclipse/swt/widgets/Composite;)V+19j org.eclipse.ui.internal.intro.impl.model.IntroPartPresentation.createPartControl(Lorg/eclipse/swt/widgets/Composite;)V+74j org.eclipse.ui.intro.config.CustomizableIntroPart.createPartControl(Lorg/eclipse/swt/widgets/Composite;)V+64j org.eclipse.ui.internal.ViewIntroAdapterPart.createPartControl(Lorg/eclipse/swt/widgets/Composite;)V+9j org.eclipse.ui.internal.ViewReference.createPartHelper()Lorg/eclipse/ui/IWorkbenchPart;+406j org.eclipse.ui.internal.ViewReference.createPart()Lorg/eclipse/ui/IWorkbenchPart;+5j org.eclipse.ui.internal.WorkbenchPartReference.getPart(Z)Lorg/eclipse/ui/IWorkbenchPart;+65j org.eclipse.ui.internal.Perspective.showView(Ljava/lang/String;Ljava/lang/String;)Lorg/eclipse/ui/IViewPart;+16j org.eclipse.ui.internal.WorkbenchPage.busyShowView(Ljava/lang/String;Ljava/lang/String;I)Lorg/eclipse/ui/IViewPart;+59j org.eclipse.ui.internal.WorkbenchPage$20.run()V+21</span></div>
<div>
<span style="font-size: x-small;"><br /></span>Investigating the issue with eclipse bugs, I came across this <b><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776">Bug 404776</a>; </b>Which nicely provided a simple workaround by just adding two new parameters:<br />
<br />
<blockquote class="tr_bq">
-Dorg.eclipse.swt.browser.DefaultType=mozilla<br />
-Dorg.eclipse.swt.browser.XULRunnerPath=/urs/lib64/xulrunner</blockquote>
The XULRunnerPath should be set to the actual xulrunner on your OS. At this case, mine is a 64bits Fedora 19...<br />
<br />
To Java Mission Control take these parameters, you need to edit the following file:<br />
<br />
<blockquote class="tr_bq">
/usr/java/jdk1.7.0_45/lib/missioncontrol/configuration/config.ini</blockquote>
<br />
Just need to append those two parameters at the end of config.ini file and the Java Mission Control should start without a problem.<br />
<br />
<blockquote class="tr_bq">
#echo org.eclipse.swt.browser.DefaultType=mozilla >> /usr/java/jdk1.7.0_45/lib/missioncontrol/configuration/config.ini</blockquote>
<blockquote class="tr_bq">
#echo org.eclipse.swt.browser.XULRunnerPath=/urs/lib64/xulrunner/ >> /usr/java/jdk1.7.0_45/lib/missioncontrol/configuration/config.ini</blockquote>
<br />
<blockquote class="tr_bq">
# --> root user... </blockquote>
</div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com3tag:blogger.com,1999:blog-1954295644842068612.post-8440321009371438742013-12-13T12:27:00.000-03:002013-12-13T12:27:01.336-03:00Watching and taking Thread Dumps with WLST<style type="text/css">
body
{
font-family: Monospace, monospace;
font-size: 10pt;
}
.style_0
{
color: #000000;
background-color: #ffffff;
}
.style_1
{
color: #d00000;
background-color: #ffffff;
}
.style_2
{
color: #007f00;
background-color: #ffffff;
}
.style_3
{
color: #ff8000;
background-color: #ffffff;
}
.style_4
{
color: #ff8000;
background-color: #ffffff;
}
.style_5
{
color: #00007f;
background-color: #ffffff;
font-weight: bold;
}
.style_9
{
color: #000080;
background-color: #ffffff;
}
.style_10
{
color: #301010;
background-color: #ffffff;
}
.style_11
{
color: #000000;
background-color: #ffffff;
}
.style_14
{
color: #991111;
background-color: #ffffff;
font-weight: bold;
}
.style_32
{
color: #000029;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_33
{
color: #000000;
background-color: #14a33dd8;
font-weight: bold;
font-style: italic;
}
.style_34
{
color: #14a142be;
background-color: #000031;
font-weight: bold;
font-style: italic;
}
.style_35
{
color: #007fff;
background-color: #88d8a530;
font-weight: bold;
font-style: italic;
}
.style_38
{
color: #88d8a6b0;
background-color: #007fff;
}
.style_39
{
color: #000031;
background-color: #23c04f0;
font-style: italic;
}
.style_40
{
color: #a83b343e;
background-color: #000035;
font-weight: bold;
font-style: italic;
}
.style_41
{
color: #007fff;
background-color: #88d8a548;
font-weight: bold;
font-style: italic;
}
.style_42
{
color: #000001;
background-color: #000000;
font-weight: bold;
}
.style_43
{
color: #000000;
background-color: #000004;
font-style: italic;
}
.style_46
{
color: #000000;
background-color: #000000;
}
.style_48
{
color: #000000;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_49
{
color: #000000;
background-color: #000010;
font-style: italic;
}
.style_52
{
color: #000000;
background-color: #000000;
}
.style_54
{
color: #2c61150;
background-color: #000000;
font-weight: bold;
}
.style_56
{
color: #88d8a7ac;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_57
{
color: #000000;
background-color: #000018;
font-weight: bold;
font-style: italic;
}
.style_58
{
color: #88d8a6e0;
background-color: #007fff;
font-weight: bold;
}
.style_60
{
color: #23e0f10;
background-color: #000000;
font-weight: bold;
}
.style_61
{
color: #007fff;
background-color: #000028;
}
.style_62
{
color: #000000;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_63
{
color: #007f9b;
background-color: #00026c;
font-style: italic;
}
.style_64
{
color: #000000;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_66
{
color: #14a142be;
background-color: #000031;
font-weight: bold;
}
.style_67
{
color: #000000;
background-color: #000000;
font-style: italic;
}
.style_68
{
color: #2c61150;
background-color: #000000;
font-weight: bold;
}
.style_70
{
color: #14663a5c;
background-color: #000031;
font-weight: bold;
}
.style_72
{
color: #2cace10;
background-color: #000000;
font-weight: bold;
}
.style_74
{
color: #2cc86a0;
background-color: #000000;
font-weight: bold;
}
.style_75
{
color: #000000;
background-color: #2cc86a0;
font-style: italic;
}
.style_76
{
color: #88d8aa58;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_78
{
color: #a814167c;
background-color: #000035;
}
.style_80
{
color: #000002;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_82
{
color: #88d8a910;
background-color: #007fff;
font-weight: bold;
}
.style_83
{
color: #000000;
background-color: #23e1d80;
font-style: italic;
}
.style_84
{
color: #88d8a910;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_85
{
color: #007fff;
background-color: #2baaad0;
font-style: italic;
}
.style_86
{
color: #2417d70;
background-color: #000000;
font-weight: bold;
}
.style_87
{
color: #000000;
background-color: #88d8a9d0;
font-weight: bold;
font-style: italic;
}
.style_88
{
color: #a83b343e;
background-color: #000035;
font-weight: bold;
font-style: italic;
}
.style_90
{
color: #23e1d80;
background-color: #000000;
font-weight: bold;
}
.style_91
{
color: #000000;
background-color: #2507780;
font-style: italic;
}
.style_92
{
color: #23e2850;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_94
{
color: #14a142be;
background-color: #000031;
font-weight: bold;
font-style: italic;
}
.style_95
{
color: #000000;
background-color: #88d8a9d0;
font-weight: bold;
font-style: italic;
}
.style_100
{
color: #a83b343e;
background-color: #000035;
font-weight: bold;
font-style: italic;
}
.style_102
{
color: #a826eef7;
background-color: #000035;
font-weight: bold;
font-style: italic;
}
.style_103
{
color: #000030;
background-color: #88d8ab40;
font-weight: bold;
font-style: italic;
}
.style_104
{
color: #000000;
background-color: #000000;
}
.style_106
{
color: #2417d70;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_108
{
color: #2b7cb40;
background-color: #000000;
font-weight: bold;
}
.style_110
{
color: #146875c9;
background-color: #000031;
font-weight: bold;
font-style: italic;
}
.style_111
{
color: #000031;
background-color: #88d8aba8;
font-weight: bold;
font-style: italic;
}
.style_112
{
color: #2cb5ac0;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_114
{
color: #a826efc6;
background-color: #000035;
font-weight: bold;
}
.style_115
{
color: #007f9b;
background-color: #2cb5ac0;
font-style: italic;
}
.style_116
{
color: #88d8ac00;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_118
{
color: #a82711f0;
background-color: #000035;
font-weight: bold;
font-style: italic;
}
.style_119
{
color: #000035;
background-color: #2c0bed0;
font-style: italic;
}
.style_120
{
color: #2c0bed0;
background-color: #000000;
font-weight: bold;
}
.style_122
{
color: #000000;
background-color: #000000;
font-weight: bold;
}
.style_123
{
color: #007fff;
background-color: #23baf30;
font-style: italic;
}
.style_124
{
color: #000439;
background-color: #00025a;
font-weight: bold;
font-style: italic;
}
.style_125
{
color: #007fff;
background-color: #2b88e60;
font-style: italic;
}
.style_126
{
color: #000028;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_127
{
color: #000031;
background-color: #2b88e60;
font-style: italic;
}
.style_128
{
color: #23baf30;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_129
{
color: #00025a;
background-color: #000047;
font-weight: bold;
font-style: italic;
}
.style_130
{
color: #88d8acc0;
background-color: #007fff;
font-weight: bold;
}
.style_132
{
color: #000001;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_134
{
color: #146875c9;
background-color: #000031;
font-weight: bold;
}
.style_136
{
color: #a80bd8b0;
background-color: #000035;
font-weight: bold;
font-style: italic;
}
.style_138
{
color: #a8084092;
background-color: #000035;
font-weight: bold;
}
.style_140
{
color: #23e3d90;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_141
{
color: #000000;
background-color: #2b7cb40;
font-style: italic;
}
.style_142
{
color: #88d8aea0;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_143
{
color: #000035;
background-color: #2b05560;
font-style: italic;
}
.style_144
{
color: #000001;
background-color: #000000;
font-weight: bold;
}
.style_146
{
color: #14a0f9a2;
background-color: #000031;
font-weight: bold;
font-style: italic;
}
.style_147
{
color: #000000;
background-color: #40000004;
font-style: italic;
}
.style_148
{
color: #2417d70;
background-color: #000000;
font-weight: bold;
}
.style_149
{
color: #007fff;
background-color: #000014;
font-style: italic;
}
.style_150
{
color: #000001;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_151
{
color: #000031;
background-color: #23e3dc0;
font-style: italic;
}
.style_152
{
color: #23e51a8;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_156
{
color: #88d8aea0;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_158
{
color: #000000;
background-color: #000000;
}
.style_159
{
color: #000000;
background-color: #000029;
font-style: italic;
}
.style_160
{
color: #243a430;
background-color: #000000;
font-weight: bold;
}
.style_162
{
color: #000004;
background-color: #000001;
font-weight: bold;
}
.style_163
{
color: #000031;
background-color: #88d8b020;
font-weight: bold;
font-style: italic;
}
.style_164
{
color: #88d8af50;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_165
{
color: #007fff;
background-color: #14637d49;
font-weight: bold;
font-style: italic;
}
.style_166
{
color: #2c756e0;
background-color: #000000;
}
.style_167
{
color: #000000;
background-color: #000000;
font-style: italic;
}
.style_168
{
color: #000000;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_170
{
color: #88d8af50;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_172
{
color: #2c756e0;
background-color: #000000;
font-weight: bold;
}
.style_174
{
color: #000000;
background-color: #000000;
}
.style_178
{
color: #000001;
background-color: #000001;
font-weight: bold;
}
.style_182
{
color: #000000;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_184
{
color: #2c756e0;
background-color: #000000;
font-weight: bold;
}
.style_185
{
color: #000000;
background-color: #23c04f0;
font-style: italic;
}
.style_186
{
color: #14a28a72;
background-color: #000031;
font-weight: bold;
}
.style_187
{
color: #000030;
background-color: #88d8b1c0;
font-weight: bold;
font-style: italic;
}
.style_190
{
color: #146875c9;
background-color: #000031;
font-weight: bold;
}
.style_192
{
color: #25f3200;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_193
{
color: #007fff;
background-color: #1466340d;
font-weight: bold;
font-style: italic;
}
.style_194
{
color: #000000;
background-color: #000000;
}
.style_198
{
color: #14663983;
background-color: #000031;
}
.style_199
{
color: #000000;
background-color: #25f3200;
font-style: italic;
}
.style_200
{
color: #000050;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_201
{
color: #000000;
background-color: #61a7f0b0;
font-weight: bold;
font-style: italic;
}
.style_206
{
color: #000001;
background-color: #000000;
font-weight: bold;
}
.style_208
{
color: #000120;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_211
{
color: #000000;
background-color: #000000;
font-style: italic;
}
.style_212
{
color: #000002;
background-color: #000000;
font-weight: bold;
}
.style_214
{
color: #2cf0840;
background-color: #000000;
font-weight: bold;
}
.style_218
{
color: #000000;
background-color: #000000;
}
.style_219
{
color: #000031;
background-color: #000002;
font-style: italic;
}
.style_222
{
color: #000000;
background-color: #000001;
font-weight: bold;
}
.style_226
{
color: #98001c80;
background-color: #007f9b;
font-weight: bold;
font-style: italic;
}
.style_227
{
color: #007fff;
background-color: #2b8fa40;
font-style: italic;
}
.style_228
{
color: #2b8fa40;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_229
{
color: #007fff;
background-color: #2ce5370;
font-style: italic;
}
.style_230
{
color: #14636538;
background-color: #000031;
font-weight: bold;
}
.style_231
{
color: #000035;
background-color: #000029;
font-style: italic;
}
.style_232
{
color: #88d8b598;
background-color: #007fff;
font-weight: bold;
font-style: italic;
}
.style_234
{
color: #000029;
background-color: #000000;
font-weight: bold;
}
.style_235
{
color: #000031;
background-color: #2cf0840;
font-style: italic;
}
.style_236
{
color: #00001b;
background-color: #000000;
font-weight: bold;
}
.style_238
{
color: #2cf0840;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_240
{
color: #94001d00;
background-color: #007f9b;
font-weight: bold;
font-style: italic;
}
.style_242
{
color: #000010;
background-color: #000000;
font-weight: bold;
}
.style_243
{
color: #000031;
background-color: #2c8a1e0;
font-style: italic;
}
.style_244
{
color: #88d8b5f4;
background-color: #007fff;
font-weight: bold;
}
.style_246
{
color: #000000;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_247
{
color: #007fff;
background-color: #000000;
font-style: italic;
}
.style_250
{
color: #14635547;
background-color: #000031;
font-weight: bold;
font-style: italic;
}
.style_251
{
color: #000000;
background-color: #000028;
font-style: italic;
}
.style_252
{
color: #25f7530;
background-color: #000000;
font-weight: bold;
font-style: italic;
}
.style_254
{
color: #1462cbd4;
background-color: #000031;
font-weight: bold;
}
</style>
The hanging or looping behaviour trouble shooting can be some troublesome if you do not know how to read this snapshot. Specially if you did not get the snapshot in the correct time and also on the intervals needed to identify and inculpate a specific thread and your respective class stack.<br />
<br />
One of the first steps to investigate is to identify how frequent and how does behave the hanging. Usually we must considered a very broad approach by asking:<br />
<br />
<br />
<ul>
<li>Why do we use this program for?</li>
<li>Does it have a process peak?</li>
</ul>
<br />
<br />
Then we should ask our selves:<br />
<br />
<br />
<ul>
<li>Does the hanging behaviour frequency relate with any of the questions asked previously?</li>
</ul>
<br />
<br />
Hopefully with these questions answered will help us determine when to actually wait to collect data for analysis. Some behaviour can help us identify what actually what we are looking for, if the hanging consumes a lot CPU, means that we are dealing with a possible loop, a while(true) or even recursive methods loop or recursive Architecture with bad handling exceptions loops; If the behaviour is just hanging and not consuming much CPU resources, this means is possible a deadlock or livelock. But some times the frequency and behaviour are very random, thanks to parallelism, that makes even more difficult to collect good useful data.<br />
<br />
To analyse thread dumps if very difficult and we usually need more then just one, I would say that 10 to 20 thread dumps are good amount for investigating and the frequency between thread dumps depends how fast does the contention happens. There are many visual tools such as samurai and TDA that might help in investigating the hanging. But going back to my original mental thread (talking about parallelism ;), is actually to collect the useful data at the right time which holds the key.<br />
<br />
On WLS, I have write a simple WLST/script which does the thread-dumping for me. That way I can spend my time on real useful things like updating my facebook or reading Dilbert strips.<br />
<br />
How does it work:<br />
<br />
1. Select one of the many Managed-Servers, and set the following parameters:<br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
goto: Managed Server:Configuration:Tuning and set </div>
<br />
<br />
<ul><ul>
<li>Stuck Thread Max Time: 15 sec (needs restart)</li>
<li>Stuck Thread Timer Interval: 10 sec (needs restart)</li>
</ul>
</ul>
<br />
<br />
*<span style="font-size: xx-small;">This parameters have different behaviours and can be set as you like, please look for oracle WLS documentation for more details.</span><br />
<br />
2. Set your domain Environment by running setDomainEnv.sh from your <DOMAIN>/bin directory:<br />
<br />
$ . setDomainEnv.sh<br />
<br />
3. Create a python script in which will watch the health of the server:<br />
<br />
<code:><br />
<br />
<span style="font-size: x-small;"><span class="style_5">import </span><span class="style_11">java</span><span class="style_10">.</span><span class="style_11">lang</span><br />
<span class="style_5">import </span><span class="style_11">os</span><br />
<span class="style_5">import </span><span class="style_11">string</span><br />
<span class="style_5">import </span><span class="style_11">time</span><br />
<br />
<span class="style_5">def </span><span class="style_9">serverRuntimeNavegate</span><span class="style_10">():</span><br />
<span class="style_11">serverRuntime</span><span class="style_10">()</span><br />
<span class="style_11">cd</span><span class="style_10">(</span><span class="style_3">"/"</span><span class="style_10">)</span><br />
<span class="style_11">cd</span><span class="style_10">(</span><span class="style_3">"ThreadPoolRuntime/ThreadPoolRuntime"</span><span class="style_10">)</span><br />
<br />
<span class="style_5">def </span><span class="style_9">runtimeNavegate</span><span class="style_10">():</span><br />
<span class="style_11">runtime</span><span class="style_10">()</span><br />
<span class="style_11">cd</span><span class="style_10">(</span><span class="style_3">"/"</span><span class="style_10">)</span><br />
<span class="style_11">cd</span><span class="style_10">(</span><span class="style_3">"JVMRuntime/" </span><span class="style_10">+ </span><span class="style_11">serverName</span><span class="style_10">)</span><br />
<br />
<span class="style_5">def </span><span class="style_9">checkHealthOfServer</span><span class="style_10">(</span><span class="style_11">serverName</span><span class="style_10">):</span><br />
<span class="style_5">print </span><span class="style_4">'Checking : ' </span><span class="style_10">+ </span><span class="style_11">serverName</span><br />
<span class="style_11">os</span><span class="style_10">.</span><span class="style_11">system</span><span class="style_10">(</span><span class="style_3">"echo Starting"</span><span class="style_10">)</span><br />
<span class="style_11">serverRuntimeNavegate</span><span class="style_10">()</span><br />
<span class="style_11">x </span><span class="style_10">= </span><span class="style_2">0</span><br />
<span class="style_5">while </span><span class="style_11">true</span><span class="style_10">: </span><br />
<span class="style_11">state </span><span class="style_10">= </span><span class="style_14">str</span><span class="style_10">(</span><span class="style_11">cmo</span><span class="style_10">.</span><span class="style_11">getHealthState</span><span class="style_10">())</span><br />
<span class="style_11">check </span><span class="style_10">= </span><span class="style_11">string</span><span class="style_10">.</span><span class="style_11">find</span><span class="style_10">(</span><span class="style_11">state</span><span class="style_10">,</span><span class="style_3">"HEALTH_WARN"</span><span class="style_10">)</span><br />
<span class="style_5">if </span><span class="style_11">check </span><span class="style_10">!= -</span><span class="style_2">1</span><span class="style_10">:</span><br />
<span class="style_5">print </span><span class="style_3">"Warning State"</span><br />
<span class="style_11">threadDump</span><span class="style_10">(</span><span class="style_11">writeToFile</span><span class="style_10">=</span><span class="style_3">"true"</span><span class="style_10">,</span><span class="style_11">fileName</span><span class="style_10">= </span><span class="style_3">"ServerDump" </span><span class="style_10">+ </span><span class="style_14">str</span><span class="style_10">(</span><span class="style_11">x</span><span class="style_10">))</span><br />
<span class="style_11">serverRuntimeNavegate</span><span class="style_10">()</span><br />
<span class="style_11">Thread</span><span class="style_10">.</span><span class="style_11">sleep</span><span class="style_10">(</span><span class="style_2">20000</span><span class="style_10">)</span><br />
<span class="style_11">x </span><span class="style_10">+= </span><span class="style_2">1</span><br />
<span class="style_5">else</span><span class="style_10">: </span><br />
<span class="style_5">print </span><span class="style_4">'Its all good...'</span><br />
<span class="style_11">Thread</span><span class="style_10">.</span><span class="style_11">sleep</span><span class="style_10">(</span><span class="style_2">5000</span><span class="style_10">)</span><br />
<br />
<span class="style_11">connect</span><span class="style_10">(</span><span class="style_3">"weblogic"</span><span class="style_10">,</span><span class="style_3">"weblogic1"</span><span class="style_10">,</span><span class="style_3">"localhost:7001"</span><span class="style_10">)</span><br />
<span class="style_11">checkHealthOfServer</span><span class="style_10">(</span><span class="style_11">serverName</span><span class="style_10">)</span></span><br />
<br />
<span style="font-size: x-small;"><span class="style_10"><br /></span></span>
<span class="style_10">4. </span>All you need to do on this script is to change the username, password and server URL:PORT on the connect() command from the script, at the next to last script. Then you can call the WLST to run the script:<br />
<br />
$ java weblogic.WLST <scriptName>.py<br />
<br />
<span class="style_10">Basically this Jython/WLST connects to any server and check on the health, if returns OK, all it prints is a message. Soon as the WLS engine decides that exist a long running thread, the script start taking thread dumps and writes the output on files generated on the same location where you called the script. </span><br />
<br />sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com1tag:blogger.com,1999:blog-1954295644842068612.post-12748001250216075032013-02-13T15:54:00.002-03:002013-02-13T15:54:33.089-03:00Managing The CLASSPATH<script>
function selectOS(name){
if(name == "windows"){
document.write("
<ol>
<li>sdktool -[classpath,cp] class1[;|:]class2<br/>
<small>* ';' is use for Windows, ':' Unix like. sdktool is java, javac, jhat, etc..</small>
</li>
<li>set classpath="class1;class2"</li>
</ol>
")
}
else{
document.write("
<ol>
<li>sdktool -[classpath,cp] class1[;|:]class2<br/>
<small>* ';' is use for Windows, ':' Unix like. sdktool is java, javac, jhat, etc..</small>
</li>
<li>set classpath="class1;class2"</li>
</ol>
")
}
}
</script>
The classpath in java and during Runtime, searches for classes and other zip type resources files to load into JVM memory to make the program run. classpath simply maps locations of classes to be use (load) as needed during application's life cycle; There's different ways of setting a java classpath:<br />
<br />
<ul>
<li>Use the -classpath or -cp to set your classpath;</li>
<li>Use environment commands to set the classpath;</li>
<li>Using the class-path tag, on the application's manifest;</li>
</ul>
<br />
Examples:
<br />
<ol>
<li>sdktool -[classpath,cp] class1[;|:]class2<br />
<small>* ';' is use for Windows, ':' Unix like. sdktool is java, javac, jhat, etc..</small>
</li>
<li>set classpath="class1;class2"</li>
</ol>
<br />
You can only add the following file types '.jar', '.zip' or '.class' into a classpath; Directories or the wildcard '*' can be used to add resources that eventually will be mapped during runtime. Compress files like '.jar' and '.zip' must contains '.class' files, other wise will be ignored.
<br />
While using the wildcard '*', the order of files loaded to the JVM vary from platform to platform and also from moment to moment on the same <b>HW</b> machine. Supposedly a well build application does not actually depend on a particular order, but if needed you must explicitly order files into the classpath. In which reads from left to write, and the first file is the one that will be use in case of similar jars with same full class name.
<br />
Classpath also can be set on the application's Manifest, using the class-path tag, but this tag does not honour the wildcard. While setting directories, java will load files in the order they appear in the path variables;
<br />
<h2>
WLS</h2>
Uses delegation model when loading class, and to improve performance do the following steps:
<br />
<ol>
<li>Checks its class load cache (to improve performance);</li>
<li>While loading, search for the parent class; therefore goes reading from top to bottom on the family tree of the class, in case does not find the parent it does not attempt to load the class;</li>
<li>If both child and parent exist, the parent is loaded first;</li>
</ol>
<br />
Weblogic comes with some feature such as hot-deployment and hot-redeployment. Allows to deploy and changes to newer versions of application module while server is running state, in which helps on avoiding downtime. On the java classloather do not support any standard for hot-deployment nor hot-redeployment; In this case you would need to restart the entire server in case of adding new libs or modifying your application.
<br />
Each application deployed on Weblogic Server has a separate hierarchy of classloaders from the system classloader; Also with the bool prefer-web-inf-classes child of container-descriptor tag on the weblogic.xml allow applications to use different libs, base on versioning details description. This is very useful when installing thirdparty libs or upgrading them, by default this tag is set to false.
<br />
Ex:<br />
<span style="font-size: x-small;"><i><?xml version="1.0" encoding="UTF-8"?></i></span><br />
<br />
<span style="font-size: x-small;"><i><weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"></i></span><br />
<span style="font-size: x-small;"><i> <container-descriptor></i></span><br />
<span style="font-size: x-small;"><i> <prefer-web-inf-classes>true</prefer-web-inf-classes></i></span><br />
<span style="font-size: x-small;"><i> <prefer-application-packages></i></span><br />
<span style="font-size: x-small;"><i> <package-name>javax.faces.*</package-name></i></span><br />
<span style="font-size: x-small;"><i> <package-name>com.sun.faces.*</package-name></i></span><br />
<span style="font-size: x-small;"><i> <package-name>com.bea.faces.*</package-name></i></span><br />
<span style="font-size: x-small;"><i> </prefer-application-packages></i></span><br />
<br />
<span style="font-size: x-small;"><i> <prefer-application-resources></i></span><br />
<span style="font-size: x-small;"><i> <resource-name>javax.faces.*</resource-name></i></span><br />
<span style="font-size: x-small;"><i> <resource-name>com.sun.faces.*</resource-name></i></span><br />
<span style="font-size: x-small;"><i> <resource-name>com.bea.faces.*</resource-name></i></span><br />
<span style="font-size: x-small;"><i> <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name></i></span><br />
<span style="font-size: x-small;"><i> </prefer-application-resources></i></span><br />
<span style="font-size: x-small;"><i> </container-descriptor></i></span><br />
<span style="font-size: x-small;"><i></weblogic-web-app></i></span><br />
<br />
<br />
<small>As you may notice you need to inform which packages or resource to be loaded, therefore we use the list prefer-application-packages and prefer-application-resources tags; There is no need to use both at the same time.</small>
<!--hide>
<h2>
AS7</h2>
By default the modules are independent by default, but some configuration modules are loaded by automatically.
2. The classpath (path on the machine running Node Manager) to use when starting this server. At a minimum you will need to specify the following values for the class path option:g
WL_HOME/server/lib/weblogic_sp.jar;WL_HOME/server/lib/weblogic.jar
where WL_HOME is the directory in which you installed WebLogic Server on the Node Manager machine. The shell environment determines which character you use to separate path elements. On Windows, you typically use a semicolon (;). In a BASH shell, you typically use a colon (:).
3. About Order of JAR files:
The order in which the JAR files in a directory are enumerated in the expanded class path is not specified and may vary from platform to platform and even from moment to moment on the same machine. A well-constructed application should not depend upon any particular order. If a specific order is required then the JAR files can be enumerated explicitly in the class path.
</hide-->
ref:
<br />
<ul>
<li>
<a herf="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html" href="">Java Class Loading</a>
</li>
<li>
<a herf="http://docs.oracle.com/cd/E24329_01/web.1211/e24368/classloading.htm" href="">WLS class Loading</a>
</li>
</ul>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-59614932424428185292013-01-17T12:28:00.000-03:002013-01-17T12:28:19.678-03:00Fatal Error, no space left on device WLSI have been changing linux distros and I've faced with an issue in which is simple to resolve but does not happen very often on Debian's distros. Currently I am using Fedora, to get more experience with RH like OS.<br />
<br />
While building from scratch my environment, installing the WLS for testing purpose I have faced the following FE (Fatal Error, I call it fatality):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-YfBR13Db61o/UPgNYT2fBII/AAAAAAAABBI/L18dRTiuzDo/s1600/Screenshot+from+2013-01-17+10:53:17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="http://3.bp.blogspot.com/-YfBR13Db61o/UPgNYT2fBII/AAAAAAAABBI/L18dRTiuzDo/s320/Screenshot+from+2013-01-17+10:53:17.png" width="320" /></a></div>
<br />
<br />
The fatality is clear text, during extraction there is no more space left; But where???<br />
<br />
To find out on linux, just open an terminal and run the df command.<br />
<br />
$df<br />
<br />
On my bellow screenshot, my /tmp directory is almost full.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-PjULbW0ulLU/UPgNbttAOhI/AAAAAAAABBQ/_Ah35xg1vng/s1600/Screenshot+from+2013-01-17+10:53:49.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="http://4.bp.blogspot.com/-PjULbW0ulLU/UPgNbttAOhI/AAAAAAAABBQ/_Ah35xg1vng/s320/Screenshot+from+2013-01-17+10:53:49.png" width="320" /></a></div>
<br />
<br />
<ul>
<li>As you can see my /tmp is 2G and is 79% full. There is not enough space for a WLS installation which takes a lot tmp space... I believe is about 1.2G of space, and setting a small 2G tmp like I did is a bad business.</li>
</ul>
<ul>
<li>But why did I not have such issue using Debian distro? Well, a friend with more RH experience answered me: <i><span style="font-size: x-small;">"Fedora does not clean tmp directory!!!"</span></i> (Vaaapaaa, in your face response...)</li>
<li>Well, after watching over the tmp I came with a possible theory. OS are not responsible for cleaning up tmp, but the programs that use this directory is, and Debians distro just want to be nice with us. </li>
</ul>
<br />
<br />
I have listed a few commands that might be useful for this type of situation:<br />
<br />
<blockquote class="tr_bq">
1. From the ehow blog I found the following commands in which needs to be run as root: </blockquote>
<blockquote class="tr_bq">
a. finds and delete any file older than 10 days:<br />#find /tmp -mtime +10 |xargs rm -f </blockquote>
<blockquote class="tr_bq">
b. Delete all empty directory from tmp:<br />#find /tmp -type d | xargs rmdir</blockquote>
<br /><blockquote class="tr_bq">
<i><span style="font-size: x-small;">*you can modify this commands to delete needed files, but this is a bad thing because some running programs might be using files from tmp directory; So be advise to be careful with what you delete. </span></i></blockquote>
<div>
<br /></div>
<blockquote class="tr_bq">
2. This is more elegant solution in which there no risk. If you have notice I am running a java command, therefore we will use a java solution for this issue without having to delete any files from tmp directory. </blockquote>
<blockquote class="tr_bq">
a. create a tmp directory at your home user directory: </blockquote>
<blockquote class="tr_bq">
$mkdir tmp<br />$ls<br />/home/"YourUser"/tmp</blockquote>
<div>
<br /></div>
<blockquote class="tr_bq">
b. run the WLS jar installer with the followind java flag: </blockquote>
<blockquote class="tr_bq">
java -Djava.io.tmpdir=/home/"yourUser"/tmp -jar wls1035_generic.jar</blockquote>
<div>
<br />
<br />
Either solution will work but I would rather use the second one; The screen shot taken bellow was when testing the commands from ehow blog.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-5UEneS5_c5k/UPgNfEi1S3I/AAAAAAAABBY/o9ZrQr7LTZE/s1600/Screenshot+from+2013-01-17+10:55:39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="http://1.bp.blogspot.com/-5UEneS5_c5k/UPgNfEi1S3I/AAAAAAAABBY/o9ZrQr7LTZE/s320/Screenshot+from+2013-01-17+10:55:39.png" width="320" /></a></div>
<br />
<br />
<br />
ref: <a href="http://www.ehow.com/how_8452265_clear-tmp-fedora.html" target="_blank">How to Clear TMP in Fedora</a></div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-69608597619777421542012-12-19T11:10:00.000-03:002012-12-19T11:10:22.457-03:00Diagnosable Oracle JDBC 11g DriverThe Oracle's 11g JDBC driver comes with a Self-Diagnosable features in which might help on the diagnose connection issue with the Data Base. Base on java.util.logging framework and javax.management MBean framework, in which follow the Java standard for monitoring and management.<br />
<br />
<ul>
<li>java.util.logging _ Can be configure from providing a simple issue track, such as running out resource, to something more specific and detail tracing on an internal execution of a system. </li>
<li>javax.management _ Can consult and change system's behavior through MBeans, accumulate statistics and notify in states changes on error's behaviors. <div>
<br /></div>
</li>
</ul>
The OJDBC self-diagnose, is not implemented in all the drivers. Actually you might need to go back to Oracles's driver site and <a href="http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html">download</a> the following drivers: <br />
<br />
<ul>
<li>ojdbc5_g.jar </li>
<li>ojdbc6_g.jar</li>
</ul>
<br />
*That's is why they have named these drivers with an *_g.jar at the end.<br />
<br />
1- To enable the tracing you need to add at the java startup argument the following flag:<br />
<br />
<blockquote class="tr_bq">
-Doracle.jdbc.Trace=true</blockquote>
<blockquote class="tr_bq">
<div>
<br /></div>
</blockquote>
This flags enable the global logging, if you want to debug the entire application this' the way to go.<br />
<br />
2- Now we need to add the following flag on the java startup in which gives a path to an configuration file properties:<br />
<br />
<blockquote class="tr_bq">
-Djava.util.logging.config.file=/jdbc/home/JDBCLogging.properties</blockquote>
<blockquote class="tr_bq">
<div>
<br /></div>
</blockquote>
3- Create the file /jdbc/home/JDBCLogging.properties; and set as following:<br />
<br />
<blockquote class="tr_bq">
.level=SEVERE</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.level=INFO</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.handlers=java.util.logging.ConsoleHandler</blockquote>
<blockquote class="tr_bq">
java.util.logging.ConsoleHandler.level=INFO</blockquote>
<blockquote class="tr_bq">
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter</blockquote>
<blockquote class="tr_bq">
<div>
<br /></div>
</blockquote>
This will throw the output into the console, there fore no log file should be created. If you need to actually to produce a physical log you need to set as following:<br />
<br />
<blockquote class="tr_bq">
.level=SEVERE</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.level=INFO</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.handlers=java.util.logging.FileHandler</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.level=INFO</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.pattern=jdbc.log</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.count=1</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter</blockquote>
<blockquote class="tr_bq">
<div>
<br /></div>
</blockquote>
<br />
The amount of details are controlled by choosing bellow values, from less information to most detail information:<br />
<br />
<ul>
<li><div>
OFF</div>
</li>
<li><div>
SEVERE</div>
</li>
<li><div>
WARNING</div>
</li>
<li><div>
INFO</div>
</li>
<li><div>
CONFIG</div>
</li>
<li><div>
FINE</div>
</li>
<li><div>
FINER</div>
</li>
<li><div>
FINEST</div>
</li>
<li><div>
ALL</div>
</li>
</ul>
The 11g's OJDBC also lets you choose which system or part of the driver in which can be debugged; Is a nice thing, because some times you do not need too much information but specific information, and how to do this is controlling the logging level using the following flags:<br />
<br />
<ul>
<li><div>
oracle.jdbc </div>
</li>
<li><div>
oracle.jdbc.driver</div>
</li>
<li><div>
oracle.jdbc.pool</div>
</li>
<li><div>
oracle.jdbc.rowset</div>
</li>
<li><div>
oracle.jdbc.xa</div>
</li>
<li><div>
oracle.sql</div>
</li>
</ul>
*Subject to change by release version.<br />
These flags can be simply add to the /jdbc/home/JDBCLogging.properties like:<br />
<br />
<blockquote class="tr_bq">
.level=SEVERE</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.level=INFO</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.driver.level=ALL *</blockquote>
<blockquote class="tr_bq">
oracle.jdbc.handlers=java.util.logging.FileHandler</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.level=INFO</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.pattern=jdbc.log</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.count=1</blockquote>
<blockquote class="tr_bq">
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter</blockquote>
<br />
<br />
<span style="font-size: x-small;">ref: </span><br />
<br />
<ul>
<li><a href="http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/toc.htm"><span style="font-size: xx-small;">http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/toc.htm</span></a></li>
<li><a href="http://docs.oracle.com/javase/7/docs/api/index.html?javax/management/openmbean/package-summary.html"><span style="font-size: xx-small;">http://docs.oracle.com/javase/7/docs/api/index.html?javax/management/openmbean/package-summary.html</span></a></li>
<li><a href="http://docs.oracle.com/cd/B28359_01/java.111/b31224/toc.htm"><span style="font-size: xx-small;">http://docs.oracle.com/cd/B28359_01/java.111/b31224/toc.htm</span></a></li>
</ul>
<br />
<br />
<br />
<br />
<br />
<br />
<br />sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-18384645787908969872012-12-14T09:54:00.000-03:002012-12-14T09:54:02.568-03:00java.lang.OutOfMemoryError: GC overhead limit exceededThe OOM: "GC overhead limit exceeded", only means that Full GC is doing much work for nothing. Too much time is being spent on Garbage collection while the collection it self recover less than 2% of the heap.<br />
<br />
Accordingly this OOM can only occurs in two different GC algorithm, such as:<br />
<br />
<ul>
<li>Parallel Collection: Parallel's automatic tuning, provide a maximum pause time. </li>
</ul>
<ul>
<li>Concurrent Collection: The concurrent collector pauses an application twice during a concurrent collection cycle.</li>
</ul>
<br />
Only collections in which application is stopped, and is due to concurrency mode failure or explicit collection request. This OOM is to prevent applications to be stopped for a long period of time while collecting on a small heap.<br />
<br />
<br />
Possible Solutions:<br />
<br />
<ul>
<li>Use another GC algorithm;</li>
</ul>
<ul>
<li>Check if your heap is too small to run Parallel or Concurrent GC. If this is the case tune your heap size accordingly;</li>
</ul>
<ul>
<li>Turn off this feature by using: -XX:-UseGCOverheadLimit. This flag replaced the UseGCTimeLimit, in which is referenced on the CR 6287811; </li>
</ul>
<ul>
<li>Try use the -XX:MaxGCPauseMillis=n, in which the GC will try its best to achieve this value. No promises made on this one. </li>
</ul>
<br />
Bug:<br />
The CR 6287811, is about the log output error in which mislead many people in thinking there were an issue with the heap:<br />
<br />
<ul>
<li>before: "java.lang.OutOfMemoryError: Java heap space";<div>
<br /></div>
</li>
<li>now: "java.lang.OutOfMemoryError: GC overhead limit exceeded";<div>
<br /></div>
</li>
</ul>
<br />
Doc:<br />
<br />
<table border="1" cellpadding="1" cellspacing="1" style="background-color: white; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; text-align: start; width: 100%px;"><tbody style="list-style: none; margin: 0px; padding: 0px;">
<tr style="list-style: none; margin: 0px; padding: 0px;" valign="top"><td style="font-family: arial, helvetica, sans-serif; list-style: none; margin: 0px; padding: 0px; vertical-align: top;">-XX:+UseGCOverheadLimit</td><td style="font-family: arial, helvetica, sans-serif; list-style: none; margin: 0px; padding: 0px; vertical-align: top;">Use a policy that limits the proportion of the VM's time that is spent in GC before an OutOfMemory error is thrown. (Introduced in 6.)</td></tr>
</tbody></table>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
ref:</div>
<ul>
<li><div>
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</div>
</li>
<li><div>
http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html</div>
</li>
<li><div>
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6287811</div>
</li>
</ul>
<div>
<br /></div>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-35057135781233222392012-12-13T12:58:00.000-03:002013-01-10T16:16:41.715-03:00Using Wildcard asterisk (*) SSL with WLSSetting the certificates to use the wild card asterisk (*) can be troublesome on the WLS.<br />
<br />
Example of wildcard use:<br />
<br />
cn = *.example.com<br />
<br />
Since WLS 10.3.6 and 12.1.+ has been hard-coded a new host name verifier on the WLS in which with some simple configuration you can use your wildcarded certificates:<br />
<br />
A_ Start WLS with the following java properties:<br />
<br />
./startWebLogic.sh -Dweblogic.security.SSL.HostnameVerifier=weblogic.security.utils.SSLWLSWildcardHostnameVerifier<br />
<br />
or<br />
<br />
B_<br />
<br />
1. Start the AdminConsole and goto selected Server::Configuration::SSL;<br />
<br />
2. Click on the link Advanced;<br />
<br />
3. Copy/paste the weblogic.security.utils.SSLWLSWildcardHostnameVerifier Class name on the Hostname Verifier field;<br />
<br />
4. Save;<br />
<br />
C_ Restart server and test your SSL connection.<br />
<br />
<br />
*For previous version of WLS 10.3.x there's a patch in which, I recommend to open an SR with Oracle to retrieved.<br />
<br />
<br />
Links:<br />
<a href="http://docs.oracle.com/cd/E24329_01/web.1211/e24422/ssl.htm#CHDIEIEE" target="_blank">Using the Wildcarded Host Name Verifier</a><br />
<a href="http://docs.oracle.com/cd/E24329_01/apirefs.1211/e24401/taskhelp/security/ConfigureACustomHostNameVerifier.html#WLACH03008" target="_blank">Configure a custom host name verifier</a><br />
<a href="http://docs.oracle.com/cd/E28389_01/apirefs.1111/e13941/weblogic/security/utils/SSLWLSWildcardHostnameVerifier.html" target="_blank">Oracle WebLogic Server API Reference SSLWLSWildcardHostnameVerifier</a>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com6tag:blogger.com,1999:blog-1954295644842068612.post-89242842205496995952012-10-04T09:26:00.000-03:002012-10-04T09:43:53.741-03:00Testing JavaScript on Blogger <p>
Nice to know that I can play a bit with javaScript on blogger. Even if I have to do things by hand... but that is cool...
</p>
<p>My example in action is bellow:</p>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date()
}
</script>
<h1>testing Script</h1>
<p id="demo">will be date here.</p>
<button type="button" onclick="displayDate()">Display</button>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-64362932440763217382012-10-03T17:06:00.001-03:002012-10-03T17:06:58.391-03:00java.lang.InternalError: Unexpected CryptoAPI failure generating seed<i style="font-size: 10px;"><br />
Throwable: java.lang.InternalError: Unexpected CryptoAPI failure generating seed<br />
Stack Trace:<br />
java.lang.InternalError: Unexpected CryptoAPI failure generating seed<br />
at sun.security.provider.NativeSeedGenerator.getSeedBytes(NativeSeedGenerator.java:43)<br/>
at sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:117)<br />
at sun.security.provider.SecureRandom.engineGenerateSeed(SecureRandom.java:114)<br />
at java.security.SecureRandom.generateSeed(SecureRandom.java:495)<br />
</i>
<p>While generating seed to create random numbers, the exception is being thrown form the method bellow:</p>
<i style="font-size: 10px;">
<pre id="ms1" style="height: auto; overflow: auto; visibility: visible; width: 100%; ">{
// fill array as a side effect
if (nativeGenerateSeed(result) == false) {
// should never happen if constructor check succeeds
throw new InternalError
("Unexpected CryptoAPI failure generating seed");
}
}</pre>
</i>
<p>ref: <a href=http://www.docjar.com/docs/api/sun/security/provider/NativeSeedGenerator.html>
sun.security.provider.NativeSeedGenerator</a>
<br />
<p>To generate random numbers, SSL security code relies upon entropy on a machine. Entropy is activity of the machine,If entropy is minimal or non-existent, then the random number generator will be slow and security operations may time out.</p>
<p>
The class generates seeds for strong cryptographically number generator. It uses two techniques:</p>
<dl>
<dt><b>Computing current system activity:</b></dt>
<dd/>
<dd><b>Default</b>, produced by counting the number of times the VM manages to loop in a perioud of time. Does not reflect machine load, and a number of sleeper threads are generated to add entropy.</dd>
<dt><b>Entropy gathering device:</b></dt>
<dd/>
<dd>Alternative, is to acquire material from entropy gathering device, such as /dev/random. By setting the "securerandom.source" security property of the <java_home>/lib/security/java.security file.</java_home></dd>
</dl>
Use the bellow command that starts the Java process as a possible solution:
<ul>
<li>-Djava.security.egd=file:///dev/urandom</li>
or
<li>-Djava.security.egd=file:/dev/./urandom</li>
</ul>
<dl>
<dt>For further information, see Sun bugs 6202721 and 6521844 at:</dt>
<dd>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6202721</dd>
<dd>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521844</dd>
</dl>
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-30916086496414519772012-10-03T13:31:00.000-03:002012-10-03T13:34:45.556-03:00Using the WebLogic JarBuilder to power java client programs. <span>
<p>This post is a reference in how to export a full jar with all WLS libs. One good reason is to transport WLS proprietary classes into a java client application. That way a full use of WLS's libs.</p>
<p>Usually engineers only copy/paste the weblogic.jar, but the right way to do it, is to use the <b>WebLogic JarBuilder tool</b>, bellow will show you the following:</p>
<ul>
<li>Creating a wlfullclient.jar for JDK 1.6 and 1.7 client applications</li>
<li>Creating a wlfullclient5.jar for JDK 1.5 client applications</li>
</ul>
<dl>
<dt>wlfullclient.jar file since WLS 10.3</dt>
<dd>
<ol>
<li>goto: <b>$</b>cd WL_HOME/server/lib</li>
<li>run: <b>$</b>java -jar wljarbuilder.jar</li>
<li>On the same directory you should see this <b>wlfullclient.jar</b></li>
<li>Copy over to client application's classpath</li>
</ol>
</dd>
<dt>wlfullclient.jar file for WLS 10.0</dt>
<dd>
<ol>
<li>goto: <b>$</b>cd WL_HOME/server/lib</li>
<li>run: <b>$</b>java -jar wljarbuilder.jar -profile wlfullclient5</li>
<li>On the same directory you should see this <b>wlfullclient5.jar</b></li>
<li>Copy over to client application's classpath</li>
</ol>
</dd>
</dl>
<p><i>The <b>WL_HOME</b> reference to wlserver_12.1</i>, as an example. Also keep in mind the WLS start using JDK 1.6 since WLS 10.3</p>
</span>
<p>ref:<a href="http://docs.oracle.com/cd/E14571_01/web.1111/e13717/jarbuilder.htm#BABCGHFH"
style="font-size: 12px;"
>Using the WebLogic JarBuilder Tool</a></p>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-81119134897579394512012-10-03T11:32:00.000-03:002012-10-03T11:32:03.204-03:00Starting Coherence with WLS Console.<span style="background-color: white; font-family: Tahoma; font-size: 13px;">
Easy steps...
</span>
<br />
<ol>
<span style="background-color: white; font-family: Tahoma; font-size: 13px;">
<li>Goto:
<i style="font-size: 10px;">Admin Console::Servers::Coherence Servers::myCoherenceServer::Configuration::Server Start</i>
</li>
<li>Add these two jars to the classpath</li>
<ul>
<li>$MW_HOME/modules/features/weblogic.server.modules.coherence.server_12.1.1.0.jar:$MW_HOME/coherence_3.7/lib/coherence.jar</li>
<li>Replace $MW_HOME by the actual directory path of the Middleware Home</li>
</ul>
<li> Start the Coherence Server from the WLS Admin Console to verify it works fine now. </li>
</span>
</ol>
<br/>
<i>Notice, this example is for WebLogic Server 12.1.1</i>
<br/>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-65064345251525506972012-10-01T16:14:00.001-03:002012-10-01T16:14:17.781-03:00High Availability for WLS, How to Quickly pack/unpack copy the domain for testing.<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">We have a domain in which is in production, and you quickly need a testing domain with the same configuration. Since the production domain is in production, you cannot actually run the risk of messing things up. Therefore I am quickly writing this so it helps you on getting a copy of your domain quickly running for testing; </span><br />
<br />
Navegate to your wls home:<br />
<br />
<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">1. [Middleware]$ cd 1036bin/wlserver_10.3/common/bin/</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">2. [</span><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">bin]$ ls</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">commEnv.sh config_builder.sh config.sh pack.sh setPatchEnv.sh startDerby.sh startManagedWebLogic.sh stopDerby.sh unpack.sh upgrade.sh wlscontrol.sh wlsifconfig.sh wlst.sh</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><br />
Use the pack command to build a template, here I am using the tmp directory:<br />
<br />
<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">3. [bin]$ ./pack.sh -domain=/home/Oracle/Domains/1036bin -template=/tmp/mydomain.jar -template_name="testingBackup"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><< read domain from "/home/Oracle/Domains/1036bin"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">>> succeed: read domain from "/home/Oracle/Domains/1036bin"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><< write template to "/tmp/mydomain.jar"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">....................................................................................................</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">>> succeed: write template to "/tmp/mydomain.jar"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><< close template</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">>> succeed: close template</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">Unpack on a different directory, Actually the newDirectory does not exist the unpack will create one:</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"> </span><br />
<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">4. [bin]$ ./unpack.sh -template=/tmp/mydomain.jar -domain=/home/Oracle/newDirectory</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><< read template from "/tmp/mydomain.jar"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">>> succeed: read template from "/tmp/mydomain.jar"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><< write Domain to "/home/Oracle/newDirectory"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">...............................................................................................</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">>> succeed: write Domain to "/home/Oracle/newDirectory"</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><< close template</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">>> succeed: close template</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" />Goto the newly created newDirctory and start your backup domain:<br />
<br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">5. [ bin]$ cd /home/Oracle/newDirectory</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">6. [newDirectory]$ ls</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">autodeploy bin config console-ext fileRealm.properties fileRealm.properties.bak init-info lib pending security servers startManagedWebLogic_readme.txt startWebLogic.sh tmp</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">6. [ newDirectory]$ ./startWebLogic.sh </span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">.</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">.</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">JAVA Memory arguments: -Xms512m -Xmx512m</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">.</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">WLS Start Mode=Development</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">.</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">.</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;">.</span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><Oct 1, 2012 2:49:47 PM CLT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> </span><br style="font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;" /><span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><Oct 1, 2012 2:49:47 PM CLT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode></span><br />
<span style="background-color: white; font-family: Arial, Helvetica, Geneva, sans-serif; font-size: 11px; white-space: pre-wrap;"><br />
</span> <span style="font-family: Arial, Helvetica, Geneva, sans-serif;"><span style="font-size: 11px; white-space: pre-wrap;">This example was run into the same Linux machine, but if you want to transport this domains to a different machine you may just copy the mydomain.jar into the new machine, install the same WLS version and run the steps from 4 - 6 (While WLS installation you may choose the mydomian.jar as a template). This action is mainly use for extending domain into a remote machine, but also can be use to build testing environments with the same configuration as the production. </span></span>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com2tag:blogger.com,1999:blog-1954295644842068612.post-5834664250362185712012-09-24T12:25:00.002-03:002012-09-24T12:25:18.359-03:00How to set and Start Coherence with WLST <br />
<br />
<br />
Oracle Weblogic Server - Version 10.3.4 to 12.1.1.0<br />
Oracle Coherence - Version 3.6.0 to 3.7.1.x<br />
<br />
Different ways to start Coherence Servers using WLST?<br />
<br />
Pre-requirements:<br />
<br />
Node Manager should be running and please make sure that you have the following jar files on your classpath;<br />
<br />
/home/Oracle/Middleware/121cJar/modules/features/weblogic.server.modules.coherence.server_12.1.1.0.jar:/home/Oracle/Middleware/121cJar/coherence-java-3.7.1.0b27797/coherence/lib/coherence.jar<br />
<br />
Use the following links to create and set the Coherence Servers using the Admin Console:<br />
<br />
http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/taskhelp/coherence/CreateCoherenceServers.html<br />
<br />
http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/taskhelp/coherence/ConfigureStartupArgumentsForCoherenceServers.html<br />
<br />
<br />
Ans1: Using the nmStart():<br />
<br />
1. Start the WLST tool by setting the environmnet from Domain/bin directory:<br />
<br />
$. bin/setDomainEnv.sh (cmd if Windows)<br />
$java weblogic.WLST<br />
<br />
2. Connect With the NM;<br />
<br />
wls:/offline> nmConnect("weblogic","Welcome1","localhost","5556","12cjar","/home/Oracle/Domains/12cjar")<br />
<br />
3. Start the Coherence server in which is named here as Server-0;<br />
<br />
wls:/nm/12cjar> nmStart("Server-0",serverType="Coherence")<br />
<br />
4. The Coherence server should be started:<br />
<br />
Starting server Server-0 ...<br />
Successfully started server Server-0 ...<br />
<br />
<br />
<br />
Ans2: Now let use the CoherenceServerLifeCycleRuntimeMBean to start:<br />
<br />
1. Set the domain environment from your WLS domain and run the following:<br />
<br />
$java weblogic.WLST<br />
<br />
2. Connect with your running AdminServer.<br />
<br />
connect()<br />
<br />
3. goto your domain Runtime.<br />
<br />
domainRuntime()<br />
<br />
4. goto your Coherence MBeam home.<br />
<br />
cd("CoherenceServerLifeCycleRuntimes/Server-0")<br />
<br />
5. and run the server using this command:<br />
<br />
cmo.start()<br />
<br />
The Server should be running by now....<br />
<br />
<br />
<br />
Ans3: Goto the link bellow and you should see the startCoh.py and stopCoh.py, then is the matter of using the following command:<br />
<br />
1. Create the files stopCoh.py and startCoh.py;<br />
<br />
2. Goto bin directory of your domain.<br />
<br />
3. Set your domian environments: $ . setDomainEnv.sh<br />
<br />
4. Go back to the directory in which you created the two py files.<br />
<br />
5. and run for example:<br />
<br />
$java weblogic.WLST startCoh.py<br />
<br />
ref: http://docs.oracle.com/cd/E24329_01/web.1211/e24442/coh_wls.htm#CIHDDAAE<br />
<br />
<br />
<br />
Ans4: The Most common way is to use the Console, for that you can use Oracle's documentation:<br />
<br />
http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/taskhelp/coherence/StartCoherenceServers.html<br />
<br />
sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-92057057400703150382012-08-10T11:06:00.002-04:002012-08-10T11:06:51.910-04:00Node Manager Starting Weblogic Server life cycle explained<br />
Node Manager, is an java instance that ensure high availability of WLS servers with whole server migration and automatic restarting WLS nodes in case of unwanted shutdown. NM uses the ServerMBean, ServerStartMBean, and SSLMBean to set the JAVA_VENDOR, JAVA_HOME, JAVA_OPTIONS, SECURITY_POLICY, CLASSPATH, and ADMIN_URL. Therefore by using the NM to start a managed server does not necessary uses the domain's bin directory startWebLogic.sh or startWebLogic.cmd to start a node.<br />
<br />
This is due because the flag StartScriptEnabled nodemanager.properties file is set to false by default; So this means that all the settings modification done, such as adding debug flags or adding a new jar on the classpath, on startWeblogic.sh will not be pick up or better saying will not be provided to the JVM.<br />
<br />
So solve this unpleasant situation you can just go to wlserver_10.3/common/nodemanager directory and edit the nodemanager.properties as following:<br />
<br />
StartScriptEnabled=true<br />
<br />
Also, you need to pay attention on another configuration on the same file; The StartScriptName actually tells the NM which script should be use to start the WLS node. By default it uses the startWebLogic.sh, but you can create a new file in the domain's bin directory with all needed start-up configurations;<br />
<br />
StartScriptName=startWebLogicModified.sh<br />
<br />
Understand the some situations you are using the NM to start the WLS nodes without knowing; Sometimes this process seems to be unseeing by administrators. Bellow is the list of situations in which you may be using NM to start servers:<br />
<br />
Admin Console - You need to have the NM running to start any instance.<br />
<br />
WLST -<br />
<blockquote class="tr_bq">
1. When you use the following WLST's commands:<br />start NM:<br /><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; text-align: left;">offline> </code><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; font-weight: bold; text-align: left;">startNodeManager()</code><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; font-weight: bold; text-align: left;"><br /></code><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; font-weight: bold; text-align: left;"><code class="cCode" style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Connect: </code></code><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; font-weight: bold; text-align: left;"><code class="cCode" style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">offline></code><code class="cCodeBold" style="font-family: 'Courier New', Courier, monospace;">nmConnect('username','password','nmHost','nmPort','domainName','domainDir','nmType') </code></code><span style="background-color: white; text-align: left;"><br /></span><span style="background-color: white; text-align: left;">Start Server</span><code class="cCodeBold"><code class="cCodeBold"><span style="font-family: 'Courier New', Courier, monospace;"><span style="background-color: white; font-size: 14px; text-align: left;"><b>: </b></span></span></code></code><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; font-weight: bold; text-align: left;"><code class="cCodeBold" style="font-family: 'Courier New', Courier, monospace;"><code class="cCode" style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wls:/nm/mydomain></code></code><code class="cCodeBold" style="font-family: 'Courier New', Courier, monospace;">nmStart('AdminServer')</code></code><span style="font-family: 'Courier New', Courier, monospace;"><span style="font-size: 14px;"><b><br /></b></span></span>Stop Server:<br /><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px;">wls:/nm/mydomain</code><span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px;">></span><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px; font-weight: bold;">nmKill('serverName')</code></blockquote>
<br />
<blockquote class="tr_bq">
<br />2. When you use the WLST to connect to the AdminServer, therefore is just like when you use the Admin Console:<br />Connecting with AdminServer:<br /><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; text-align: left;">(offline)> </code><code class="cCodeBold" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; font-weight: bold; text-align: left;">connect('username','password')</code><br />Then you can start by using single server name or cluster:<br />wls:/mydomain/serverConfig><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: left;">start('</code><code class="cCodeEmphasis" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px; font-style: italic; text-align: left;">managedServerName</code><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: left;">','Server')</code><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span><span style="text-align: -webkit-auto;">wls:/mydomain/serverConfig></span><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px;">start('</code><code class="cCodeEmphasis" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px; font-style: italic;">clusterName</code><code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px;">', 'Cluster')</code></blockquote>
<div>
<div style="text-align: left;">
<code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px;"><br /></code></div>
<div style="text-align: left;">
<code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px;">Pay attention that some basic rules must be follow, for NM to start a server:</code></div>
<div style="text-align: left;">
<code class="cCode" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 13px;"><br /></code></div>
1. Any particular server mus be assign to the NM; Do not go around setting partially the cluster to start with NM and hope that all the servers will start. </div>
<div>
<br /></div>
<div>
2. Is one NM per physical machine; WLS has the great feature of extend a domain across physicals machines, so I insist again remember to assign the WLS nodes to the particular NM located on the same physical machine. </div>
<div>
<br /></div>
<div>
3. Remember that NM by default uses the ServerStartMBean to set the environment, so if you have edited the startWebLogic.sh the JVM will not pick up the changes. Unless, as explained, you modify these<br />StartScriptEnabled and StartScriptName accordingly with your requirements on the nodemanager.properties file.<br />
</div>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-84436891555003524522012-08-09T22:38:00.000-04:002012-08-09T22:43:17.556-04:00How to Install OpenJDK on UbuntuA. To install the OpenJDK on ubuntu is very easy and one shot deal. First you need to search for the JDK version. First open a terminal and run the following command:<br />
<br />
$ sudo apt-cache search openjdk-<br />
<br />
This should give you some choices like:<br />
<br />
<br />
openjdk-6-doc - OpenJDK Development Kit (JDK) documentation<br />
openjdk-6-jdk - OpenJDK Development Kit (JDK)<br />
openjdk-6-jre - OpenJDK Java runtime, using Hotspot JIT<br />
<div>
and </div>
<div>
<div>
openjdk-7-doc - OpenJDK Development Kit (JDK) documentation</div>
<div>
openjdk-7-jdk - OpenJDK Development Kit (JDK)</div>
</div>
<div>
<div>
openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT</div>
</div>
<div>
<br /></div>
<div>
many others packages should appear. </div>
<div>
<br /></div>
<div>
OR</div>
<div>
<br /></div>
<div>
you can just type in the following command: </div>
<div>
<br /></div>
<div>
$ sudo apt-get install openjdk- </div>
<div>
<br /></div>
<div>
and tab twice!</div>
<div>
<br /></div>
<div>
B. To install the OpenJDK now you can run the following command and similar to the one above: </div>
<div>
<br /></div>
<div>
$ sudo apt-get install openjdk-6-jdk</div>
<div>
<br /></div>
<div>
Just follow the screen instructions and that's it. </div>
<div>
<br /></div>
<div>
C. In case you installed both OpenJDK-6 and OpenJDK-7, you can simple switch between both by using this command. </div>
<div>
<br /></div>
<div>
$ sudo update-alternatives --config java</div>
<div>
<br /></div>
<div>
Then you should see this: </div>
<div>
</div>
<div>
<div>
There are 2 choices for the alternative java (providing /usr/bin/java).</div>
<div>
<br /></div>
<div>
Selection Path Priority Status</div>
<div>
------------------------------------------------------------</div>
<div>
0 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 auto mode</div>
<div>
1 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 manual mode</div>
<div>
* 2 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode</div>
<div>
<br /></div>
<div>
Press enter to keep the current choice[*], or type selection number: </div>
</div>
<div>
<br /></div>
<div>
I have selected 2 to set the OpenJDK-7 as the default java. </div>
<div>
<br /></div>
<div>
D. In case you want to set any program java home to the non-default, in my case OpenJDK-6. You can just provide the path: /usr/lib/jvm/java-6-openjdk-i386 </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-57318981509718126362012-08-09T22:09:00.000-04:002012-08-09T22:09:01.201-04:00What about Service Guardian on CoherenceService Guardian is basically a stuck thread watch dog for Coherence cluster, which consist in sent heartbeats from owned created Coherence's thread; In case a thread from a specific node fails to respond the heartbeat some time-out flags are triggers, for corrective action to be taken.<br />
<br />
The time-out recoveries works like:<br />
<br />
Soft time-out _ Coh. attempts to interrupt the thread before the Hard time-out is reached. If successful normal Processing resumes.<br />
<br />
<br />
<pre class="oac_no_warn" style="background-color: white; font-size: 11px;" xml:space="preserve"><Error> (thread=DistributedCache, member=1): Attempting recovery (due to soft
timeout) of Daemon{Thread="Thread[WriteBehindThread:CacheStoreWrapper(com.
tangosol.examples.rwbm.TimeoutTest),5,WriteBehindThread:CacheStoreWrapper(com.
tangosol.examples.rwbm.TimeoutTest)]", State=Running}</pre>
<pre class="oac_no_warn" style="background-color: white; font-size: 11px;" xml:space="preserve">
</pre>
<br />
Possible some network delay or latency<span style="font-family: monospace;"><span style="font-size: 11px;">.</span></span>305000 milliseconds is the default value, and there is no action required, unless you frequently see this log output. Which means that you might need watch your network traffic and do some tuning. Also you may change the default value to better fit your necessities.<br />
<br />
Hard Time-out _ after the set timing, this case the default 305000 milliseconds is reached Coh. now tries to stop the thread. <br />
<br />
<br />
<pre class="oac_no_warn" style="background-color: white; font-size: 11px;" xml:space="preserve"><Error> (thread=DistributedCache, member=1): Terminating guarded execution (due
to hard timeout) of Daemon{Thread="Thread[WriteBehindThread:CacheStoreWrapper
(com.tangosol.examples.rwbm.TimeoutTest),5,WriteBehindThread:CacheStoreWrapper
(com.tangosol.examples.rwbm.TimeoutTest)]", State=Running}</pre>
<pre class="oac_no_warn" style="background-color: white; font-size: 11px;" xml:space="preserve">
</pre>
The Coh. thread is not behaving as expected, possible doing some investigation by thread dumps might help identify the issue. But first you need to identify which node in which should take thread dumps. From the log above it gives you hints like "thread=DistributedCache, member=1", the thread is DetributedCache and the member is 1. <br />
<br />
305000 milliseconds, if I'm not mistaking should be about 5 minutes. There fore running about 15 thread dumps, each 30 seconds should help analyse, in this case why the DistributedCache is taking too long. Do not disregard network traffic, some issues can be resolve by using Coh.'s Unicast and Coh. WKA. <br />
<br />
Settings for Unicast:<br />
<br />
<br />
-Dtangosol.coherence.localhost=192.168.0.1<br />
-Dtangosol.coherence.localport=8090<br />
-Dtangosol.coherence.localport.adjust=true<br />
<br />
<br />
Settings for Well Known Addresses:<br />
<br />
-Dtangosol.coherence.wka=192.168.0.100<br />
-Dtangosol.coherence.wka.port=8088<br />
<div>
<br /></div>
<br />
<div>
<br /></div>
<div>
Lastly _ The dead end, after all fails you are done for it... Naahhhh!!! At this point Coh. actually tries to follow policies like:</div>
<div>
<span style="background-color: white; font-family: Tahoma, sans-serif; font-size: x-small;"><br /></span></div>
<div>
<ul>
<li>Shutting down the cluster service: </li>
</ul>
<blockquote class="tr_bq">
The faulty node stop all its cluster communication on an attempt to reset all the distribution services. Depending on your logging level and size of cluster, this could be a pain. </blockquote>
<ul>
<li>Shutting down the JVM:</li>
</ul>
<blockquote class="tr_bq">
I am not really experience with this behaviour, but one thing is for sure, we would know which node is the cupid; I understand that WLS's Node Manager can start Coh. cache servers, and also that Node Manager can restart WLS servers... hummm... But I am not sure if the Node Manager, but any ways bellow is some interesting links. </blockquote>
<br />
<blockquote class="tr_bq">
Start Coh. Servers from the WLS's Admin Console:<br /><a href="http://docs.oracle.com/cd/E28271_01/apirefs.1111/e13952/taskhelp/coherence/StartCoherenceServers.html">http://docs.oracle.com/cd/E28271_01/apirefs.1111/e13952/taskhelp/coherence/StartCoherenceServers.html</a><br />How NM restart Managed Servers:<br /><a href="http://docs.oracle.com/cd/E23943_01/web.1111/e13740/overview.htm#i1074986">http://docs.oracle.com/cd/E23943_01/web.1111/e13740/overview.htm#i1074986</a></blockquote>
<div>
</div>
<ul>
<li>Performing a custom action:</li>
</ul>
</div>
<br />
<blockquote class="tr_bq">
<br />This option means that you have known situations in which Coherence threads might take longer than expected or would like to have more control on this feature by controlling its behaviour. But is preferable that you follow the Coh.'s documentation for this settings.<br />ref: <a href="http://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_guardian.htm">http://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_guardian.htm</a></blockquote>
<br />
Just known that Service Guardian is a new feature on Coherence, which was introduce on the 3.5 version. This service is reaching some good maturity on Coh. 3.7.1.xx, therefore upgrading to the latest version of Coherence is a must to avoid defects. One last thing, in case you just do not want to go so deep into this feature you can always disable or even raise the time-out value:<br />
<br />
Shut-down Guardian:<br />
<blockquote class="tr_bq">
-Dtangosol.coherence.guard.timeout=0</blockquote>
Raise time-out in milliseconds: <br /><blockquote class="tr_bq">
-Dtangosol.coherence.guard.timeout=700000</blockquote>
Hard coding time-out:<br />
<blockquote class="tr_bq">
import<br /> <a href="http://docs.oracle.com/cd/E24290_01/coh.371/e22843/toc.htm">com.tangosol.net.GuardSupport</a> <br />set heartbeat<br />GuardSupport.heartbeat();</blockquote>
<blockquote class="tr_bq">
known long running operation<br />GuardSupport.heartbeat(long cMillis);</blockquote>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-58857801677468338982012-08-06T11:57:00.002-04:002012-08-06T11:57:20.204-04:00Weblogic Server Thread pool, from my view.<br />
<div>
Weblogic Server has two different way of handling Thread pools: </div>
<div>
<br clear="none" /></div>
<div>
<span style="color: red;"><strong>Weblogic 8.1 Thread Pool Model</strong></span>: </div>
<div>
<br clear="none" /></div>
<div>
The process was performed in multiple execute queues. Different types of work were handle in different queue, basing on priority and ordering requirements to avoid dead lock. The tuning on this model is very manual and dependent on the administrator analyses and configuration to get some real performance. The control of thread was basically changing the number of threads in the default queue, or configure custom execute queues to a particular applications to have access to a fixed number of execute thread. Oracle /BEA recommends migrating to Work Manager. </div>
<div>
<br clear="none" /></div>
<div>
<strong>How to enable</strong></div>
<div>
<br clear="none" /></div>
<div>
- The configuration to use the 8.1 is not trivial as configuring from console; As mentioned above the recommendation is to use the Work Manager, since this style is very prone to human bad tune configuration. I mean, system resources changes constantly just by adding a new program or changing parameters, maybe a good tune on a system and a small change happens you could face some performance degradation. </div>
<div>
<br clear="none" /></div>
<div>
1. Shut down the WLS's java instance. </div>
<div>
2. Edit the config.xml, by adding the use use81-style-execute-queues element to true. </div>
<div>
3. Start a new WLS's java instance. </div>
<div>
4. Explicitly create the weblogic.kernel.Default execute queue from the Console.</div>
<div>
5. Reboot the WLS's server java instance. </div>
<div>
<br clear="none" /></div>
<div>
<pre xml:space="preserve"><server>
<name>YourServer</pre>
<sub>n</sub><pre xml:space="preserve"></name>
<ssl>
<name>myserver</name>
<enabled>true</enabled>
<listen-port>7002</listen-port>
</ssl>
<use81-style-execute-queues>true</use81-style-execute-queues>
<listen-address/>
</server></pre>
</div>
<div>
<br clear="none" /></div>
<div style="margin-left: 30px;">
*You might need to do the same steps for each server. </div>
<div>
<br clear="none" /></div>
<div>
<strong>Tuning </strong></div>
<div>
<br clear="none" /></div>
<div>
The ThreadCount of the element ExecuteQueue set in the config.xml equals the number of simultaneous operations that can be performed by an application assign to the execute queue. Threads consume resources, and having too many as consequence can have a lot physical resources unnecessary use for unnecessary work. Therefore could decrease performance of the application as for the entire system. </div>
<div>
<br clear="none" /></div>
<div>
The ThreadCount can be different depending in what type of Mode that you start the WLS: </div>
<div>
<br clear="none" /></div>
<div>
<em>Development:</em> Mainly use to load test and development environment, this could mean that WLS can have more I/Os and other types of issues while using this mode. This mode is mainly to stress the application container it self and the default number of thread is <span style="text-decoration: underline;"><em>15</em></span>. </div>
<div>
<br clear="none" /></div>
<div>
<em>Production:</em> As named this mode should be use for production. Changes are not on the fly, and usually the application server needs some extra steps, lock edit is one of the example; This mode is for performance, and passing on the stress to the environment system and the default value of thread is <span style="text-decoration: underline;"><em>25</em></span>. </div>
<div>
<br clear="none" /></div>
<div style="margin-left: 30px;">
*Some cases, depending on large cluster and configuration, just by changing the mode on the WLS from Development to Production you can face some performance degradation on your environment. Simple math, with default 8.1 configuration: </div>
<div style="margin-left: 30px;">
</div>
<div style="margin-left: 60px;">
10 instances of Development mode, equals to 150 threads to share the system resources. </div>
<div style="margin-left: 60px;">
10 instances of Production mode, equals to 250 threads to share the system resources. </div>
<div>
<br clear="none" /></div>
<div>
Simple tuning of thread could resolve this issue; I would disregard having the Porduction mode being remove from an production environment. Check some scenarios for Modifying the default thread count: </div>
<div>
<br clear="none" /></div>
<div>
(You need to understand the nature of your business, some applications has a pick time of usage at the end of every month; example: banking, after you getting your salary).</div>
<div>
<br clear="none" /></div>
<div>
Thread Count < numbers of CPUs :</div>
<ul>
<li>Behavior _ CPUs are not being fully use on a pick time, but there is some work to be done.</li>
<li>Possible Action _ Increase the thread count. </li>
</ul>
<div>
<br clear="none" /></div>
<div>
Thread Count == number of CPUs: </div>
<ul>
<li>Behavior _ CPUs are not being fully use on a pick time, but there is some work to be done.</li>
<li>Possible Action _ Increase the thread count. </li>
</ul>
<div>
<br clear="none" /></div>
<div>
Thread Count > number of CPUs (by a moderate number of threads)</div>
<div>
<ul>
<li>Behavior _ CPUs are being fully use on a pick time, with a moderate amount of context switching.</li>
<li>Possible Action _ Tune the thread count, and test performance. </li>
</ul>
</div>
<div>
<br clear="none" /></div>
<div>
Thread Count > number of CPUs (by a large number of threads)</div>
<div>
<ul>
<li>Behavior _ CPUs are being fully use on a pick time, with many context switching.</li>
<li>Possible Action _ Reduce the number of threads. (remember my example of Modes above...)</li>
</ul>
</div>
<div>
<br clear="none" /></div>
<div>
<br clear="none" /></div>
<div>
<br clear="none" /></div>
<div>
<span style="color: red;"><strong>Work Manager</strong></span>: </div>
<div>
<br clear="none" /></div>
<div>
Is a single thread pool, where all types of work are executed. The tuning of an Work Manager is by demand, in which means that it happens automatically. Queue monitors the throughput base on history and determines the adjust of thread count. The work is base on defined rules, runtime metrics (history) to avoid deadlocks. This the WLS passes it on some of the tuning responsibility from the administrators to it self. </div>
<div>
<br clear="none" /></div>
<div>
Administrator can manage work by configuring some types of scheduling guideline by defining some components: </div>
<div>
<br clear="none" /></div>
<div>
<ul>
<li>Fair Share Request Class<br />
Specifies the average time required to process a request. Default is 50. (This is base on percentage, therefore timing also will depend on the environment physical capacity to process).</li>
<li>Response Time Request Class<br />
Is the response time goal in milliseconds. Not applied to individual request. </li>
<li>Min Threads Constrains<br />
The guarantee number of threads the server will allocate. Default is Zero. </li>
<li>Max Threads Constraint<br />
Limit the number of concurrent threads. Default is unlimited, -1. </li>
<li>Capacity Constraint<br />
Forces the server to reject request when reached its capacity, either individual or global capacity is exceeded it will reject requests. The default is unlimited, -1. </li>
<li>Context Request Class</li>
</ul>
<div style="margin-left: 30px;">
Assigns request classes depending on context information. </div>
WLS works as best effort, this means will no guarantee that configured ratio will be maintained. Its behavior can possible change depending on demand.<br />
<br />
ref: <a href="http://docs.oracle.com/cd/E21764_01/web.1111/e13814/appb_queues.htm" id="" shape="rect" target="_blank">http://docs.oracle.com/cd/E21764_01/web.1111/e13814/appb_queues.htm</a><br />
ref: <a href="http://docs.oracle.com/cd/E24329_01/web.1211/e24432/self_tuned.htm#i1068066" id="" shape="rect" target="_blank">http://docs.oracle.com/cd/E24329_01/web.1211/e24432/self_tuned.htm#i1068066</a><br />
<br />
Important: This information is based on my personal understanding of Oracle's documentation. Please refer to Oracle's documentation for further information and tuning. Remember that you as an administrator is responsible for the best tuning of your own environment. Simple word, use your gut instincts! if you have some problem with this please read the article written by Leon Watson from MailOnline:<br />
<div style="text-align: center;">
"Researches say our first thought is often our best" </div>
ref: <a href="http://www.dailymail.co.uk/news/article-2031848/Why-right-trust-gut-instincts-Scientists-discover-decision-IS-right-one.html" id="" shape="rect" target="_blank">http://www.dailymail.co.uk/news/article-2031848/Why-right-trust-gut-instincts-Scientists-discover-decision-IS-right-one.html</a></div>sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com0tag:blogger.com,1999:blog-1954295644842068612.post-54455659161933431362012-08-02T13:23:00.006-04:002012-08-02T13:38:14.699-04:00Weblogic's console slowness performance issue.<br />
I have notice that after installing the latest WLS with the latest JDK 1.7 on a redhat base 64 bit linux, the Admin Console is taking a long time to show on browser. The Admin server it self starts fine, but when I provide the username and password then I would have to wait for about 3 - 4 minutes to have access.<br />
<br />
Here is my system config:<br />
<br />
WLS 12.1.1<br />
JDK 1.7.0_5<br />
redhat linux based x86_64<br />
<br />
Since this strange behavior actually happens during authentication and authorization of my user/password, this must be related with some security performance issue. From my past experience, I learned that the linux OS's /dev/random and /dev/urandom should have some effect on this behavior. Please, check wikipedia for further knowledge on ramdom and urandom.<br />
<br />
whit some googling, I came across many links in which talks about starting performance by adding the following command while starting the AdminServer:<br />
<br />
$./startWeblogic.sh -Djava.security.egd=file:/dev/./urandom<br />
<br />
This did the trick, and then I found a open java bug <span style="background-color: white; font-family: Arial, Helvetica, FreeSans, Luxi-sans, 'Nimbus Sans L', sans-serif; font-size: 12px; text-align: -webkit-left;">6202721 in which was closed as "not a java bug"... </span><br />
<span style="background-color: white; font-family: Arial, Helvetica, FreeSans, Luxi-sans, 'Nimbus Sans L', sans-serif; font-size: 12px; text-align: -webkit-left;"><br /></span><br />
<span style="background-color: white; font-family: Arial, Helvetica, FreeSans, Luxi-sans, 'Nimbus Sans L', sans-serif; font-size: 12px; text-align: -webkit-left;">The other definitive way to change on all the servers starting on the same JDK you can just edit the java.security file: </span><br />
<br />
#cat /usr/java/jdk1.7.0_05/jre/lib/security/java.security|grep "urandom"<br />
<div>
<div>
# On Solaris and Linux systems, if file:/dev/urandom is specified and it</div>
<div>
# This "NativePRNG" reads random bytes directly from /dev/urandom.</div>
<div>
# On Windows systems, the URLs file:/dev/random and file:/dev/urandom</div>
<div>
securerandom.source=file:/dev/urandom</div>
<div>
# -Djava.security.egd=file:/dev/urandom</div>
</div>
<div>
<br /></div>
<div>
<b>vi </b>the java.security file and change</div>
<div>
from: </div>
<div>
securerandom.source=file:/dev/urandom</div>
<div>
<br /></div>
<div>
to: </div>
<div>
securerandom.source=file:/dev/./urandom</div>
<div>
<br /></div>
<div>
hopefully works for you. </div>
<div>
<br /></div>
<br />sottamhttp://www.blogger.com/profile/17372212433969501930noreply@blogger.com1