opened
DevDef
username_0
Hi Christopher,

I’ve just built a new RPM for CentOS 7 with the latest version of OpenAS2 (2.6.4), but the variable `$properties.storageBaseDir$` inside the `config.xml` file is not interpreted. A wrong directory is created with the name of the variable, i.e. “`$properties.storageBaseDir$`”, so I have to use full path instead.

Regards,

Davy
$properties.storageBaseDir$ not interpreted on GNU/Linux
issue
created
uhurusurfa
username_1
Hmmm ... that is porcessed by Java so should have no dependency on deployed OS at all. 
Can you confirm the version of Java you are running?
comment
created
DevDef
username_0
This is an up to date CentOS 7 64-bit server with an OpenJDK provided by the distro:
```
$ java -version
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_201-b09)
OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)
```
```
$ rpm -qi java-1.8.0-openjdk
Name        : java-1.8.0-openjdk
Epoch       : 1
Version     : 1.8.0.191.b12
Release     : 1.el7_6
Architecture: x86_64
Install Date: mar. 19 févr. 2019 16:09:46 CET
Group       : Development/Languages
Size        : 512978
License     : ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib
Signature   : RSA/SHA256, mar. 20 nov. 2018 21:35:25 CET, Key ID 24c6a8a7f4a80eb5
Source RPM  : java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.src.rpm
Build Date  : lun. 19 nov. 2018 17:54:31 CET
Build Host  : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://openjdk.java.net/
Summary     : OpenJDK Runtime Environment
Description :
The OpenJDK runtime environment.
```
comment
created
uhurusurfa
username_1
Can you provide the sample config.xml?
comment
created
DevDef
username_0
It was more or less [this one](https://github.com/OpenAS2/OpenAs2App/blob/master/Server/src/config/config.xml), but with `storageBaseDir="/var/lib/openas2"`.
comment
created
uhurusurfa
username_1
Can you confirm if this is the same using 2.7.0 just released?
comment
created
DevDef
username_0
Still the same with OpenAS2 2.7.0. :-(
comment
created
uhurusurfa
username_1
I just ran OpenAS2 2.7.0 on a docker instance of CentOS 7 on my Mac and could not replicate the issue:
`
[root@f3f3b1992f61 bin]# sh start-openas2.sh

Running /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java -Xms32m -Xmx384m -Dorg.apache.commons.logging.Log=org.openas2.logging.Log -Dopenas2.config.file=/openas2/bin/../config/config.xml -cp .:/openas2/bin/../lib/* org.openas2.app.OpenAS2Server

2019-03-04 20:21:51.049 FINE OpenAS2Server: Retrieving config file...
2019-03-04 20:21:51.150 FINE XMLSession: Loading configuration...
2019-03-04 20:21:51.151 FINE XMLSession: Loading properties...
2019-03-04 20:21:51.771 FINE XMLSession: Loading partnerships...
2019-03-04 20:21:51.786 FINE XMLSession: Loading log manager(s)...
2019-03-04 20:21:51.801 FINE XMLSession: Loading command processor(s)...
2019-03-04 20:21:51.899 FINE XMLSession: Loading processor modules...
2019-03-04 20:21:51.909 FINE IOUtil: Created directory /openas2/bin/../config/../data/toAny
2019-03-04 20:21:51.910 FINE IOUtil: Created directory /openas2/bin/../config/../data/toAny/error
2019-03-04 20:21:51.911 FINE IOUtil: Created directory /openas2/bin/../config/../data/pendinginfoMDN3
2019-03-04 20:21:51.912 FINE IOUtil: Created directory /openas2/bin/../config/../data/pendingMDN3
2019-03-04 20:21:51.913 FINE IOUtil: Created directory /openas2/bin/../config/../data/toOpenAS2A
2019-03-04 20:21:51.913 FINE IOUtil: Created directory /openas2/bin/../config/../data/toOpenAS2A/error
2019-03-04 20:21:51.914 FINE IOUtil: Created directory /openas2/bin/../config/../data/toOpenAS2B
2019-03-04 20:21:51.915 FINE IOUtil: Created directory /openas2/bin/../config/../data/toOpenAS2B/error
2019-03-04 20:21:51.937 FINE OpenAS2Server: Shutdown hook registered.
2019-03-04 20:21:51.938 FINE OpenAS2Server: Starting HttpComponents Apache HttpClient v1.59.0...
2019-03-04 20:21:51.940 FINE DefaultProcessor: AS2DirectoryPollingModule started.
2019-03-04 20:21:51.942 FINE DefaultProcessor: AS2DirectoryPollingModule started.
2019-03-04 20:21:51.944 FINE DefaultProcessor: AS2DirectoryPollingModule started.
2019-03-04 20:21:52.108 FINE DefaultProcessor: DbTrackingModule started.
2019-03-04 20:21:52.115 FINE DefaultProcessor: AS2ReceiverModule started.
2019-03-04 20:21:52.116 FINE DefaultProcessor: AS2MDNReceiverModule started.
2019-03-04 20:21:52.118 FINE DefaultProcessor: DirectoryResenderModule started.
2019-03-04 20:21:52.118 FINE DefaultProcessor: 7 active module(s) started.
2019-03-04 20:21:52.119 FINE IOUtil: Created directory /openas2/bin/../config/../data/resend
2019-03-04 20:21:52.119 FINE OpenAS2Server: HttpComponents Apache HttpClient v1.59.0 started.
^C2019-03-04 20:22:41.689 FINE DefaultProcessor: AS2DirectoryPollingModule stopped.
2019-03-04 20:22:41.690 FINE DefaultProcessor: AS2DirectoryPollingModule stopped.
2019-03-04 20:22:41.691 FINE DefaultProcessor: AS2DirectoryPollingModule stopped.
2019-03-04 20:22:41.692 FINE DefaultProcessor: DbTrackingModule stopped.
2019-03-04 20:22:41.693 FINE DefaultProcessor: AS2ReceiverModule stopped.
2019-03-04 20:22:41.694 FINE DefaultProcessor: AS2MDNReceiverModule stopped.
2019-03-04 20:22:41.695 FINE DefaultProcessor: DirectoryResenderModule stopped.
2019-03-04 20:22:41.695 FINE DefaultProcessor: 7 active module(s) stopped.
2019-03-04 20:22:41.696 FINE OpenAS2Server: OpenAS2 has shut down

[root@f3f3b1992f61 bin]# uname -r
4.9.125-linuxkit
[root@f3f3b1992f61 bin]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[root@f3f3b1992f61 bin]# ls ../
OpenAS2HowTo.pdf  RELEASE-NOTES.md  bin  changes.txt  config  data  lib  logs  resources
[root@f3f3b1992f61 bin]#`

Any possibility you could try to debug on your machine?
There is a Junit test that tests the replacement by invoking the method that does the work directly so maybe try running the unit test to see if it passes: Server/src/test/java/org/openas2/util/XMLUtilTest.java
If the Junit test passes then I am guessing thet the property parser is not working as expected.
comment
created
DevDef
username_0
As you now have a CentOS 7 box, could you give a try to my RPM?
I send you the URLs privately…
comment
created
uhurusurfa
username_1
Yes sure
comment
created
DevDef
username_0
There was an old version of OpenAS2 jar file in the classpath. Shame on me!
Many thanks to you Christopher for spending your precious time on a so stupid problem.
At least, the little changes you made will improve the code, with a better detection of the OpenAS2 jar file. ;-)
comment
closed
DevDef
username_0
issue