web stats
Null Pointer Exception - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2010, 07:57 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default 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?
Reply With Quote
  #2  
Old 09-21-2010, 11:06 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default

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

result = dbConn.executeCachedQuery(strSQL)
Reply With Quote
Reply

Tags
null pointer exception, sql server

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:59 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation