Share

ebXML Message Service Handler

File Release Notes and Changelog

Release Name: hermes_ebms2_r0931

Notes: Version 0.9.1.0 =============== - First tagged release. Version 0.9.1.1 =============== - Modified API Documentation - Changed to use Academic Free License - Supports reset of database connection pool Version 0.9.1.2 =============== - Bugs fixed: logger now reads log location correctly from properties file - Added several test cases to automate simple unit tests - Added authentication between request and msh server - Used hash named directory to store persistent files - Added database reference to index which message has been delivered - Added mechanism for msh server to store received messages to a specific directory in local file system Version 0.9.1.3 =============== - Rewrote database handling methods by encapsulating the DDL in one class - Bug fixed: Reset database connection pool - Bug fixed: When receiving end application quits and restarts, the backlogged messages are delivered correctly - Bug fixed: Error messages are delivered to application correctly - Bug fixed: Acknowledgment using SMTP protocol now works - Bug fixed: Sending threads and database will now be guaranteed in sync even when MSH is in stress Version 0.9.1.4 =============== - Supported rebuilding of content type of the Mime message even when some mail servers mistakenly modified that header for the incoming email messages - Added support of SMTP authentication for sending out messages - Added SOAP Action header in transport protocol header - Supported message order semantics - Bug fixed: now we support persistent storage to error messages as well - Bug fixed: now we can handle loop back messages Version 0.9.2.0 =============== Configuration: - Bug fixed: no more NullPointerException when fail to authenticate the command object due to missing specification of user name/password in client side - Modified the MSH properties file to demonstrate correct settings. The message repository and the objectstore directories cannot have a parent-child relationship. Operation: - Supported transaction locking of a message based on its message ID - Added an optional feature: positive acknowledgment to MSH client if the message is successfully sent to the destination - Added a system feature: clean halt, which will stop all sending and receiving processes, and the MSH client will receive error messages as if the messages are not sent successfully - Added a system feature: backup and restore of MSH states and repository - Extended the Request API and make it more user-friendly. Now each function is accessed by individual methods, not anymore by a common method with different command codes. - Added a system feature: to query the message status - Retry time is now calculated according to absolute time. So the retry time will be correct even if the MSH is halted between retries. - Added a system feature: now we can delete a message in the queue if it has not been sent successfully - Added a system feature: archiving the repository of MSH - Restructured logging - GUI in MSH Monitor updated to demonstrate the new features - Bug fixed: NullPointerException when an error message is received from the other MSH (e.g. TimeToLive expired) that needs to be forwarded to the user. It was previously caused by the "null" value of mshConnection variable in onMessage() function when an error message is received. - Added user interface to add TimeToLive to the message. - Added detail message status that includes information in SentMessage and ReceivedMessage table. - Changed the UI placement of the text field "Time to Live". - Implements "getTrustedRepository()" API. Now it can get trusted repository locatons from the MSH directly. - Fixed the bug that the sending threads are not restarted after resuming MSH from halt state. - Fixes the use case that NullPointerException will result if getMessageStatus() is used to query more than one message. - Fixed the bug that diagnosis dump only parses the date part of the date/time specified. - Used CommandConstants objects to contains command constants, so as to enforce maximum compatibility of Command objects across version. - Fixed the bug that diagnosis dump cannot dump database when both Application Context and Starting / Ending date/time are specified. - Retry sending acknowledgment only if the current thread sending the ack does not exist. - Fixed the use case that if the application context cannot be archived because some of the messages are not ready, archiveByDate() and archiveByAppContext() return an invalid error message. - Fixes the MSH backup function. Now it returns failure message correctly in case backup operation failed. - Fixes the use case that archive only creates the directory on the first time of invocation if the destination directory does not exist; and runs successfully in subsequent runs. Packaging: - Modified the namespace to conform to ebMS Specification [2.3.1] - Bug fixed: NullPointerException when fromUTCString is given an incomplete date/time string. - Appends "charset" to the content-type mime header. - Added namespace references so that the generated ebXML messages can be validated. Database: - Added clean up code to properly free resource such as Resultset, Statement - Added database fields in vision to support sync reply, message order and persist duration - Changed the database column name to avoid any possible SQL keywords - Fixes the use case that connection pool cannot be reset successfuly if a connection cannot be closed successfully. - Allow database password to be zero-length in diagnosis tool configuration file. Version 0.9.3.0 =============== Configuration: - Splitted the property file into three. msh.properties.xml will be for Hermes server, msh_client.properties.xml will be for MSH stub and monitor.properties.xml is for Monitor. - Bug fixed for wrong property file entry being read for rolling log file. Operation: - Enhanced exception support. Now exception would be thrown if any SOAP header that has the mustUnderstand flag equals to "1", but cannot be processed. - Modified DiagTool to create dump directories automatically. - Log the MSH halt and resume time to MSHLog table. - Added "GetIsHalted()" function to check if the MSH has been halted. Monitor has been updated to demonstrate its usage. - Added unregistration of application context. However, the unregistration will fail when there is pending message to be sent or to be received. - If the application context of the incoming message cannot be recognized, now it will send an error message back to the originating MSH. - Added a new class Utility for common methods called by server and clients. - Modified to suspend the mail polling thread also when the MSH is suspended. - Fixed the bug that the starting time of archive / backup operations cannot be earlier than year 2001. - After a pending message is marked as "deleted", it was possible that the same message be returned in the subsequent getPendingMessages() call since the sending thread is not immediately shut down but it needs to wait till the next retry time. It is now changed in the way such that deleted sending threads are not returned by getPendingMessages(). - Trusted Repository delivery method is now divided into "server-side trusted repository", which is written by the MSH, and "client-side repository", which is written by the client stub (Request Object). - The use of polling directory is removed and it can be safely deleted. All messages are now stored in the message repository. - Fixed the bug that using different messaging mode in the same application context causes error. - Updated XERCES library to version 2.2.1 - Supported fractional seconds in UTC formatted time, and we now do checking on timestamp when a message arrives. Now we generally use UTC time for all date/time parameter values and for returning results - Modified the behaviour of archive by date. Now all the messages that are in the time range (inclusive) are archived and nothing more. - Reformat the results returned by getDBConnectionPoolInfo so that it looks similar to the relevant settings in configuration file. - Fixed bug in dumping data from MSHLog: only output those in specified time period only. - Fixed the logger error displayed in tomcat console under Windows environment. - Fixed the bug that always return success in "restore" function. - Bug Fix: the response message of archiveByDate() now shows the failed message IDs clearly. - Bug fix: Null pointer exception results if the message repository directory cannot be written. Now it throws exception that is properly handled by the Transaction object. - Removed upgrade tool. Packaging: - Modified packaging part to fulfil the requirement of ebMS specification. - Reorganized the exceptions thrown when composing/internalizing an ebXML message. Now a SOAPValidationException will be thrown in case the operation is invalid with respect to the ebXML schema, and an EbxmlValidationException will be thrown if a logical error occurs. - Refactored an ebXML message validation module, which is responsible for validate the correctness of the received message according various requirement from the ebMS specification. The checkings include SOAP formatting, payload integrity, etc. For any incorrect messages, corresponding ebXML error messages would be sent back to the sending MSH. Database: - Fixed the bug that connection pool cannot be reset successfuly if a connection cannot be closed successfully. - Added "GetNumRecordsInDB()" function to check the number of records stored in MSH database. Monitor has been updated to demonstrate its usage. - Added "GetDBConnectionPoolInfo()" function to check the information about the connection pool. Monitor has been updated to demonstrate its usage. - Modified database connection pool mechanism. Now a new database connection will be created and returned if the old connection has been idle for a specified time period. - Modified to close the database connections asynchronously, so that it won't block the main threads. - Modified to mark the database connection invalid when returning to connection pool if any error occurred during database operations, so that the object is discarded and a new connection is created next time it is requested. - Changed DB schema to accommodate more than 2 possible values of sync reply mode in CPA. - Now check the healthiness of DB connection in the connection pool before any database operations. - Bug Fix: "archiveByDate" function, when used with SQL Server, results in a SQL exception "cannot connvert arithmetic data type". This is fixed by using parameterized query when selecting records. - Bug fix: connection is committed and then freed after archive operations now. Monitor: - Fixed bug in monitor: once digital signature is turned on, it cannot be turned off even if the check box is unset. Version 0.9.3.1 =============== Configuration: - Removed all static initializers. - Switch to use Apache Log4J. - Upgrade to log4j-1.2.8.jar, JavaMail 1.3, Xalan 2.5, Xerces 2.4 and Apache XML security library 1.0.5D2 - Assures the log path exists before initializing Log4J (Patch contributed by Jason van Zyl). - Added interpolation to property files (Patch contributed by Jason van Zyl) - Added optional properties at client side to limit the maximum number of payload and maximum payload size - Integrate the previous "common" libraries to the main source tree. The file "common.jar" is removed. - Integrate the previous "pki" libraries to the main source tree. The file "pki.jar" is removed. - Restructured log messages to add error code - Added selectable signing algorithm for signing ack in property files Operation: - Factorize all useful constants into a single Constants class. - Implemented partial transaction, which is a group of database and file system operations that are committed and rolled back atomically. Now if an error occurred during message dispatching (receiving of message) or message sending, all database and file system operations are undone. - Now checking on timestamp is done when a message arrives - Defer the start of the thread to the time when the transaction commits. This allows better resource utilization under heavy load (since database connections are freed before a new thread, which possibly uses another database connection, is started), and also solves synchronization issues. - Allow client-side message polling to be halted/resumed. - Disallow a message having the same mesage ID to be sent twice on the application level. - Modified the behaviour of archive(Date, Date). Now all the messages that are in the time range (inclusive) are archived and nothing more. - Added "archive by date and application context". Overloaded "archive()" API in the Request class to support three different types of archival operations: archive by date, by application context, and by both criteria. - Use UTC time for all date/time parameter values and exported results. - Allows archive operation in both normal and suspended mode. - Bug fix: Previously a disabled mshConfig is stored in database, but when the servlet is restarted, it is still reloaded into the mshConnection table, causing the message dispatcher to encounter a disabled mshConfig and resulting in Unknown Application Context error. Now disabled mshConfig is skipped in initialization phase to fix this error. - Bug fix: currently message loss may result if two threads poll for messages using the same application context. A lock is now placed to serialize message polling operations if the appContexts are the same. - Bug fix: Null pointer exception results if the message repository directory cannot be written. Now it throws exception that is properly handled by the Transaction object. - syncReply mode = "none", "mshSignalsOnly" can be properly handled. - Added CertResolver and ToMshUrlResolver mechanism to let user customize the location of the certificate for verifying digital signature and the outgoing URL endpoint of sending out messages - Added time out value in POP3 polling thread - MessageServiceHandler.deliverToApplication() is changed from a blocking method to become an execution thread. - StatusReponse and Pong messages are delivered to application. - Bug fix: certificate path verifier result now checked - Modify request. Now it adds MessageOrder and SyncReply automatically if those parameters are passed in in constructor. - Bug fix: now, error message will be generated and sent back to the sender when an error message is received with unknown ref to message id Packaging: - Bug fix: fromUTCString now supports fractional seconds (truncated) - Make Manifest, Manifest's methods and ErrorList's addError() methods public such that more descriptions and errors can be added to Manifest and ErrorList. - Patch the missing <> around the Content-Id in payload when using JAXM library. This patch ensures the message serialization and deserialization works no matter JAXM or AXIS is used. - Bug fix: AttachmentDataSource should take Content-Transfer-Encoding into account in order to get a correct InputStream(). - Add getReceivedMessageIds() and receive(messageId) in Request, add getUndeliveredMessageIds() and getMessageById(messageId) in MessageServiceHandler and add NoMessageListenerImpl. This supports client to get received and undelivered messages on demand. - Added content ID to SOAP part - Implement private writeObject() and readObject() in all Serializable classes such that only those necessary data memeber fields are written properly during serialization. This reduces the chance of incompatibility when the implementation changes for future releases. - Add methods to get and set optional role attribute in Reference. - Add SignatureReference that represents the <ds:Reference> element under Acknowledgment. - Add verify() method in EbxmlMessage to make it symmetric with sign() Database: - Bug fix: Database connection leakage on unexpected exceptions. - Bug Fix: "archiveByDate" function, when used with SQL Server, results in a SQL exception "cannot connvert arithmetic data type". This is fixed by using parameterized query when selecting records. - Allow database transaction isolation level to be configurable through msh.properties.xml (Patch contributed by Jason van Zyl). - Added one more test when checking table schema on startup: if the schema check fail, we do a select * on the table before creating the table. If the select (*) returns successfully, we mark the operation fail and report properly. - Bug fix: Oracle database would create "integer" data type as "numeric" data type such that those "integer" columns will be skipped during backup. Now, case statement is added to handle "numeric" data type. To play safe, other data types such as "bigint", "decimal" and "smallint" are handled as well. If a column data type is not recognized, exception will be thrown. Monitor: - Added from party type, to party type, service type input boxes in monitor


Changes: Version 0.9.1.0 =============== First tagged release. Version 0.9.1.1 =============== Added API doc to hk.hku.cecid.phoenix.message.monitor.Monitor Fixed Javadoc error of: - hk.hku.cecid.phoenix.message.handler.MessageServiceHandler Modified build.xml to do "linked" Javadoc to Javasoft's site Restructuring the msh.properties.xml Added a system command to reset the database poll Change to use Academic Free License Version 0.9.1.2 =============== Modified build.xml, so that msh.properties.xml will not be overwritten in each deploy Fixed: getLogger() from MessageServiceHandler may be called before setting proper logging properties. Tests added: test/ directory is newly added that contains test cases automatically run by the build targets, "compiletest", "runtest" and "runalltest". Fixed: when a message is received for an ApplicationContext and stored in the MessageListener repository, the directory name of repository is hashed from DirectoryManager as well in order to prevent unexpected character in the directory name such as ':'. Fixed: Request.java will read the logging properties from property file in static initialization. Added: authentication of communication between request and msh Fixed: Cannot-delete-file-bug in Win32 platform. Support file based protocol to enable server to save the received messages directly to the local file system, i.e., no polling will be done. Version 0.9.1.3 =============== Combined Request.setSpecialFunction and Request.sendDiagnosticCommand. setSpeicalFunction is deprecated, sendDiagnosticCommand is recommended to be used. Added DbTableManager class to manage the database schema creation as well as supporting DB operations such as SELECT, INSERT and UPDATE. Fixed: Implemented reset connection pool diagnostic command. Fixed: Receiver register and quits, now can get messages received when offline successfully Fixed: Cannot get error messages. Mail acknowledgement response: remove "mailto:" in the mail from field if any. Fixed: objectName being wrongly hashed and stored Fixed: when stress test, if late acknowledgement is received while retry() is called to update the database, inconsistent between the database state and that of the sending thread occurs Version 0.9.1.4 =============== Added an optional properties and an optional action to change the subtype of the multipart soap message from text/xml to multipart/related when sending message using SMTP protocol. This is to get rid of a problem when some email servers rewrite the MIME headers. When receiving emails, we will change the subtype back before parsing the SOAP message. Fixed a bug when getBoolean in Mail.java On monitor, let user change the CPAID, ConversationID, Service, Action when sending In MessageListenerImpl, without explicitly flushing the file, when another thread gets the length of this file, the length may be sometimes reported to be zero in Windows environment. Fixed: only write 16 bytes of user name as remote address to received message table Added: Optional SMTP authentication Added: SOAP Action Header when sending out messages Added UI for specifying message order in message. Fixed Monitor Bug: Switch from "Reset" to "Continue" status when the "repeat sending" option is enabled. Removed the auto-setting of STATUS_RESET to handle sequence number wraparound. Added support in the Request class for sequence number retrieval from the MSH. Add a record to "RefToMessage" table if it is an error list; previously only messages having a RefToMessageId in Acknowledgment element is processed, but not the error messages. Added getter and setter for MessageOrder header extension element. Now the message order element, if specified, is added together with the AckRequested element. Added the following new states: STATE_RECEIVED_ACKNOWLEDGED, STATE_SENT_RECEIVED. Now loopback messages can be recognized more easily. Supports retrieval of the sequence number information of sent messages. Changes the internal data structure so that the lookup / modify operations are more efficient. Uses a "sliding window" approach to cope with message order sequence number wrap around. Now it should work successfully. Fixes bug on ordered message delivery. Now when the application server restarts, it correctly reads in the undelivered messages that are ordered / unordered and deliver to application. Added handler for the system commands QUERY_SEQUENCE_NUMBER and QUERY_RESET_SEQUENCE_NUMBER to support Message Order operation. Fixes warnings occurred during javadoc generation Fixes bug on null pointer exception when getting messages from some mail servers (because of missing Sent Date) Version 0.9.2.0 =============== Added internal class MessageIdMonitor in MessageServer to provide transaction locking of a given messageId Use "finally" clause in all methods of MessageServer to close Statements, ResultSets gracefully no matter exception is caught or not during processing. Re-add syncReply, messageOrder and persistDuration back into table MSHConfig. Bug fix: message delivery status is wrongly set in MessageProcessor when generating and storing error message. A number of places in MessageServiceHandler also have this bug before a message is delivered to application. Now, this bug is fixed by examining the message listener type when a message is stored and delivered to application. The delivery status is set to false only if that message requires polling from Request. MessageServiceHandler: change the Map "toBeAcknowledgedMessage" to be "sendThreadMap" and the method toBeAcknowledged() to addSendThread() respectively to reflect the true and proper meaning of the Map. MessageServiceHandlerConnection: no matter an ebXML message to be sent has <AckRequested> or not, its sending thread is also added to "sendThreadMap" in MSH. Positive and negative acknowledgment now work and the behaviour is optionally controlled by the corresponding properties (missing of the properties imply "false"). If "MSH/Config/PositiveAcknowledgment" is set to true, when a message is sent successfully, a positive acknowledgment message, which is a <StatusResponse> message, is sent back to sender. If "MSH/Config/AugmentedErrorMessage" is set to true, an error message being sent back to the sender is augmented with the original message as a MIME payload. Command.HALT_SUSPEND and Command.HALT_TERMINATE are added to pass the specified level to MessageServiceHandler.halt() and then delegate to MessageProcessor.shutDown(). When the sending thread (MessageProcessor) exits the retry loop, it will generate error message and do final state changing if the shutDown is a TERMINATE one. Otherwise, it simply exits. Bug fix: Command.GET_MESSAGE forgets to call monitor.endRequest() that MSH hangs if it is polled by Request while Command.HALT is received. Added property for database backup file name and the corresponding backup and restore methods in DbTableManager, MessageServer, MessageServiceHandler and Command. Add new table "SendingState" to store the current retry and next retry time information. Fixes bug on null pointer exception when fail to authenticate command object due to missing specification of user name/password in client side. Reorganized the values of MSH commands Extended the Request API and make it more user-friendly Added "Message Status" query command Modified to use the new set of Request API log4j-1.2.7 is added and log4j-1.2.6 is removed. MessageListenerImpl: when two messages are delivered to an application under stress, name.exists() may return false in the two threads and thus one of the name.mkdirs() will fail and throw exception. (Actually, this should not be the case because the directory is already created for the late thread). So, check name.exists() one more time to ensure correctness. MessageServer.store() - when a message is stored, if the state is STATE_SENT_STARTED, a new tuple should be inserted into the new table "SendingState" with "currentTry" being "0" and "nextRetryTime" being System.currentTimeMillis(). MessageServer.resend() - In MessageServiceHandler, when an old acknowledgment is resent, MessageServer.retry() does not work any more after the above two changes. Thus, resend() has to be implemented in MessageServer such that without saving the old message, it just resets "state" in "MessageStore" to become STATE_SENT_STARTED and re-insert a new tuple in "SendingState". MessageServer.STATE_XXX are all changed from "String" to "int" such that the performance of states comparison is improved. MessageServer.restartSendThread() fully rewritten to construct sending threads based on the new table "SendingState". If the "nextRetryTime" of a sending thread has passed, appropriate number of "retryInterval" has to be skipped to catch up the original schedule. "latency" is introduced in MessageProcessor: when a sending thread is restarted, it may have to wait for sometime due to the remaining waiting time of the previous retry. Thus, if "latency" > 0, it means this sending thread has to wait before really attempting the next retry. Constructors of MessageProcessor are redesigned to suit for the need of MessageServiceHandler, MessageServiceHandlerConnection and MessageServer. MessageProcessorException is removed as it is not used any more. Now message status can be queried by left-clicking the history panel and select "Message Status" command Implemented getPendingMessages() command Added the user interface to get pending messages from the MSH. Allows RESUME, BACKUP and RESTORE operations only when MSH is halted. Otherwise an error will be thrown. Added radio buttons in diagnostic panel of the Monitor to activate SUSPEND, TERMINATE, RESUME, BACKUP and RESTORE. Added deletePendingMessage() function that deletes the message in the queue if it has not been sent successfully. Modified MessageServer.getMessageStatus(String) to use integer comparison of states instead of string Added configuration option set the destination directory where archives are placed Added user interface to invoke "delete pending message" function. Added user interface to initiate MSH message archival. Added MSH_ARCHIVE_BY_APPCONTEXT and MSH_ARCHIVE_BY_DATE system commands. Added implementation of MSH_ARCHIVE_BY_APPCONTEXT. Altered schema of MessageStore table to add an archival flag. Removed codes previously commented out. Restructured logging Added a new table "MessageInfo" to cache information derived from the messages Added archiveByDate Added user interface to initiate archival function Fixes the use case that when an ebxml message with reliable messaging enabled has arrived and its acknowledgment message is too busy to store it to database, and at the same time the ebxml message (retry #2 because the sender did not receive the acknowledgment yet) has arrived. Both doPost() threads cannot get the acknowledgment message from database, and thus generating another ones and try to store them in the database. This results in a "duplicate entry" Modified the namespace to conform to ebMS Specification [2.3.1] Generate positive acknowledgment only if the message is not a status response, pong or acknowledgment Corrected a simple grammatical mistake in MessageServer.java Bug fixed: NullPointerException when fromUTCString is given an incomplete date/time string that does not contain all the components: YYYY MM DD HH MM SS. Now it correctly returns null if the date is invalid / unparsable. Bug fixed: NullPointerException when an error message is received from the other MSH (e.g. TimeToLive expired) that needs to be forwarded to the user. It was previously caused by the "null" value of mshConnection variable in onMessage() function when an error message is received. Added user interface to add TimeToLive to the message. Detailed message status that includes information in SentMessage and ReceivedMessage table. Changed the placement of the text field "Time to Live" Changed the database column name to avoid any possible SQL keywords Fixes the use case that connection pool cannot be reset successfuly if a connection cannot be closed successfully by suppressing the exceptions thrown when the connections (possibly stale) are closed. Fixes the use case that NullPointerException will result if getMessageStatus() is used to query more than one message. Fixed the bug that diagnosis dump only parses the date part of the date/time specified. Fixed the bug that diagnosis dump cannot dump database when both Application Context and Starting / Ending date/time are specified. Used CommandConstants objects to contains command constants, so as to enforce maximum compatibility of Command objects across version Fixes the MSH backup function. Now it returns failure message correctly in case backup operation failed. Fixes the use case that archive only creates the directory on the first time of invocation if the destination directory does not exist; and runs successfully in subsequent runs. Allow database password to be zero-length in diagnosis tool configuration file. Modified the MSH properties file to demonstrate correct settings. The message repository and the objectstore directories cannot have a parent-child relationship. Version 0.9.3.0 =============== Throws exception if any of the SOAP Header extensions that has the mustUnderstand flag equals to "1" cannot be recognized / processed. Added an ebXML message validator that is able to generate correct ebXML error message which can be sent to the sending MSH directly. Reports MimeProblem/Error if there is not a matching payload for the xlink:href element in the manifest as stated in ebxml-iic Conformance Testing Requirement urn:semreq:id:48 by generating an ebXML error message instead of throwing MessageServiceHandler exception. Ignores redundant payloads as stated in ebxml-iic Conformance Testing Requirement urn:semreq:id:51. Note that these payloads may still be referenced by the applications as they are not explicitly prevented from doing so. Fixes the use case that NullPointerException will result if getMessageStatus() is used to query more than one message. Added "GetIsHalted()" function to check if the MSH has been halted. Monitor has been updated to demonstrate its usage. Added "GetNumRecordsInDB()" function to check the number of records stored in MSH database. Monitor has been updated to demonstrate its usage. Added "GetDBConnectionPoolInfo()" function to check the information about the connection pool. Monitor has been updated to demonstrate its usage. Added "Timestamp" element in StatusResponse message to return the time message message referred to by Status Request was received. [ebMS 7.3.2]. Added "c_rowtimestamp" field in MessageInfo table to store the time the message was inserted into the database. Added unregistration of application context. The unregistration will fail when there is pending message to be sent or to be received. If the application context of the incoming message cannot be recognized, now it will send an error message back to the originating MSH. The previous behaviour is that an exception will be thrown by the receiving MSH. Create a new database connection if the old connection has been idle for a specified time period. Added maximum connection idle time setting in msh.properties.xml. Close the database connections asynchronously, so that it won't block the main threads. Mark the database connection invalid when returning to connection pool if any error occurred during database operations, so that the object is discarded and a new connection is created next time it is requested. Split msh.properties.xml, msh_client.properties.xml and monitor.properties.xml Add a new class Utility for common methods called by server and clients Suspend the mail polling thread also when the MSH is suspended. Added location attribute support in ebXML error message. Validate the xlink:href element of the manifest references. Verifies the consistency of payloads and generate error message with Payload-ID as the value of location attribute in Error element. Reorganized the exceptions thrown when composing / internalizing an ebXML message. Now a SOAPValidationException will be thrown in case the operation is invalid with respect to the ebXML schema, and an EbxmlValidationException will be thrown if a logical error occurs. Fixes the bug that the starting time of archive / backup operations cannot be earlier than year 2001 due to the string comparison operation of the field C_TIME against the "long" representation of Java Date object. After a pending message is marked as "deleted", it was possible that the same message be returned in the subsequent getPendingMessages() call since the sending thread is not immediately shut down but it needs to wait till the next retry time. It is now changed in the way such that deleted sending threads are not returned by getPendingMessages(). Change DB schema on sync reply field to integer (previous, boolean). This is for more than 2 possible values of sync reply from cPA. Trusted Repository delivery method is now divided into "server-side trusted repository", which is written by the MSH, and "client-side repository", which is written by the client stub (Request Object). The use of polling directory is removed and it can be safely deleted. All messages are now stored in the message repository. Fixed the bug that using different messaging mode in the same application context causes error Changed default retry interval to 5 minutes Changes the default toMSHURL so that the user can be more alert about incorrect settings. Extended message support to all the message delivery methods supported, including server (trusted) repository, client-side repository, client-side message polling, servlets and email. Used XML instead of HTTP header to transfer the message deletion status back to the Request object. Modified the default value of service in Monitor to be an URI Changed xerces library to v2.2.1 Added "select 1" code to getConnection() method in connection pool manager Fixed bug in monitor: once digital signature is turned on, it cannot be turned off even if the check box is unset. Fixed bug in fromUTCString: now support fractional seconds (they are truncated), and do checking on timestamp when a message arrives. Modified the behaviour of archive(Date, Date). Now all the messages that are in the time range (inclusive) are archived and nothing more. Promoted the error messages in unregister() from debug level to error level. Use UTC time for all date/time parameter values and exported results. Update the results returned by getDBConnectionPoolInfo so that it looks similar to the relevant settings in configuration file. Updates sample diagnosis.properties.xml to reflect the change in time format: now UTC format is accepted. Retrict the range of data dumped from MSHLog to those in specified time period only. Fixed wrong property file entry being read for rolling log file Bypass unregistration of empty application context in both Request and MessageServiceHandler. Remove mshConnection from mshConnectionTable upon unregistration. New common.jar file that fixes the logger error displayed in tomcat console under Windows environment. Bug fix: Previously a disabled mshConfig is stored in database, but when the servlet is restarted, it is still reloaded into the mshConnection table, causing the message dispatcher to encounter a disabled mshConfig and resulting in Unknown Application Context error. Now disabled mshConfig is skipped in initialization phase to fix this error. Bug fix: currently the "restore" function of MSH always return success. Now it returns appropriate error message in case error occurs. Bug fix: The table "MSHLog" should be allowed non-empty since there are always some data; now the checking is skipped. Bug Fix: "archiveByDate" function, when used with SQL Server, results in a SQL exception "cannot connvert arithmetic data type". This is fixed by using parameterized query when selecting records. Bug Fix: the response message of archiveByDate() now shows the failed message IDs clearly. Bug Fix: connection should be committed after archive operations. Otherwise the table is locked infinitely as the database connection is not immediately closed but returned to the connection pool instead. Bug fix: Null pointer exception results if the message repository directory cannot be written. Now it throws exception that is properly handled by the Transaction object. Bug fix: connection should be freed after archive operations. Bug fix: added setLoggingProperties in Mail.java Bug fix: use UTC format to display time when outputing message status query request Removed upgrade tool Version 0.9.3.1 =============== Factorize all useful constants into a single Constants class. Implemented partial transaction, which is a group of database and file system operations that are committed and rolled back atomically. Now if an error occurred during message dispatching (receiving of message) or message sending, all database and file system operations are undone. Fixed database connection leakage on unexpected exceptions. Now all the methods in MessageServer supports Transaction object. Fixed bug in fromUTCString: now support fractional seconds (they are truncated), and do checking on timestamp when a message arrives. Defer the start of the thread to the time when the transaction commits. This allows better resource utilization under heavy load (since database connections are freed before a new thread, which possibly uses another database connection, is started), and also solves synchronization issues. Removed all static initializers by replacing them with "configure()", which takes in a configuration object to do initialization on a class-by-class basis. Removed dead files which are no longer used in the project (.phoenix PhoenixProperties.java Keystore.java SignatureImpl.java). Added initialization exception object to identify the error occurred in class initialization. Updated the source codes to use Apache Log4J. Allow client-side message polling to be halted / resumed. Control panel is modified to demonstrate its usage. Disallow a message having the same mesage ID to be sent twice on the application level. The rationale behind this fix is that application-level retries should be done using different messages (and thus different message IDs). It is inappropriate to use the same message twice on the application level. Integrate the previous "common" libraries to the main source tree. The file "common.jar" is removed. Modified the behaviour of archive(Date, Date). Now all the messages that are in the time range (inclusive) are archived and nothing more. Changed Authentication manager: not to use the JDK 1.4 specific constructor FileWriter(File, boolean) Added "archive by date and application context". Overloaded "archive()" API in the Request class to support three different types of archival operations: archive by date, by application context, and by both criteria. Modified the UI to demonstrate the usage of 3 archive functions. Refactored Export.java to support additional kinds of archive criteria, by introducting Set operations in criteria result set. Modified exception classes and eliminated the use of "indexOf" method to preserve JDK 1.3 compatibility. Promoted the error messages in unregister() from debug level to error level. Use UTC time for all date/time parameter values and exported results. Update the results returned by getDBConnectionPoolInfo so that it looks similar to the relevant settings in configuration file. Allows archive operation in both normal and suspended mode. Add timestamp in archive result, and use current system time as the endtime of the operation archiveByAppContext(). Updates sample diagnosis.properties.xml to reflect the change in time format: now UTC format is accepted. Retrict the range of data dumped from MSHLog to those in specified time period only. Fix reading wrong property file entry for rolling log file Bypass unregistration of empty application context in both Request and MessageServiceHandler. Remove mshConnection from mshConnectionTable upon unregistration. Bug fix: Previously a disabled mshConfig is stored in database, but when the servlet is restarted, it is still reloaded into the mshConnection table, causing the message dispatcher to encounter a disabled mshConfig and resulting in Unknown Application Context error. Now disabled mshConfig is skipped in initialization phase to fix this error. Bug fix: currently the "restore" function of MSH always return success. Now it returns appropriate error message in case error occurs. Buf fix: The table "MSHLog" should be allowed non-empty since there are always some data; now the checking is skipped. Logging statements on "backupFiles" and "restoreFiles" are removed, since the function may be called several thousand times in one backup and restore operation, and result in total mess-up of the log file if DEBUG is enabled. Bug Fix: "archiveByDate" function, when used with SQL Server, results in a SQL exception "cannot connvert arithmetic data type". This is fixed by using parameterized query when selecting records. Allow database transaction isolation level to be configurable through msh.properties.xml (Patch contributed by Jason van Zyl). Bug Fix: connection should be committed after archive operations. Otherwise the table is locked infinitely as the database connection is not immediately closed but returned to the connection pool instead. Set the REQUEST_MIN_WAITING_TIME to 0. so that when the request poller gets a message, it continues to get all other messages in batch mode, without idling Assures the log path exists before initializing Log4J (Patch contributed by Jason van Zyl). Bug fix: currently message loss may result if two threads poll for messages using the same application context. A lock is now placed to serialize message polling operations if the appContexts are the same. Bug fix: Null pointer exception results if the message repository directory cannot be written. Now it throws exception that is properly handled by the Transaction object. Added interpolation to property files (Patch contributed by Jason van Zyl) Move Request.getSuccessResponse() and Request.getFailureResponse() to Utility such that Request will not invoke MessageServiceHandler. getSuccessResponse() and MessageServiceHandler.getFailureResponse(). This gives a better code distribution on client and server sides. Remove MessageServiceHandler.getSuccessResponse() and MessageServiceHandler.getFailureResponse(). Use Utility.getSuccessResponse() and Utility.getFailureResponse() instead. Now, MessageProcessor (sending thread) first retrieves the ToPartyId's from the EbxmlMessage. If there is a valid URL with supported protocol, that URL will be used as the "toMshUrl" when the sending thread is started. Otherwise, the default getToMshUrl() and getTransportType() from MessageServiceHandlerConfig are used as the end point. Make Manifest, Manifest's methods and ErrorList's addError() methods public such that more descriptions and errors can be added to Manifest and ErrorList. Bug fix: reset polling interval after exception Patch the missing <> around the Content-Id in payload when using JAXM library. This patch ensures the message serialization and deserialization works no matter JAXM or AXIS is used. Bug fix: AttachmentDataSource should take Content-Transfer-Encoding into account in order to get a correct InputStream(). Added from party type, to party type, service type input boxes in monitor Bug fix: MessageHeader(SOAPEnvelope, SOAPElement) shoud unmarshal multiple From/PartyId and To/PartyId's. Force the content type of all payload sending from monitor to application/octet-stream Added content id to SOAP part Added content transfer encoding to all messages sent through HTTP as optional parameters Added one more test when checking table schema on startup: if the schema check fail, we do a select * on the table before creating the table. If the select (*) returns successfully, we mark the operation fail and report properly. Bug fixed: now registering a wildcard app context will not cause ClientMessageListenerImpl to get error for attempting to create a directory with "*" Add getReceivedMessageIds() and receive(messageId) in Request, add getUndeliveredMessageIds() and getMessageById(messageId) in MessageServiceHandler and add NoMessageListenerImpl. This supports client to get received and undelivered messages on demand. Validate retryInterval, syncReply, persistDuration supplied to Request constructor. Rearrange the HTTP content type header to make it to work in Websphere get the Pki package to the same source tree Bug fixed: restructure log4j to make it to work with the new pki package Implement private writeObject() and readObject() in all Serializable classes such that only those necessary data memeber fields are written properly during serialization. This reduces the chance of incompatibility when the implementation changes for future releases. Change getSOAPMessage() to become getEbxmlMessage() in Command such that a message being sent needs not be serialized into a byte array first but written to the network stream directly. This should alleviates part of memory loading in client side. MessageServiceHandler.deliverToApplication() is changed from a blocking method to become an execution thread. Bug fix: Oracle database would create "integer" data type as "numeric" data type such that those "integer" columns will be skipped during backup. Now, case statement is added to handle "numeric" data type. To play safe, other data types such as "bigint", "decimal" and "smallint" are handled as well. If a column data type is not recognized, exception will be thrown. syncReply mode = "none", "mshSignalsOnly" can be properly handled. StatusReponse and Pong messages are delivered to application. Add methods to get and set optional role attribute in Reference. Bug fix for archive: - when archiving files in repository, if a file cannot be archived due to, say, missing of such a file or IOException, the database entry for this file is still marked archived. Now, when this occurs, the database entry should be marked as unarchived instead. - when archiving by dates, those rejected messageIds' are also exported in one of the XML output file. - if an individual message file does not exist, it should not be reported in the XML dump file and it should also be reported with failure reason in the final response document. - After restore(), mshConnectionTable, sendThreadMap, deliveryMap and sentSequenceMap are not refreshed such that applications cannot send message immediately. Restructured log messages to add error code Restructured exception catching mechanism Added optional properties at client side to limit the maximum number of payload and maximum payload size Bug fixed: now, error message will be generated and sent back to the sender when an error message is received with unknown ref to message id added time out in pop3 polling thread added selectable signing algorithm for signing ack in property files Add SignatureReference that represents the <ds:Reference> element under Acknowledgment. Add verify() method in EbxmlMessage to make it symmetric with sign() such that the all methods in Signature need not be made public. Patch PKISignatureImpl and ApacheXMLDSigner to make them work with xmlsec 1.0.5D2 and 1.0.4 for signing and verification. Upgrade to log4j-1.2.8.jar, JavaMail 1.3, Xalan 2.5, Xerces 2.4 and Apache XML security library 1.0.5D2 Modify request. Now it adds MessageOrder and SyncReply automatically if those parameters are passed in in constructor. bug fixed: cert path verifier result not checked