Skip to content

Commit 700ed28

Browse files
Merge pull request #21 from OpenAS2/dev
Merge latest changes for 2.1.3 release
2 parents 25596f3 + fc72106 commit 700ed28

17 files changed

+61
-54
lines changed

RELEASE-NOTES.txt

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
OpenAS2 Server
2-
Version 2.1.2
2+
Version 2.1.3
33
RELEASE NOTES
44

5-
The OpenAS2 project is pleased to announce the release of OpenAS2 2.1.2
5+
The OpenAS2 project is pleased to announce the release of OpenAS2 2.1.3
66

7-
The release download file is: OpenAS2Server-2.1.2.zip
7+
The release download file is: OpenAS2Server-2.1.3.zip
88
The zip file contains a PDF document providing information on installing and using the application.
99

10-
Version 2.1.2 - 2016-10-29
10+
Version 2.1.3 - 2016-11-09
1111
This release is a bugfix release:
12-
1. Swap call to scan directory with the tracking processing call to ensure there is at least one full poll interval between scan and call to tracking processing to avoid sending incomplete files.
13-
2. Add documentation on Java tuning for large fiules and/or busy AS2 systems
12+
1. Revert to default for allowing restricted HTTP headers (see OpenAS2HowTo for discussion on this issue)
13+
2. Remove \r (CR) character from logging and use the the system property to avoid issues on NIX based systems that parse logs
14+
3. Enhance documentation
1415

1516
Upgrade Notes (if upgrading from versions older than 2.1.0):
1617
1. Add the new module to your existing config.xml (see classname="org.openas2.processor.msgtracking.DbTrackingModule" in release config.xml)

Server/bin/start-openas2.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ rem Set some of the base system properties for the Java environment and logging
55
rem remove -Dorg.apache.commons.logging.Log=org.openas2.logging.Log if using another logging package
66
rem
77
set EXTRA_PARMS=-Xms32m -Xmx384m -Dorg.apache.commons.logging.Log=org.openas2.logging.Log
8-
rem By default allow restricted HTTP headers
9-
set EXTRA_PARMS=%EXTRA_PARMS% -Dsun.net.http.allowRestrictedHeaders=true
8+
rem For versions of Java that prevent restricted HTTP headers (see documentation for discussion on this)
9+
rem set EXTRA_PARMS=%EXTRA_PARMS% -Dsun.net.http.allowRestrictedHeaders=true
1010

1111
rem Uncomment any of the following for enhanced debug
1212
rem set EXTRA_PARMS=%EXTRA_PARMS% -Dmaillogger.debug.enabled=true

Server/bin/start-openas2.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ PWD_OVERRIDE=""
1010
# remove -Dorg.apache.commons.logging.Log=org.openas2.logging.Log if using another logging package
1111
#
1212
EXTRA_PARMS="-Xms32m -Xmx384m -Dorg.apache.commons.logging.Log=org.openas2.logging.Log"
13-
# By default allow restricted HTTP headers
14-
EXTRA_PARMS="$EXTRA_PARMS -Dsun.net.http.allowRestrictedHeaders=true"
13+
# For versions of Java that prevent restricted HTTP headers (see documentation for discussion on this)
14+
#EXTRA_PARMS="$EXTRA_PARMS -Dsun.net.http.allowRestrictedHeaders=true"
1515
# Uncomment any of the following for enhanced debug
1616
#EXTRA_PARMS="$EXTRA_PARMS -Dmaillogger.debug.enabled=true"
1717
#EXTRA_PARMS="$EXTRA_PARMS -DlogRxdMsgMimeBodyParts=true"
Binary file not shown.

Server/lib/openas2-server.jar

398 Bytes
Binary file not shown.

Server/src/org/openas2/Session.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
public interface Session {
2222
/** Official OpenAS2 release version */
23-
public static final String VERSION = "2.1.2";
23+
public static final String VERSION = "2.1.3";
2424

2525
/** Official OpenAS2 title */
2626
public static final String TITLE = "OpenAS2 v" + VERSION;

Server/src/org/openas2/app/OpenAS2Server.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,32 @@ public void run()
4747
try {
4848
Log logger = LogFactory.getLog(OpenAS2Server.class.getSimpleName());
4949

50-
write(Session.TITLE + "\r\nStarting Server...\r\n");
50+
write(Session.TITLE + System.getProperty("line.separator") + "Starting Server..." + System.getProperty("line.separator"));
5151

5252
// create the OpenAS2 Session object
5353
// this is used by all other objects to access global configs and functionality
54-
write("Loading configuration...\r\n");
54+
write("Loading configuration..." + System.getProperty("line.separator"));
5555

5656
if (args.length > 0) {
5757
session = new XMLSession(args[0]);
5858
} else {
59-
write("Usage:\r\n");
60-
write("java org.openas2.app.OpenAS2Server <configuration file>\r\n");
59+
write("Usage:" + System.getProperty("line.separator"));
60+
write("java org.openas2.app.OpenAS2Server <configuration file>" + System.getProperty("line.separator"));
6161
throw new Exception("Missing configuration file");
6262
}
6363
// create a command processor
6464

6565
// get a registry of Command objects, and add Commands for the Session
66-
write("Registering Session to Command Processor...\r\n");
66+
write("Registering Session to Command Processor..." + System.getProperty("line.separator"));
6767

6868
CommandRegistry reg = session.getCommandRegistry();
6969

7070
// start the active processor modules
71-
write("Starting Active Modules...\r\n");
71+
write("Starting Active Modules..." + System.getProperty("line.separator"));
7272
session.getProcessor().startActiveModules();
7373

7474
// enter the command processing loop
75-
write("OpenAS2 V" + Session.VERSION + " Started\r\n");
75+
write("OpenAS2 V" + Session.VERSION + " Started" + System.getProperty("line.separator"));
7676

7777

7878
logger.info("- OpenAS2 Started - V" + Session.VERSION);
@@ -81,7 +81,7 @@ public void run()
8181
List<BaseCommandProcessor> processors = cmdMgr.getProcessors();
8282
for (int i = 0; i < processors.size(); i++) {
8383
write("Loading Command Processor..." + processors.toString()
84-
+ "\r\n");
84+
+ System.getProperty("line.separator"));
8585
cmd = (BaseCommandProcessor) processors.get(i);
8686
cmd.init();
8787
cmd.addCommands(reg);

Server/src/org/openas2/logging/DefaultFormatter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class DefaultFormatter extends BaseFormatter {
1414
public String getTerminatedMessage(OpenAS2Exception exception) {
15-
StringBuffer buf = new StringBuffer("Termination of exception:\r\n");
15+
StringBuffer buf = new StringBuffer("Termination of exception:" + System.getProperty("line.separator"));
1616

1717
// Write exception trace
1818
StringWriter strWriter = new StringWriter();
@@ -27,8 +27,8 @@ public String getTerminatedMessage(OpenAS2Exception exception) {
2727

2828
while (sourceIt.hasNext()) {
2929
source = sourceIt.next();
30-
buf.append(source.getKey().toString()).append("\r\n");
31-
buf.append(source.getValue().toString()).append("\r\n\r\n");
30+
buf.append(source.getKey().toString()).append(System.getProperty("line.separator"));
31+
buf.append(source.getValue().toString()).append(System.getProperty("line.separator")).append(System.getProperty("line.separator"));
3232
}
3333

3434
return buf.toString();

Server/src/org/openas2/logging/EmailLogger.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected void doLog(OpenAS2Exception exception, boolean terminated) {
118118
body.append(parseText(exception, terminated, getParameter(PARAM_BODY, false)));
119119
}
120120

121-
body.append("\r\n");
121+
body.append(System.getProperty("line.separator"));
122122

123123
if (getParameter(PARAM_BODYTEMPLATE, false) != null) {
124124
body.append(parseText(exception, terminated, getTemplateText()));

Server/src/org/openas2/message/BaseMessage.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public String toString() {
285285
buf.append("To:").append(getPartnership().getReceiverIDs());
286286

287287
Enumeration<Header> headerEn = getHeaders().getAllHeaders();
288-
buf.append("\r\nHeaders:{");
288+
buf.append(System.getProperty("line.separator") + "Headers:{");
289289

290290
while (headerEn.hasMoreElements()) {
291291
Header header = headerEn.nextElement();
@@ -297,12 +297,12 @@ public String toString() {
297297
}
298298

299299
buf.append("}");
300-
buf.append("\r\nAttributes:").append(getAttributes());
300+
buf.append(System.getProperty("line.separator") + "Attributes:").append(getAttributes());
301301

302302
MessageMDN mdn = getMDN();
303303

304304
if (mdn != null) {
305-
buf.append("\r\nMDN:");
305+
buf.append(System.getProperty("line.separator") + "MDN:");
306306
buf.append(mdn.toString());
307307
}
308308

Server/src/org/openas2/message/BaseMessageMDN.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public String toString() {
153153
buf.append("To:").append(getPartnership().getSenderIDs());
154154

155155
Enumeration<Header> headerEn = getHeaders().getAllHeaders();
156-
buf.append("\r\nHeaders:{");
156+
buf.append(System.getProperty("line.separator") + "Headers:{");
157157

158158
while (headerEn.hasMoreElements()) {
159159
Header header = headerEn.nextElement();
@@ -165,9 +165,9 @@ public String toString() {
165165
}
166166

167167
buf.append("}");
168-
buf.append("\r\nAttributes:").append(getAttributes());
169-
buf.append("\r\nText: \r\n");
170-
buf.append(getText()).append("\r\n");
168+
buf.append(System.getProperty("line.separator") + "Attributes:").append(getAttributes());
169+
buf.append(System.getProperty("line.separator") + "Text: " + System.getProperty("line.separator"));
170+
buf.append(getText()).append(System.getProperty("line.separator"));
171171

172172
return buf.toString();
173173
}

Server/src/org/openas2/processor/storage/MDNFileModule.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,31 @@ protected InputStream getMDNStream(MessageMDN mdn) throws IOException {
5656
StringBuffer mdnBuf = new StringBuffer();
5757

5858
// write headers to the string buffer
59-
mdnBuf.append("Headers:\r\n");
59+
mdnBuf.append("Headers:" + System.getProperty("line.separator"));
6060

6161
Enumeration<String> headers = mdn.getHeaders().getAllHeaderLines();
6262
String header;
6363

6464
while (headers.hasMoreElements()) {
6565
header = headers.nextElement();
66-
mdnBuf.append(header).append("\r\n");
66+
mdnBuf.append(header).append(System.getProperty("line.separator"));
6767
}
6868

69-
mdnBuf.append("\r\n");
69+
mdnBuf.append(System.getProperty("line.separator"));
7070

7171
// write attributes to the string buffer
72-
mdnBuf.append("Attributes:\r\n");
72+
mdnBuf.append("Attributes:" + System.getProperty("line.separator"));
7373

7474
Iterator<Map.Entry<String,String>> attrIt = mdn.getAttributes().entrySet().iterator();
7575
Map.Entry<?, String> attrEntry;
7676

7777
while (attrIt.hasNext()) {
7878
attrEntry = attrIt.next();
7979
mdnBuf.append(attrEntry.getKey()).append(": ");
80-
mdnBuf.append(attrEntry.getValue()).append("\r\n");
80+
mdnBuf.append(attrEntry.getValue()).append(System.getProperty("line.separator"));
8181
}
8282
// finaly, write the MDN text
83-
mdnBuf.append("Text:\r\n");
83+
mdnBuf.append("Text:" + System.getProperty("line.separator"));
8484
mdnBuf.append(mdn.getText());
8585

8686
return new ByteArrayInputStream(mdnBuf.toString().getBytes());

Server/src/org/openas2/processor/storage/MessageFileModule.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,28 +74,28 @@ protected InputStream getHeaderStream(Message msg) throws IOException {
7474
StringBuffer headerBuf = new StringBuffer();
7575

7676
// write headers to the string buffer
77-
headerBuf.append("Headers:\r\n");
77+
headerBuf.append("Headers:" + System.getProperty("line.separator"));
7878

7979
Enumeration<String> headers = msg.getHeaders().getAllHeaderLines();
8080
String header;
8181

8282
while (headers.hasMoreElements()) {
8383
header = (String) headers.nextElement();
84-
headerBuf.append(header).append("\r\n");
84+
headerBuf.append(header).append(System.getProperty("line.separator"));
8585
}
8686

87-
headerBuf.append("\r\n");
87+
headerBuf.append(System.getProperty("line.separator"));
8888

8989
// write attributes to the string buffer
90-
headerBuf.append("Attributes:\r\n");
90+
headerBuf.append("Attributes:" + System.getProperty("line.separator"));
9191

9292
Iterator<Map.Entry<String,String>> attrIt = msg.getAttributes().entrySet().iterator();
9393
Map.Entry<String,String> attrEntry;
9494

9595
while (attrIt.hasNext()) {
9696
attrEntry = attrIt.next();
9797
headerBuf.append(attrEntry.getKey()).append(": ");
98-
headerBuf.append(attrEntry.getValue()).append("\r\n");
98+
headerBuf.append(attrEntry.getValue()).append(System.getProperty("line.separator"));
9999
}
100100

101101
return new ByteArrayInputStream(headerBuf.toString().getBytes());

Server/src/org/openas2/test/MimeBodyPartEncodingTest.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,34 @@ public static void main(String[] args)
4545
System.setProperty("org.apache.commons.logging.Log", "org.openas2.logging.Log");
4646
//System.setProperty("openas2log.properties", "Server/bin/openas2log.properties");
4747
LogFactory.getFactory().setAttribute("level", "TRACE");
48-
System.out.println("Current working directory: " + System.getProperty("user.dir") + "\n");
49-
System.out.println("Logging prop: " + System.getProperty("org.apache.commons.logging.Log") + "\n");
48+
System.out.println("Current working directory: " + System.getProperty("user.dir") + System.getProperty("line.separator"));
49+
System.out.println("Logging prop: " + System.getProperty("org.apache.commons.logging.Log") + System.getProperty("line.separator"));
5050
File f = new File(TestConfig.TEST_OUTPUT_FOLDER);
5151
f.mkdirs();
5252

5353
try
5454
{
55-
write(Session.TITLE + "\r\nStarting test...\r\n");
55+
write(Session.TITLE + System.getProperty("line.separator") + "Starting test..." + System.getProperty("line.separator"));
5656

5757
// create the OpenAS2 Session object
5858
// this is used by all other objects to access global configs and
5959
// functionality
60-
write("Loading configuration...\r\n");
60+
write("Loading configuration..." + System.getProperty("line.separator"));
6161
String configFile = "Server/config/config.xml";
6262
if (args.length == 1)
6363
{
6464
configFile = args[0];
6565
}
6666
else if (args.length > 1)
6767
{
68-
write("Current working directory: " + System.getProperty("user.dir") + "\n");
69-
write("Usage:\r\n");
70-
write("java org.openas2.app.OpenAS2Server <configuration file>\r\n");
68+
write("Current working directory: " + System.getProperty("user.dir") + System.getProperty("line.separator"));
69+
write("Usage:" + System.getProperty("line.separator"));
70+
write("java org.openas2.app.OpenAS2Server <configuration file>" + System.getProperty("line.separator"));
7171
throw new Exception("Missing configuration file");
7272
}
7373
session = new XMLSession(configFile);
7474
// Do the deed...
75-
write("Entering test phase....\r\n");
75+
write("Entering test phase...." + System.getProperty("line.separator"));
7676
Message msg = new AS2Message();
7777
getPartnerInfo(msg);
7878
// update the message's partnership with any stored information
@@ -81,7 +81,7 @@ else if (args.length > 1)
8181
write("Partnership attributes:\n" + msg.getPartnership().getName());
8282
for (String key : attribs.keySet())
8383
{
84-
write("\t" + key + " ::= " + attribs.get(key) + "\n");
84+
write("\t" + key + " ::= " + attribs.get(key) + System.getProperty("line.separator"));
8585
}
8686

8787
msg.setAttribute(FileAttribute.MA_FILEPATH, TestConfig.TEST_SOURCE_FOLDER);
@@ -107,7 +107,7 @@ else if (args.length > 1)
107107
String contentTxfrEncoding = msg.getPartnership().getAttribute(Partnership.PA_CONTENT_TRANSFER_ENCODING);
108108
if (contentTxfrEncoding == null)
109109
contentTxfrEncoding = Session.DEFAULT_CONTENT_TRANSFER_ENCODING;
110-
write("Using Content-Transfer-Encoding: " + contentTxfrEncoding + "\n");
110+
write("Using Content-Transfer-Encoding: " + contentTxfrEncoding + System.getProperty("line.separator"));
111111
body.addHeader("Content-Transfer-Encoding", contentTxfrEncoding);
112112

113113
msg.setData(body);
@@ -163,17 +163,17 @@ else if (args.length > 1)
163163
} finally
164164
{
165165

166-
write("OpenAS2 test has shut down\r\n");
166+
write("OpenAS2 test has shut down." + System.getProperty("line.separator"));
167167

168168
System.exit(exitStatus);
169169
}
170170
}
171171

172172
public static void write(OutputStream os, MimeBodyPart mbp) throws MessagingException, IOException
173173
{
174-
os.write("\n========BEGIN MIMEBODYPART=========\n".getBytes());
174+
os.write((System.getProperty("line.separator") + "========BEGIN MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes());
175175
mbp.writeTo(os);
176-
os.write("\n========END MIMEBODYPART=========\n".getBytes());
176+
os.write((System.getProperty("line.separator") + "========END MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes());
177177
}
178178

179179
public static void write(String msg)

changes.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 2.1.3 - 2016-11-09
2+
This release is a bugfix release:
3+
1. Revert to default for allowing restricted HTTP headers (see OpenAS2HowTo for discussion on this issue)
4+
2. Remove \r (CR) character from logging and use the the system property to avoid issues on NIX based systems that parse logs
5+
3. Enhance documentation
6+
17
Version 2.1.2 - 2016-10-29
28
This release is a bugfix release:
39
1. Swap call to scan directory with the tracking processing call to ensure there is at least one full poll interval between scan and call to tracking processing to avoid sending incomplete files.

docs/OpenAS2HowTo.odt

1.71 KB
Binary file not shown.

docs/OpenAS2HowTo.pdf

6.65 KB
Binary file not shown.

0 commit comments

Comments
 (0)