Codedrop™ Weblog

Drop’n some code and other tech tidbits…
  • Home
  • Google Shared
  • About Me
  • Reference Links
Rss feed Subscribe

How to address TIBCO (Send HTTP Request) SSL Certificate Problems

May.28, 2010 in Tibco Comments Off

Integrating a TIBCO service with a 3rd Party REST api utilizing the “Send HTTP Request” palette option and receiving the following error?..

iaik.security.ssl.SSLException: Server certificate rejected by ChainVerifier
at iaik.security.ssl.f.f(Unknown Source)
at iaik.security.ssl.f.d(Unknown Source)
at iaik.security.ssl.e.c(Unknown Source)
at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
at iaik.security.ssl.SSLTransport.a(Unknown Source)
at iaik.security.ssl.SSLTransport.renegotiate(Unknown Source)
at iaik.security.ssl.SSLSocket.renegotiate(Unknown Source)
at com.tibco.security.ssl.super.O0OO.doHandshake(SSLClientImpl.java:322)
at ...


Normally I was able to use a browser to export each level of the certificate hierarchy to the BW_GLOBAL_TRUSTED_CA_STORE and have everything function fine.  For some reason, the new integration didn’t present all required certification levels via the browser.  I think the underlying reason may have been the use of a self signed certificate in the certificate chain.

Verify return code: 19 (self signed certificate in certificate chain)

To get around this, I was able to use the following openssl command to identify the required certs and manually copied and pasted each certification to a new file in the BW_GLOBAL_TRUSTED_CA_STORE.  After that, running the service through designer worked just fine.

openssl s_client -showcerts -connect www.foobar.com:443

Post to Twitter Tweet This Post

Tags: SSL, Tibco

Grails and Oracle XMLDB (XMLType)

Apr.30, 2010 in Grails, Oracle Comments Off

Trying to integrate support for Oracle XMLDB in a grails app didn’t turn out to be as straightforward as you might think.  By putting the xmlparserv2.jar file in the $GRAILS_HOME/lib folder I was suddenly presented with SAX parse errors…

Luckily I stumbled across this post by Graeme Rocher who had a similar problem and identified how to resolve it…

Essentially to solve the problem, you need to make sure that library is only picked up at runtime, and not compile time.   You need to put the xmlparserv2.jar on the system classpath instead of the lib directory.

1) When running standalone from grails command line:
 grails -cp lib/runtime/xmlparserv2.jar run-app or modifying the CLASSPATH environment variable

2) When running from within a container, add the .jar to the lib folder
(ie: $TOMCAT_HOME/lib)

Another possible solution is documented here.

Post to Twitter Tweet This Post

Getting ‘YYYYMMDDhhmmss’ date format in a MS Windows script… yuck!

Mar.04, 2010 in General Comments Off

I had the painful experience of recently having to update some windows .bat scripts with some new functionality…. I’ve pleasantly re-affirmed why I DON’T WORK ON A WINDOWS PLATFORM!…

In any event, for any of you poor suckers that do and need access to datetime components within a batch, here’s an ugly solution… If you know of a better way.. I’m all ears!

echo %DATE% %TIME% > datefile.txt
REM parse Datefile (format mon MM-DD-YYYY (US date and time setting default))
For /F "tokens=2,3,4 delims=/ " %%a in (datefile.txt) do (set CurrentMonth=%%a&& set currentDate=%%b&& set /A currentYear=%%c)
For /F "tokens=3,4,5 delims=: " %%a in (datefile.txt) do (set CurrentHour=%%a&& set currentMinute=%%b&& set currentSecond=%%c)
echo Timstamp is: %CurrentYear%%CurrentMonth%%CurrentDate%%CurrentHour%%CurrentMinute%%CurrentSecond%

God help us all thats fugly!

Post to Twitter Tweet This Post

Tags: DOS, Windows

Mysql, Rmagick on Snow Leopard, Homebrew to the rescue!

Feb.27, 2010 in General Comments Off

Well after sitting on my install disks for a few months I finally figured I better upgrade my primary MacBook Pro. As expected, my rails projects and several other things did not function…. Rmagick and MySql were borked as well..

After spending several nights reinstalling Xcode, updating my macports, trying to compile from src to no avail I had someone recommend Homebrew to me. At first I figured.. meh.. another package manager that won’t work… suprisingly.. it did!.. Macports is garbage in comparison.. so to get to the good stuff.. here’s the steps to take if you find yourself in this situation!

1) Best to start clean.. first thing was to wipe the macports installs.


sudo port -f uninstall installed

sudo rm -rf /opt/local \
/Applications/MacPorts \
/Applications/DarwinPorts \
/Library/Tcl/macports1.0 \
/Library/Tcl/darwinports1.0 \
/Library/LaunchDaemons/org.macports.* \
/Library/StartupItems/DarwinPortsStartup \
/Library/Receipts/MacPorts*.pkg \
/Library/Receipts/DarwinPorts*.pkg \
~/.macports

2) Download and install the latest XCode development tools.. your DVD is probably out of date. Ensure that the optional components for command line development are installed (“Unix Development” in the Xcode 3.x installer). Also include the X11 items.

3) Rebooted and hold down ‘6′ and ‘4′ keys to switch to 64 bit mode… (by default snow leopard boots in 32 bit mode.. you can check this in the System Profiler).

4) Install homebrew
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz –strip 1 -C /usr/local
brew install git

5) Install mysql
brew install mysql
export ARCHFLAGS=”-arch i386 -arch x86_64″
gem install mysql — –with-mysql-dir=/usr/local \
–with-mysql-config=/usr/local/bin/mysql_config

6) Install imagemagick
brew install imagemagick

and finally:

7) sudo gem install rmagick

Post to Twitter Tweet This Post

Tags: Mac, MacPorts

Use your DNS-323 for Time Machine backups.

Jan.12, 2010 in Mac OSX Comments Off

If you don’t want to have to fork over the $$ to buy a time capsule want to make use of your existing DNS-323 hardware for backing up your Mac, here’s the steps to take.

1) Modify system preferences by executing this line in a terminal.

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

This will allow you to select the DNS as a backup device when you configure Time Machine.

2) You need to manually create a disk image that Time Machine can understand. The naming convention of this image is key. The name consists of the computers name and mac address of the local eno device without colons. (_.sparsebundle). Easiest way to find out the proper name is to attempt a backup after completing step 1 above. While this is attempting to run, use finder to browse the Volume (Volume_1 in my case) and write down the name of the file its trying to create. The filename will contain .tmp before the .sparebundle. Drop this from the filename and you have the complete name you need to use.

ie: gataca_0021413a0cce.tmp.sparsebundle -> gataca_0021413a0cce.sparsebundle

Open disk utility and create a new disk image on your local drive (you cannot create the image directly on the NFS drive) with the following options:

Format: Spare Bundle Disk Image
Partiions: No Partition Map
Encryption: None
Format: Mac OSX Extended Partition (Journaled)
Size – Maximum Size.. I choose Custom 250GB

After the image is created… manually copy it over to the root of your NFS volume.

3) Kick off the time machine backup and voila!

Now.. be prepared for the caveats of this solution mentioned here.

Post to Twitter Tweet This Post

Tags: DNS-323, Time Machine

SelectorGadget makes identifying page elements a breeze!

Jan.11, 2010 in Programming Comments Off

A recent railscast pointed me at a handy tool that has helped tremendously in speeding up my UI development efforts.  In past, I would use FireBug to highlight items on a page and identify the associated id / class.  This worked ok, but did not aid in narrowing down my selector in the efficient mannter this one does.  You can easily select/deselect fields on your page and dynamically generate your css selector.  Very cool!.. I encourage you to check it out!

Introducing SelectorGadget: point and click CSS selectors

Post to Twitter Tweet This Post

Tags: CSS, UI

Add some color to your Capistrano scripts

Nov.27, 2009 in Rails Comments Off

The beauty of ruby makes it simple to add some colorful syntax highlighting to log messages that are displayed in your capistrano scripts.  Here’s a chunk of code I added to my utility.rb file that is included by my capfile that performs the magic.


def colorize(text, color_code)
"#{color_code}#{text}\033[0m"
end


def red(text); colorize(text, "\033[31m"); end
def boldred(text); colorize(text, "\033[1;31m"); end
def green(text); colorize(text, "\033[32m"); end
def boldgreen(text); colorize(text, "\033[1;32m"); end
def yellow(text); colorize(text, "\033[33m"); end
def boldyellow(text); colorize(text, "\033[1;33m"); end
def blue(text); colorize(text, "\033[34m"); end
def boldblue(text); colorize(text, "\033[1;34m"); end
def purple(text); colorize(text, "\033[35m"); end
def boldpurple(text); colorize(text, "\033[1;35m"); end
def cyan(text); colorize(text, "\033[36m"); end
def boldcyan(text); colorize(text, "\033[1;36m"); end
def white(text); colorize(text, "\033[37m"); end
def boldwhite(text); colorize(text, "\033[1;37m"); end


def inform(text); green(text); end
def highlight(text); boldgreen(text); end
def warning(text); yellow(text); end
def alert(text); red(text); end
def section(text); "\n\n#{"*" * 50}\n#{text}\n#{"*" * 50}";

Now by utilizing the wrapper methods like this:

task :testconfig do
logoutputDir = Logging.initialize("#{$deployDir}/logs", $envNameName, $envNameNum)
Logging.info inform("*" * 75)
Logging.info inform(" Starting... ")
Logging.info " Env: " + highlight('development')
Logging.info " Date: " + highlight(Time.now.to_s)
Logging.info " User: " + highlight('jsmith')
Logging.info " Logs Dir: " + highlight('/tmp/projectX/log')
Logging.info inform("*" * 75)
Logging.info inform(".. informational message ...")
Logging.info warning(".. warning message ...")
Logging.info alert(".. alert message ...")
Logging.info highlight(".. highlighted message ..")
Logging.info inform("*" * 75)
Logging.info inform(" Done! ")
Logging.info " Date: " + highlight(Time.now.to_s)
Logging.info " Dist: " + highlight('/tmp/projectX/dist')
Logging.info inform("*" * 75)
end

You'll get pretty output like this:

Sample console output

Sample console output

Post to Twitter Tweet This Post

Main Problems with TIBCO Designer

Nov.23, 2009 in Tibco Comments Off

After having utilizing TIBCO’s Designer product for a number of months, several blaring deficiencies come to mind.. .here’s a list of my top complaints.  I expect I’ll be adding to this list as I continue to discover new ‘features’ within the product.

  1. Unable to open 2 versions of the same project at the same time.  Unless you rename the tibco project, designer does not let you open two version of the same project.
  2. Internal editor for java sources is like trying to write a java program in notepad.  Why not allow it to link to an external editor?
  3. No Subversion (svn) support.  Has perforce and cvs but no svn?.. get with the times already
  4. Service deployments (.ear) files on a linux environment consume the max amount of memory allotted.. (approx 512mb per .ear).  This makes a SOA architecture hard to achieve if end up having to bundle services into a single .ear due to hardware constraints… imagine 60 services with this overhead.
  5. Generated files do not present themselves in a standard order.  Often if you resave a project the xml will be re-ordered, thus triggering your source control tool to think there is an uncommitted change even if there isn’t one.
  6. When defining a process archive designer prevents you from adding multiple process starters.  Strangely if you add them all at once instead of one by one this is ok.  This could be the scenario when you have a service with multiple processes that listen on different queues.  Why designer isn’t consistent I don’t know..  stop assuming to ‘know’ what I’m trying to do!
  7. (UPDATED 26-Jul-2010) Parse Data activity does not handle reading a csv input with embedded  double quotes.   Typically CSV files identify these values by surrouding entire column contents in “, and any embedded quotes are doubled up..  This is actually what the Parse Data documentation prodivded by TIBCO states.  Unfortunately it doesn’t work that way.

For example:

1, Bob, Sanders, “Height 5′4″”, Weight: 153lbs”, 100, “NSW, Victoria”

Would not parse correctly as the 5′4″ text would signify the end of the column and “, Weight: 153lbs would end up as the next value.  After talking with TIBCO support, apparently this is a known issue (BW-7947) and will be resolved in BW6. Geez, thanks.

Now I realize no software of this nature is foolproof, but really, some of these things are pretty basic.  I think these guys need to stepup their QA when your selling to major enterpises who utilize the stuff in mission critical areas.

Post to Twitter Tweet This Post

Tags: Tibco

Capistrano Callbacks

Nov.18, 2009 in Build Automation, Rails Comments Off

Neat way to pre-initalize something in capistrano before a task is run

on :start do
verifyParametersAndInitialize()
end

callback options:

  1. :before, triggered before a task is invoked
  2. :after, triggered after a task is invoked
  3. :start, triggered before a top-level task is invoked via the command-line
  4. :finish, triggered when a top-level task completes
  5. :load, triggered after all recipes have loaded
  6. :exit, triggered after all tasks have completed

Post to Twitter Tweet This Post

Tags: Capistrano

Automate your non-rails db migrations with Capistrano and AutoPatch

Nov.10, 2009 in Build Automation, Databases Comments Off

After working in a rails environment for the past year I found it terribly difficult to go back to traditional database deployment / upgrade practices.

Migrations are a beautiful way to properly version, co-ordinate and apply the changes you need to your various database environments.  I never knew of a way to do this in a non-rails environment, until now. Step in AutoPatch.

Some alternatives to AutoPatch exist such as migrate4j and Liquibase. Each with their own flavor of how to tackle the problem. AutoPatch was the winner for me as you don’t have to write your migrations in some custom DSL (xml in the case of Liquibase, or java for migrate4j). Our existing .sql scripts worked just fine!

Our shop is currently using Capistrano for deployments. Blending Autopatch with Capistrano was relatively straightforward. Below are two sample tasks that can be added to facilitate AutoPatch’s cmd line info and migrate calls.

desc "Display database migration levels."
task :dbinfo do
cmdAPClasspath = "#{deployDir}/applications/database/lib/oracle/ojdbc14_g.jar" \
+ ":#{deployDir}/dist/prepare/database" \
+ ":#{deployDir}/lib/java/tk-autopatch-1.2-b-cvs.jar" \
+ ":#{deployDir}/lib/java/log4j-1.2.8.jar" \
+ ":#{deployDir}/lib/java/commons-logging-1.0.3.jar" \
+ ":#{deployDir}/lib/java/commons-collections-3.2.1.jar" \
+ ":#{deployDir}/lib/java/commons-lang-2.2.jar" \
+ ":#{deployDir}/lib/java/tk-util-1.1.2.jar"
cmdAPPatchInfo = "java -cp #{cmdAPClasspath} " \
+ "com.tacitknowledge.util.migration.jdbc.MigrationInformation
#{systemName}"
system(cmdAPPatchInfo)
end

desc "Apply database migrations."
task :dbmigrate do
cmdAPClasspath = "#{deployDir}/applications/database/lib/oracle/ojdbc14_g.jar" \
+ ":#{deployDir}/dist/prepare/database" \
+ ":#{deployDir}/lib/java/tk-autopatch-1.2-b-cvs.jar" \
+ ":#{deployDir}/lib/java/log4j-1.2.8.jar" \
+ ":#{deployDir}/lib/java/commons-logging-1.0.3.jar" \
+ ":#{deployDir}/lib/java/commons-collections-3.2.1.jar" \
+ ":#{deployDir}/lib/java/commons-lang-2.2.jar" \
+ ":#{deployDir}/lib/java/tk-util-1.1.2.jar"
cmdAPPatchInfo = "java -cp #{cmdAPClasspath} " \
+ "com.tacitknowledge.util.migration.jdbc.StandaloneMigrationLauncher #{systemName}"
system(cmdAPPatchInfo)
end

Post to Twitter Tweet This Post

Tags: Migrations
« previous entries  
Next Page »
  • Tag Cloud

    Blackberry Capistrano certificate Configuration CSS DNS-323 DOS Dreamhost EMS Fedora firebug GMail Google Grails Groovy ie Java jQuery JSF Linux Mac Mac OSX MacPorts Memory Migrations Oracle PERL Rails Ruby Safari SOAP WebService Spring SSL Tibco Time Machine toolbar Trac UI video sony m2ts vlc VMWare Windows XMLDB

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

  • Blogroll

    • A List Apart
    • Anassina
    • Just Be Kuz
    • Mashable
    • Poker Dreams Online
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Calendar

    September 2010
    M T W T F S S
    « May    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  
  • Categories

    • Databases (5)
      • Oracle (4)
    • Dreamhost (1)
    • General (25)
    • Google (1)
    • Mobile (1)
    • OS (17)
      • Linux (11)
      • Mac OSX (5)
      • Windows (2)
    • Programming (26)
      • Build Automation (3)
      • Grails (1)
      • Java (8)
      • JBoss (1)
      • jQuery (1)
      • JSF (1)
      • MySQL (1)
      • PERL (1)
      • Rails (4)
      • Ruby (3)
    • Security (1)
    • Spring (1)
    • Tibco (4)
  • Recent Posts

    • How to address TIBCO (Send HTTP Request) SSL Certificate Problems
    • Grails and Oracle XMLDB (XMLType)
    • Getting ‘YYYYMMDDhhmmss’ date format in a MS Windows script… yuck!
    • Mysql, Rmagick on Snow Leopard, Homebrew to the rescue!
    • Use your DNS-323 for Time Machine backups.


Green Web Hosting! This site hosted by DreamHost.

© 2007 Codedrop™ Weblog - SafiTech Theme

Full RSS - Comments RSS

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.