as windows service?

AdamCox,
m-e-c as2 is no client-server system, the GUI is part of the product. That is why I am curious if this could work.
Anyway I would recomment the Tanuki Service Wrapper for such an attempt.
Could you please post your experiences if you have tried it?
Regards
Heller

I am working on getting this wrapper to work on windowsXP
I used the jboss integration method.
Followed the integration instructions from wrapper. basically copy all wrapper files into jboss. launch wrapper which will launch jboss and AS2 (through config file)
I get the jboss to run without error, and a service installed into windows services.msc. The service starts but nothing happens. When I look at the log file I notice that I get some excetions.
-Jboss runs on tcp 8080
-Some errors with jvm_bind.
-problems acessing port 4444 and up
-jboss:service=WebService
We run coldfusion and that was already conflicting the RMI port (I edited the RMI port via instructions in this forum)
Also, changed the listening port off of 8080.
If I can't get this figured out in a reasonable amount of time I may fall to the TweakUI (IT will probably not like a sever auto-logging in though)
I am still hopeful this will work, but now its just finding all the little conflicts and fixing them. I will keep you updated on my progress
ok... I obviously have no idea what I am doing... jboss was an example setup if I want to use jboss (which I don't)
so, the setup was hugely different.
I edited a few batch files as well as the conf file.
The service installed and the application ran fine through the runapp.bat file.
But when I start the service, the app doesn't start..
Here is part of the conf file that I changed (I don't see an file upload, so I'll paste it in line)
#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.java.command=java
# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=lib/wrapper.jar
wrapper.java.classpath.2=mec_as2.jar
wrapper.java.classpath.3=jetty/start.jar
wrapper.java.classpath.4=jlib/activation.jar
wrapper.java.classpath.5=jlib/bcmail-jdk16-136.jar
wrapper.java.classpath.6=jlib/bcprov-jdk16-136.jar
wrapper.java.classpath.7=jlib/commons-codec-1.3.jar
wrapper.java.classpath.8=jlib/commons-httpclient-3.0.1.jar
wrapper.java.classpath.9=jlib/commons-logging.jar
wrapper.java.classpath.10=jlib/dbgrid-1.0.4.jar
wrapper.java.classpath.11=jlib/help4-nls.jar
wrapper.java.classpath.12=jlib/help4.jar
wrapper.java.classpath.13=jlib/hsqldb.jar
wrapper.java.classpath.14=jlib/javamail-1.3.jar
wrapper.java.classpath.15=jlib/ohj-jewt.jar
wrapper.java.classpath.16=jlib/oracle_ice5.jar
wrapper.java.classpath.17=jlib/xalan_2_6_0.jar
wrapper.java.classpath.18=jlib/xerces_2_6_2.jar
wrapper.java.classpath.19=jlib/xml-apis.jar
wrapper.java.classpath.20=jlib/jms/activation.jar
wrapper.java.classpath.21=jlib/jms/commons-logging-api.jar
wrapper.java.classpath.22=jlib/jms/jakarta-regexp-1.2.jar
wrapper.java.classpath.23=jlib/jms/JCup.jar
wrapper.java.classpath.24=jlib/jms/jgroups-all.jar
wrapper.java.classpath.25=jlib/jms/jms.jar
wrapper.java.classpath.26=jlib/jms/jmxri.jar
wrapper.java.classpath.27=jlib/jms/jmxtools.jar
wrapper.java.classpath.28=jlib/jms/jndi.jar
wrapper.java.classpath.29=jlib/jms/joram-client.jar
wrapper.java.classpath.30=jlib/jms/joram-config.jar
wrapper.java.classpath.31=jlib/jms/joram-connector.jar
wrapper.java.classpath.32=jlib/jms/joram-gui.jar
wrapper.java.classpath.33=jlib/jms/joram-kclient.jar
wrapper.java.classpath.34=jlib/jms/joram-mom.jar
wrapper.java.classpath.35=jlib/jms/joram-raconfig.jar
wrapper.java.classpath.36=jlib/jms/joram-shared.jar
wrapper.java.classpath.37=jlib/jms/jta.jar
wrapper.java.classpath.38=jlib/jms/kxml.jar
wrapper.java.classpath.39=jlib/jms/mail.jar
wrapper.java.classpath.40=jlib/jms/midpapi.jar
wrapper.java.classpath.41=jlib/jms/ow_monolog.jar
wrapper.java.classpath.42=jlib/jms/soap.jar
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=lib
# Java Additional Parameters
#wrapper.java.additional.1=
# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3
# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64
# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=de.mendelson.comm.as2.AS2
a couple things that I did on my server.
-downloaded the zip
-changed the RMI port to something else. I have to because we also have coldfusion server running on this machine which already has the RMI port taken.
-installed the JCE into two places
installing wrapper.
put the .bat files into \as2
put in \conf into \as2\conf (containing wrapper.conf)
put wrapper.exe into \as2
put \lib into \as2\lib
changed the log to goto the as2 "log" folder instead of "logs"
ran installapp-NT.bat
started the app and had no problem.
hints:
seems to only work with the .zip of mec_as2(I'm using b.17)
all as2 jars must be in the wrapper.conf file
There is probably more, but this was spread out a couple weeks, but this should be enough to get someone started.
good luck

superb, thank your for this great job and all your effort!
Regards
Heller
Adam/heller,
Would you consider sharing the setup files and making this part of the install options or install files/documentation?
I think it would be very beneficial to many users.
Regards.


Adam,
thank you. I received your manual and added it the online documentation of m-e-c as2.
If anybody else has some kind of documentation/hints that he wants to be added to the documentation of m-e-c as2 please feel free to send it to me, I will add it.
Regards
Heller
Hi,
I could install the windows service as described. But when I try to start the service nothing happens. if i try to start the service from the console I get the following output:
wrapper | Starting the MECAS2 service...
wrapper | The MECAS2 service was launched, but failed to start.
Press any key to continue . . .
I have no idea what does not work correctly... Any idea??? Is there any other way to run the server as a service?
Thanks
Nabster-
the error message that you are getting is pretty vague. I think that wrapper makes a log file. if thats so, you may be able to find specific information about 'why' if failed.
I assume you've read over my "I think I got it" post? That has all the changes I made to MEC to make it run as a service.
big things were that it has to use the .bat file from the source rather than the compiled exe. Also, all the jar files must be specified in the wrapper bat file you can see those in the "screwed up" post in this thread.
I sent in write-up of what I did. I'm not sure if Heller has a link to that or not.
-=Adam=-
When running as a service you lose the GUI. But, you still get the webservice. I am able to monitor incmoing/outgoing documents this way. basically the only thing I lose out is adding in trading partners and configuring.
When our load and trading partners starts to expand I may start to feel differently about having to shut down the service to add in a trading partner, but now its fine. We are expecting to add in 40 trading partners over the course of the year. We'll see how it holds ;)

Thank you Adam for your reply.
You describe a very important problem in the architecture that has been discussed already several times in this forum. I hope we fixed it now - we added a framework around the APACHE MINA project to separate client and server for m-e-c as2, this seems to work fine. The next release will have separated client and server classes, means the server will contain no more GUI parts and could be started as service without the GUI/display problem.
This should fix the issue you mentioned, the client could then connect to the server service any time and could be closed separatly after the configuration has been done.
Regards
Heller
Thats exciting news. I haven't been able to update my AS2 because of all the changes I made to my running version, plus not much time. Once this build you're talking about is released I'll look into migrating over to that.
Which build numbers would those be? b.21 has Mina? and the next release will have the separated server/client?
-Adam

Adam,
build 21 contains MINA, it has been used to separate the client classes from the server classes. Its possible with this code to run the server standalone and attach a client to it. The installer installs an executable that first starts the server and then the client.
If you want to start the server/client each by itself please add a wrapper class/script or something, these are the classes to start:
Client:
de.mendelson.comm.as2.client.AS2Gui
Server:
de.mendelson.comm.as2.server.AS2Server
Regards
Heller
I have been successfully able to run AS2 as a service using the Java Service Wrapper and am in the process of separating the GUI from the backend. I'll let you know how it goes. I'm still running build 11. I haven't migrated to later versions because of all the custom code I"ve put in. I have added a standalone certificate manager interface as part of the GUI to easily import/remove certificates from the certificate store. Also I have added in a DB manager as well to create custom tables (similar to SQL Server's Enterprise Manager)
I didn't really want to have to add in all must custom code and classes to a later version, so I've stayed with build 11. If this is successful, I will post details on how to separate server from GUI for those of you who have versions of mecAS2 without the MINA framework.
thanks
I wasn't able to get this to work until I changed the line:
wrapper.app.parameter.1=de.mendelson.comm.as2.AS2
to:
wrapper.java.mainclass=de.mendelson.comm.as2.AS2
Before the change it would try to launch "Main" instead of de.mendelson.comm.as2.AS2
© 1999-2008 mendelson-e-commerce GmbH. All right reserved.
I was wondering if anyone has been able to set MEC AS2 as a windows service. If the server restarts someone has to log onto the desktop for the application to start (in startup folder)
I have looked at using srvany.exe from Microsoft's reskit, to make a user defined service. After configuring it the service starts without error, but the AS2 app never starts.
Has anyone out there got MEC AS2 to run as a windows serivce?
Thanks!
Adam