Announcement

Collapse
No announcement yet.

Null Pointer Exception

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Null Pointer Exception

    Hi;

    I've written a post processor script to clean up a database table.

    I get the following error when I run a message through:

    Code:
    [2010-09-21 11:47:43,309]  ERROR (com.webreach.mirth.server.util.JavaScriptUtil:107): Error executing postprocessor script.
    java.lang.NullPointerException
    	at com.webreach.mirth.server.util.JavaScriptUtil.getSourceCode(JavaScriptUtil.java:263)
    	at com.webreach.mirth.server.util.JavaScriptUtil.executeScript(JavaScriptUtil.java:152)
    	at com.webreach.mirth.server.util.JavaScriptUtil.executeScript(JavaScriptUtil.java:105)
    	at com.webreach.mirth.server.mule.transformers.JavaScriptPostprocessor.doPostProcess(JavaScriptPostprocessor.java:16)
    	at com.webreach.mirth.server.mule.transformers.JavaScriptPostprocessor.doPostProcess(JavaScriptPostprocessor.java:36)
    	at com.webreach.mirth.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:209)
    	at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108)
    	at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:90)
    	at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
    	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:619)
    Here's the code. I think its failing on the first line as it doesn't hit the logger.error statement.

    Code:
    // This script executes once after a message has been processed
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sqlserver://192.168.20.30:1433/InterfaceTracking', 'InterfaceTracking','InterfaceTracking');
    logger.error("TEST AWARE ADT_Post Processor:  chntimestamp value = " + chntimestamp);	
    var strSQL = "Delete From dbo.TempLocate where TLTime > (chntimestamp + 800)";
    
    dbConn.execute(strSQL);
    
    dbConn.close
    
    
    return;
    When I run the query from SQL Analyzer it runs fine.

    Can anyone help?
    I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
    http://www.linkedin.com/pub/david-rothbauer/5/923/518
    codeismydrug.wordpress.com
    hl7coders.wordpress.com

    Test all my code suggestions prior to implementation

  • #2
    Well, I completely spaced on this one...a sure sign I'm having a bad day..

    result = dbConn.executeCachedQuery(strSQL)
    I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
    http://www.linkedin.com/pub/david-rothbauer/5/923/518
    codeismydrug.wordpress.com
    hl7coders.wordpress.com

    Test all my code suggestions prior to implementation

    Comment

    Working...
    X