Wednesday, May 30, 2012

/apps/test/script/test_script.sh: bad substitution Error while running script through Cron Job

I was getting the following error while running the shell script through Cron Job..

/apps/test/script/test_script.sh: bad substitution

I was using bash when running this script manually. But while scheduling this script in a cron job a different shell (K shell) was being used. I put the following as first line of my script and it worked fine:

Solution:

#!/bin/bash



Friday, May 25, 2012

org.apache.axis2.AxisFault: Missing wsse:Security header in request

Issue : org.apache.axis2.AxisFault: Missing wsse:Security header in request

951> <BEA-000000> <2012-05-24 12:09:31.949 AM <id 15> <[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> [SEVERE] org.apache.axis2.engine.AxisEngine receive : Missing
wsse:Security header in request
org.apache.axis2.AxisFault: Missing wsse:Security header in request
        at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:186)
        at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:99)
        at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
        at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
        at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)



Try putting a security Header in your Soap Request:

<soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-32950583" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>testuser</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">testpassword</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>


Monday, May 21, 2012

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock'

Issue connecting to Mysql.

mysqld_safe mysqld from pid file /usr/local/mysql-5.5.15-osx10.6-x86_64/data/sanjay-ingoles-MacBook-Pro.local.pid ended

/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!


Resolution :

sudo /usr/local/mysql/bin/mysqld stop

Then
     shell> cd /usr/local/mysql
     shell> sudo ./bin/mysqld_safe

Then

/usr/local/mysql/bin/mysql -u username -p database