Running mec as2 as a server

You are here

Running mec as2 as a server

17 posts / 0 new
Last post
dawid.duda
dawid.duda's picture
Running mec as2 as a server

Hello,

I would like to run mec as2 as a server on Linux. The problem I see is that it is a desktop application, while I would need it to run in some kind of batch mode - automaticly take files from some place and send them to partners, receive files from partners and put them to some place.

Do you know any way to make it possible except taking sources from CVS and introducing modifications required to fulfill my requirements? If it is possible to do this only by source code modifications, then could you please provide some documentation about general source tree overview so I could easly find the classes I need to build up such a solution?

Best regards,

Dawid Duda

heller
heller's picture

Dawid,

even if m-e-c as2 seems to be a desktop application it is just a monitoring and configuration GUI on top of a stand alone server. This server polls for files in special directories (partner specific).
Received files will put into inbox directories, also partner specific.

Does this help or would you like to run the server on a system that has not even an Xwindows installed?

Regards
Heller

macieh
macieh's picture

Is it possible to run m-e-c as2 on server without Xwindows installed?
Could you give some information how to do it the best possible way.

Thanks!

--
Best Regards
macieh

heller
heller's picture

macieh,

if you would like to run m-e-c as2 on a dedicated server that has no xwindows installed and would like to monitor/configure from another computer that has a xserver running I recommend xvnc.

Regards
Heller

melson
melson's picture

Hi i hav installed m-e-c from internet n its GUI screen is commin with which i m able to send the file. but how to read this file now n where this file is physically located.....

thanx in advace for answering my Querries n if u hav ne other tips for me regarding m-e-c-AS2 u r welcome :-)

ftumsh
ftumsh's picture

Doesn't the xvnc server have to be running on a server that has X installed?!

nschmidt
nschmidt's picture

To quote the Xvnc man page:
Xvnc is the X VNC (Virtual Network Computing) server. It is based on a standard X server, but it has a "virtual" screen rather than a physical one. X applications display themselves on it as if it were a normal X display, but they can only be accessed via a VNC viewer - see vncviewer(1).
So Xvnc is really two servers in one. To the applications it is an X server, and to the remote VNC users it is a VNC server. By convention we have arranged that the VNC server display number will be the same as the X server display number, which means you can use eg. snoopy:2 to refer to display 2 on machine "snoopy" in both the X world and the VNC world.

The best way of starting Xvnc is via the vncserver script. This sets up the environment appropriately and runs some X applications to get you going. See the manual page for vncserver(1) for more information.

tukeme
tukeme's picture

my feeling is that Xvnc doesn't solve the basic problem;
in fact, we tried it ..and ..
when you stop the machine with X11, where the virtual screen has been running, automatically the process running on the server (machine without X11) deads ...
this means that we need to maintain alive TWO MACHINES instead of only one !
If am am wrong, please clarify me ..
thanks .

heller
heller's picture

tukeme,

our dedicated AS2 test server runs with the same configuration using xvnc and we have no problem.

As nschmidt wrote, xvnc acts as xserver to the application. You redirect the m-e-c as2 output to the xvnc. From outside you just need to have a VNC client to access this screen.

That means, there are not two machines to maintain. On the client machine you just need a VNC client, could be any OS. On the server machine without Xwindows you install m-e-c as2 and xvnc.

Regards
Heller

martijn
martijn's picture

I realize this post is a bit outdated but i happened to stumble across it when looking for a way to run without display.

I solved this for us (on linux that is):

1. install Xvfb
2. go to runlevel 3 (no x server should be running)
3. run $ /usr/bin/Xvfb :0.0 (from an init.d script or with nohup etc, whatever suits you)
4. you might need to set xhost (xhost + ipaddress or just xhost + all together :P)

before you start mec-as2:
5. export DISPLAY=:0.0 (or whatever you set the display to in step 3)
6. start mec-as2

and off you go...

Meddy
Meddy's picture

Hi all,

My AS2 connection is ok, mec_as2 works very well between my two partners.
Only one issue :
Mec_as2 seem to stop working it seem having a time out so every days a must restart mec_as2 to get all files.
I don't know how to make it run in background.

Thanks a lot for you answers!

heller
heller's picture

Meddy,

what exactly happens? Is the process just away or does it hang? Or does m-e-c as2 no longer poll directories/accept messages?
Are you accessing the system via a remote session on windows?

Please give me more details.

Regards
Heller

Meddy
Meddy's picture

Hi heller,

mec_ as2 no longer poll directories/accept messages.
When the interface is openned , all is ok (https tranmissions). After on day for example, when a come back to the server (windows) i find mec_as2 interface closed, and that's the reason why the files sent by a partners aren't received.
mec-as2 is on a windows server and i'm accession via microsoft terminal server. After a time the soft mec is closed like if someone was closing the window of mec-as2 (but nobody touch this).
It seem to have a time out or something like that.

heller
heller's picture

Meddy,

this seems to be a windows terminal server issue. Please have a look at the thread http://www.mec-community.com/node/179

Regards
Heller

Rahul
Rahul's picture

Hi -

I have installed mec AS2 on linux, and using realVNC to see the interface on windows. I left my AS2 running last night, but today when i logged in to the VNC session I see that mec AS2 is hung. does it cause any problem if i keep it running, what is recommended, how often shall we restart mec as2?

Regards
Rahul

heller
heller's picture

Rahul,

our AS2 testserver at http://as2.mendelson-e-c.com:8080/as2 runs without restarting it periodically, we only shut it down to update to a newer version.
We hadnt this problem so far, are there any additional information?

Regards
Heller

uniks
uniks's picture

Hi,

I'm using mec AS2 on a linux server without X installed. To start it without a X windows, I wrote a little patch (switch -nogui added).
Maybe this could be included into the release ? :)
Then in mendelson_as2_start.sh I chenaged:
java -Xmx192M -Xms92M -classpath $CLASSPATH de.mendelson.comm.as2.AS2
to:
java -Xmx192M -Xms92M -classpath $CLASSPATH de.mendelson.comm.as2.AS2 -noGUI

--- de/mendelson/comm/as2/AS2.java 2009-12-18 12:59:10.000000000 +0100
+++ de/mendelson/comm/as2/AS2.java 2009-12-18 13:01:09.000000000 +0100
@@ -41,12 +41,16 @@
public static void main(String args[]) {
String language = null;
boolean startHTTP = true;
+ boolean startGUI = true;
int optind;
+ Splash splash = null;
for (optind = 0; optind < args.length; optind++) {
if (args[optind].toLowerCase().equals("-lang")) {
language = args[++optind];
}else if (args[optind].toLowerCase().equals("-nohttpserver")) {
startHTTP = false;
+ }else if (args[optind].toLowerCase().equals("-nogui")) {
+ startGUI = false;
} else if (args[optind].toLowerCase().equals("-?")) {
AS2.printUsage();
System.exit(1);
@@ -58,6 +62,9 @@
System.exit(1);
}
}
+ if (startGUI) {
+ splash = new Splash("/de/mendelson/comm/as2/client/Splash.jpg");
+ }
//load language from preferences
if (language == null) {
PreferencesAS2 preferences = new PreferencesAS2();
@@ -77,15 +84,18 @@
System.exit(1);
}
}
- Splash splash = new Splash("/de/mendelson/comm/as2/client/Splash.jpg");
- AffineTransform transform = new AffineTransform();
- splash.setTextAntiAliasing(false);
- transform.setToScale(1.0, 1.0);
- splash.addDisplayString(new Font("Verdana", Font.BOLD, 11),
- 7, 262, AS2ServerVersion.getProductName() + " " + AS2ServerVersion.getVersion() + " " + AS2ServerVersion.getBuild(),
- new Color(0x65, 0xB1, 0x80), transform);
- splash.setVisible(true);
- splash.toFront();
+
+ if (startGUI) {
+ AffineTransform transform = new AffineTransform();
+ splash.setTextAntiAliasing(false);
+ transform.setToScale(1.0, 1.0);
+ splash.addDisplayString(new Font("Verdana", Font.BOLD, 11),
+ 7, 262, AS2ServerVersion.getProductName() + " " + AS2ServerVersion.getVersion() + " " + AS2ServerVersion.getBuild(),
+ new Color(0x65, 0xB1, 0x80), transform);
+ splash.setVisible(true);
+ splash.toFront();
+ }
+
//start server
try {
//register the database drivers for the VM
@@ -94,16 +104,17 @@
BCCryptoHelper helper = new BCCryptoHelper();
helper.initialize();
AS2Server as2Server = new AS2Server(startHTTP);
- AS2Agent agent = new AS2Agent( as2Server );
} catch (Throwable e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, e.getClass().getName() + ": " + e.getMessage());
System.exit(1);
}
- //start client
- AS2Gui gui = new AS2Gui(splash);
- gui.setVisible(true);
- splash.destroy();
- splash.dispose();
+ if (startGUI) {
+ //start client
+ AS2Gui gui = new AS2Gui(splash);
+ gui.setVisible(true);
+ splash.destroy();
+ splash.dispose();
+ }
}
}