Problems starting up mec AS2 on Mac OS X

Curlie
Curlie's picture

Hello,

I'm trying to built a little test network with two computers in a local network. I'm using one Windows XP computer an one iBook with Mac OS X 10.4.6.

I'm using the mec AS2 Version 1.0b5, JDK 1.5.x and extended JCE installed.

The installation wizard for Windows works pretty fine. I did a test on the Windows pc by changing the settings of the send and the receive URLs of both stations to http://localhost:8080/mec_as2/HttpReceiver, so I use the same Servlet for both stations. During sending a file I got the message, that the Receiver is not a local station on this computer. So that's what I expected.

Then I tried to start it up on my iBook.
I ran in some trouble with the shell-scripts to start up the application. I got a message about an error in the loop to built the classpath environment variable, but I was able to solve it by doing the loop manually.
After that the JETTY and the mec AS2 Client starts up.
Then I was trying to to the same test as I did on the Windows PC, but I was getting the following Exception:

Exception in the bash:

[Server@c80e21]: [Thread[Thread-4,5,main]]: putPropertiesFromString(): [port=3335;database.0=file:AS2_DB;silent=true;trace=false;
hsqldb.cache_scale=15;hsqldb.cache_file_scale=8;
no_system_exit=true;shutdownarg=COMPACT;]
[Server@c80e21]: [Thread[Thread-4,5,main]]: checkRunning(false) entered
[Server@c80e21]: [Thread[Thread-4,5,main]]: checkRunning(false) exited
Exception in thread "httpSendWorker1" java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
at org.apache.commons.httpclient.HttpMethodBase. (HttpMethodBase.java:217)
at org.apache.commons.httpclient.methods.ExpectContinueMethod. (ExpectContinueMethod.java:92)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod. (EntityEnclosingMethod.java:118)
at org.apache.commons.httpclient.methods.PostMethod. (PostMethod.java:105)
at de.mendelson.comm.as2.send.MessageHttpUploader.performUpload (Unknown Source)
at de.mendelson.comm.as2.send.MessageHttpUploader.send (Unknown Source)
at de.mendelson.comm.as2.send.HttpSendManager$SendWorker.run (Unknown Source)

Output to the logging section of the mec AS2 client:

[09:20:47] m-e-c AS2 1.0 build 4
[09:20:47] (c) 2000-2006 mendelson-e-commerce GmbH Berlin, Germany
[09:20:50] HSQL Database Engine 1.8.0 gestartet.
[09:20:58] Warteschlange fŸr SendeauftrŠge (Http/Https) gestartet.
[09:20:58] Manager zur VerzeichnisŸberwachung gestartet.
[09:20:58] VerzeichnisŸberwachung fŸr den Partner station2 wurde gestartet.
[09:20:58] Server gestartet in 11664 ms.
[09:21:48] Verarbeite die Datei "test_xml.xml" fŸr den EmpfŠnger "station2".
[09:21:49] mecAS2-1149578508732-81512@station1AS2_station2AS2: Die ausgehende Nachricht wurde digital signiert, benutzt wurde der SchlŸssel Alias "Key1".
[09:21:49] mecAS2-1149578508732-81512@station1AS2_station2AS2: Die ausgehende Nachricht wurde verschlŸsselt, benutzt wurde der SchlŸssel Alias "Key2".
[09:21:49] mecAS2-1149578508732-81512@station1AS2_station2AS2: Ausgehende Nachricht erstellt.

Here the application stops proceeding the message.

So what did I wrong?

Best regards

Tobias Hergenroether

--

Best regards

Tobias Hergenroether



heller
heller's picture
Decoder Exception

There seems to be a problem during decoding the message on your OS (perhaps base64, I am not sure).
The thrown exception class had not been found in the classpath.
Could you please add the commons codec package found at http://jakarta.apache.org/site/downloads/downloads_commons-codec.cgi
to your classpath? (You may need the commons logging package, too. I think there are dependencies.)
After adding it a more detailled error message should be available. At this point we could go further into finding the problem.

Anyway, did you encounter any problem while sending data to our as2 test server that could be contacted using the default configuration?

Regards
Heller



Curlie
Curlie's picture
Packages are available

Hello,

thanks for the quick reply, but I have to tell you, that all packages you mentioned are available.

The start command for mec AS2 is:

java -classpath .:mec_as2.jar : jetty/start.jar : jlib/activation.jar : jlib/bcmail-jdk15-131.jar : jlib/bcprov-jdk15-131.jar : jlib/commons-codex-1.3.jar : jlib/commons-fileupload-1.0.jar : jlib/commons-httpclient-3.0-rc3.jar : jlib/commons-logging.jar:jlib/help4-nls.jar : jlib/help4.jar : jlib/hsqldb.jar : jlib/javamail-1.3.jar : jlib/ohj-jewt.jar : jlib/oracle_ice5.jar : jlib/servlet-api.jar : jlib/xalan_2_6_0.jar : jlib/xerces_2_6_2.jar : jlib/xml-apis.jar de.mendelson.comm.as2.AS2

The blanks between the files are added by me due to better readability.
So, as you can see I'm adding all packages I found in $MECAS2_HOME/jlib plus the $MECAS2_HOME/mec_as2.jar and the $MECAS2_HOME/jetty/start.jar.

It is not possible to connect to the server of mendelson e-commerce GmbH, because I'm testing on test computers without any internet connection. If the installation on the iBook will run, then I'm able to test in a small network between the Windows pc and the iBook.

Best regards

Tobias Hergenroether

--

Best regards

Tobias Hergenroether



heller
heller's picture
Classpath

Tobias,

is this a typo in your classpath? The delivered jar name is "commons-codec-1.3.jar".

Regards
Stefan Heller



Curlie
Curlie's picture
My fault

I have to apologize!
My fault.
Now I'm getting the same error as I got in windows environment.

[17:21:11] m-e-c AS2 1.0 build 5
[17:21:11] (c) 2000-2006 mendelson-e-commerce GmbH Berlin, Germany
[17:21:13] HSQL Database Engine 1.8.0 gestartet.
[17:21:22] Warteschlange fŸr SendeauftrŠge (Http/Https) gestartet.
[17:21:22] Manager zur VerzeichnisŸberwachung gestartet.
[17:21:22] VerzeichnisŸberwachung fŸr den Partner mendelsontest wurde gestartet.
[17:21:23] Server gestartet in 11719 ms.
[17:22:02] Verarbeite die Datei "startmecas2.sh" fŸr den EmpfŠnger "mendelsontest".
[17:22:03] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Die ausgehende Nachricht wurde digital signiert, benutzt wurde der SchlŸssel Alias "Key1".
[17:22:04] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Die ausgehende Nachricht wurde verschlŸsselt, benutzt wurde der SchlŸssel Alias "Key2".
[17:22:04] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Ausgehende Nachricht erstellt.
[17:22:05] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Sende Nachricht an http://localhost:8080/mec_as2/HttpReceiver, erwarte asynchrone MDN zur EmpfangsbestŠtigung.
[17:22:05] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Eingehende †bertragung ist eine AS2 Nachricht.
[17:22:06] mecAS2-1149607325897-26745@mendelsontestAS2_mycompanyAS2: MDN erstellt, Status auf [processed/error: unexpected-processing-error] gesetzt.
[17:22:06] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2:
MDN Details:
--------------
Receiver of message (mendelsontestAS2) is not defined as the local station.
--------------
[17:22:06] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Nachricht erfolgreich versandt (HTTP 200).
[17:22:06] mecAS2-1149607323208-85466@mycompanyAS2_mendelsontestAS2: Warte auf asynchrone MDN bis 06.06.06 17:52:06.
[17:22:06] mecAS2-1149607325897-26745@mendelsontestAS2_mycompanyAS2: Sende asynchrone EmpfangsbestŠtigung (MDN) an http://localhost:8080/mec_as2/HttpReceiver.
[17:22:06] java.net.UnknownHostException: www.company.com
[17:22:06] mecAS2-1149607325897-26745@mendelsontestAS2_mycompanyAS2: HTTP -1
[17:22:07] null

Are this Log entries the same you would expect for my test environment description?

Thanks again for pointing up my error!

Best regards

Tobias Hergenroether

--

Best regards

Tobias Hergenroether



heller
heller's picture
Unknown host

Tobias,

The m-e-c as2 system defines one local station. If you send messages to yourself, there comes up the warning: "The receiver is not the local station". This is ok.
The second problem in your configuration is the async MDN url. If you set up the partner to send async MDN the system will not send the MDN on the incoming connection (as for sync MDN request) but will establish a new one.
The default MDN url "www.company.com" could not be connected and the http request comes back will a value "-1".

It should work if you connect both your computers and set up the partner crosswise, running on each of them one m-e-c as2 and a jetty.
After this you have to look after the right MDN URLs, AS2 ids and keys and could start exchanging messages.

Regards
Stefan Heller



tester
Hi Heller, You said: "It

Hi Heller,

You said:
"It should work if you connect both your computers and set up the partner crosswise, running on each of them one m-e-c as2 and a jetty".

When you run m-e-c as2 on each computer it will behave as an as2 server, right? Each of them is a jetty server, right? Or am I confusing everything?

Thanks in advance

John



heller
heller's picture
connecting 2 servers

John,

that is correct. You need to start a m-e-c as2 server with embedded http server (jetty in this case) on each machine you want to send or receive as2 messages with. Normally you dont have to care for the jetty server. It is embedded into the m-e-c as2 and will start up automatically.

After you started up m-e-c as2 you could point a browser to http://localhost:8080/mec_as2/HttpReceiver , the following message should appear in your browser that shows that the as2 server is up fine:
-------
m-e-c AS2 1.0 build 5
(c) 2000-2006 mendelson-e-commerce GmbH Berlin, Germany
You have performed an HTTP GET on this URL.
To submit an AS2 message, you must POST the message to this URL
-------

Now you could send as2 messages to this URL from the other server

Regards
Heller




© 1999-2008 mendelson-e-commerce GmbH. All right reserved.