I am having a problem writing from javascript to my application database (not mirth's internal database) using Mirth 1.3.2.
The database I am using is derby 10.2.2.0. I am using it in a client-server mode. [I also modified derby's configuration files so that derby's internal database is also client-server].
Writing to this database using the Mirth-provided Database Writer mechanism is not a problem. However, when I try to connect to the database from inside a transformer javascript step, I get an error message.
Here is the segment of the script dealing with the connection:
And this is the error message:
I have also seen error messages indicating the connection string was "MYDB;shutdown=true". I don't know how the connection string is getting the shutdown command appended.
Derby documentation indicates that an exception is thrown whenever the shutdown command is issued.
The same javascript was working with the same Derby database on mirth 1.2.0.
Thanks for your help.
Aziz
The database I am using is derby 10.2.2.0. I am using it in a client-server mode. [I also modified derby's configuration files so that derby's internal database is also client-server].
Writing to this database using the Mirth-provided Database Writer mechanism is not a problem. However, when I try to connect to the database from inside a transformer javascript step, I get an error message.
Here is the segment of the script dealing with the connection:
Code:
var driver = "org.apache.derby.jdbc.ClientDriver"; var address = "jdbc:derby://localhost:1527/MYDB"; var username = "auser"; var password = "lucky"; var dbConn = DatabaseConnectionFactory.createDatabaseConnection(driver, address, username, password);
Code:
ERROR 2007-01-26 12:33:32,203 [2a14c267-f6bb-4d51-8e4e-a57d43453f42_destination_1_connector.dispatcher.1] org.mule.provi ders.jdbc.JdbcMessageDispatcher: Error at tranformerorg.mule.umo.transformer.TransformerException: Wrapped java.sql.SQLE xception: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'MYDB' shutdown. (69d09efa-7c81-4238-be75-2 a2fb987f23c#17) (org.mozilla.javascript.WrappedException) ERROR 2007-01-26 12:33:32,218 [2a14c267-f6bb-4d51-8e4e-a57d43453f42_destination_1_connector.dispatcher.1] org.mule.impl. DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: 2a14c267-f6bb-4d51-8e4e-a57d43453f42: org .mule.umo.transformer.TransformerException: Wrapped java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006 , SQLERRMC: Database 'MYDB' shutdown. (69d09efa-7c81-4238-be75-2a2fb987f23c#17) (org.mozilla.javascript.WrappedExceptio n) org.mule.umo.transformer.TransformerException: Wrapped java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08 006, SQLERRMC: Database 'MYDB' shutdown. (69d09efa-7c81-4238-be75-2a2fb987f23c#17) (org.mozilla.javascript.WrappedExcep tion) at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.evaluateInboundTransformerScript(JavaScript Transformer.java:275) at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.doTransform(JavaScriptTransformer.java:170) at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:197) at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:251) at org.mule.providers.jdbc.JdbcMessageDispatcher.doDispatch(JdbcMessageDispatcher.java:80) at org.mule.providers.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:257) 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(Unknown Source) Caused by: org.mozilla.javascript.WrappedException: Wrapped java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTAT E: 08006, SQLERRMC: Database 'MYDB' shutdown. (69d09efa-7c81-4238-be75-2a2fb987f23c#17) at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1693) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:157) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201) at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:84) at org.mozilla.javascript.gen.c22._c2(69d09efa-7c81-4238-be75-2a2fb987f23c:17) at org.mozilla.javascript.gen.c22.call(69d09efa-7c81-4238-be75-2a2fb987f23c) at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:106) at org.mozilla.javascript.gen.c22._c0(69d09efa-7c81-4238-be75-2a2fb987f23c:77) at org.mozilla.javascript.gen.c22.call(69d09efa-7c81-4238-be75-2a2fb987f23c) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755) at org.mozilla.javascript.gen.c22.call(69d09efa-7c81-4238-be75-2a2fb987f23c) at org.mozilla.javascript.gen.c22.exec(69d09efa-7c81-4238-be75-2a2fb987f23c) at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.evaluateInboundTransformerScript(JavaScript Transformer.java:253) ... 9 more Caused by: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'MYDB' shutdown. at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.webreach.mirth.server.util.DatabaseConnection.<init>(DatabaseConnection.java:64) at com.webreach.mirth.server.util.DatabaseConnectionFactory.createDatabaseConnection(DatabaseConnectionFactory.j ava:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142) ... 21 more Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'MYDB' shutdown. at org.apache.derby.client.am.Connection.completeSqlca(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source) at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source) at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source) at org.apache.derby.client.net.NetConnection.flowUSRIDPWDconnect(Unknown Source) at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source) at org.apache.derby.client.net.NetConnection.<init>(Unknown Source) at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl.newNetConnection(Unknown Source) ... 31 more
Derby documentation indicates that an exception is thrown whenever the shutdown command is issued.
The same javascript was working with the same Derby database on mirth 1.2.0.
Thanks for your help.
Aziz
Comment