Generate the server keystore and export the servers key
keytool -genkey -alias alias -keystore app.keystore
Export the cert and convert for the client app
keytool -export -alias alias -keystore app.keystore -file exported-der.crt
openssl x509 -out exporter-pem.crt -outform pem -in exported-der.crt -inform der
Generate the client cert
keytool -genkey -alias clientCert -keystore client.keystore
keytool -export -alias clientcert -keystore client.keystore -file exported-client-der.crt
Import the client cert into the servers truststore
keytool -import -alias clientCert -keystore app.truststore -file exported-client-der.crt
For non java apps extract the clients private key using Portecle to make it available to the app
Add the servers key to the clients truststore e.g. keytool -import........
Thursday, April 7, 2011
Friday, March 4, 2011
Sort requests using response times from apache access logs
cat apache_access.log | awk '/Mar/ {print $1,$6,$7,$10}'|sort -k4 -n
Tuesday, February 22, 2011
Classloading isolation in SOA-P
Add the file jboss-classloading.xml to the META-INF directory with the following contents
<classloading xmlns="urn:jboss:classloading:1.0"
domain="IsolatedDomain"
parent-first="false"
import-all="true"
export-all="NON_EMPTY"/>
<classloading xmlns="urn:jboss:classloading:1.0"
domain="IsolatedDomain"
parent-first="false"
import-all="true"
export-all="NON_EMPTY"/>
Thursday, February 17, 2011
Handling tab delimited fields in Smooks
The separator field is passed as unicode
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<csv:reader fields="GenbankAccessionNumber_Nucleotide,GenbankAccessionNumber_Protein1,Protein_CR1,GenbankAccessionNumber_Protein2,Protein_CR2" separator="	"/>
</smooks-resource-list>
Sample Twiddle scripts
To get the active session count for your own app.
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.web:type=Manager,path=/jmx-console,host=localhost activeSessions
To retrieve the thread queue size
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:service=ThreadPool QueueSize
To retrieve active thread counts
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo ActiveThreadCount
To retrieve the amount of free memory
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo FreeMemory
To get all processing stats from the HTTP acceptor on JBoss
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.web:type=GlobalRequestProcessor,name=http-127.0.0.1-8080
Invoke a thread dump
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 invoke jboss.system:type=ServerInfo listThreadDump
Invoke a listing of CPU utilization
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 invoke jboss.system:type=ServerInfo listThreadCpuUtilization
Total System memory
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo TotalMemory
Active Thread Count
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo ActiveThreadCount
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.web:type=Manager,path=/jmx-console,host=localhost activeSessions
To retrieve the thread queue size
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:service=ThreadPool QueueSize
To retrieve active thread counts
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo ActiveThreadCount
To retrieve the amount of free memory
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo FreeMemory
To get all processing stats from the HTTP acceptor on JBoss
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.web:type=GlobalRequestProcessor,name=http-127.0.0.1-8080
Invoke a thread dump
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 invoke jboss.system:type=ServerInfo listThreadDump
Invoke a listing of CPU utilization
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 invoke jboss.system:type=ServerInfo listThreadCpuUtilization
Total System memory
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo TotalMemory
Active Thread Count
./twiddle.sh --user=admin --password=admin --server=127.0.0.1 get jboss.system:type=ServerInfo ActiveThreadCount
Retrieving ESB exceptions into jBPM
When integrating ESB and jBPM it is possible to take an different jBPM transition in the case that the ESB service throws an exception.
When a ESB service throws an exception, the action pipeline returns the exception details in the Fault section of the message and also in the message Body. As of SOA-P 5.0.2 there is no way by which the contents of the Fault section can be passed back to the invoking jBPM process. However it is possible to retrieve the exception fault code, reason and throwable fields from the ESB message body. The key is to wrap the fields using the single quote character [']
For example
When a ESB service throws an exception, the action pipeline returns the exception details in the Fault section of the message and also in the message Body. As of SOA-P 5.0.2 there is no way by which the contents of the Fault section can be passed back to the invoking jBPM process. However it is possible to retrieve the exception fault code, reason and throwable fields from the ESB message body. The key is to wrap the fields using the single quote character [']
For example
<node name="node1"> <action name="ShipItAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler"> <esbCategoryName>TestSVC</esbCategoryName> <esbServiceName>Svc2</esbServiceName> <bpmToEsbVars> <mapping bpm="theBody" esb="BODY_CONTENT" /> </bpmToEsbVars> <esbToBpmVars> <mapping esb="BODY_CONTENT" bpm="theBody" /> <mapping esb="body.'org.jboss.soa.esb.message.fault.code'" bpm="faultCode" default="" /> <mapping esb="body.'org.jboss.soa.esb.message.fault.throwable'" bpm="faultThrowable" default="" /> <mapping esb="body.'org.jboss.soa.esb.message.fault.reason'" bpm="faultReason" default="" /> </esbToBpmVars> <exceptionTransition>exceptionNOC</exceptionTransition> </action> <transition to="end-state1"></transition> <transition to="ExceptionNode" name="exceptionNOC"></transition> </node>
Subscribe to:
Posts (Atom)