Hi, I find some James embedding example on this url, Embeddable James, but I don't really get how to relate, the refined MAIN class of author (the args argument) and the servlet code 9inside what args variable has been used).? This is the code of lunchJAMES servlet:
and this is working version of Main with functions that were added or modified :
Is this way of embedding achievable ( I also find some quite obscure means of James embedding in association with Spring) ?>
This seems to use separate classloaders for James; is that necessary in your case? I'd just drop all the libraries into WEB-INF/lib, and use a context listener to start a background thread that calls the standard main method.
No of course, it's not necessary but was the only example of embedding James. So, you suggest to copy each libraries from james source (there is few lib. folders containing many libraries. Do I need some particular like phoenix-loader.jar), and in the web.xml ( I'm gonna try to add it into .war apps. to place something like this :
and in the class MyContextListener, to do somthing like this :
yeah? But nothing's happens.. I cannot send messages between users (probably because James hasn't started).I wrote this testing listener:
and this mapping ;
When I type address http://www.localhost.com:8080/James_Test/, the Welcome.jsp page would open, and nothing ( I believe that myListener class should be invoked on servletcontext startup, and create instance of Main class. Probably I need to invoke some method of James (like I start it from command line typing run.bat). If so, what is that method?
One more thing. In my application lib-folder, I store only phoenix-xxx.jar, jar files and mx4j-tools.jar. If I include all from JAMES_HOME/lib, and JAMES_HOME/tools, and JAMES_HOME/bin/lib, I continuously receive an exception and failed deployment of application...
I even monitor number of processes when I start server, and no more is added (unlike when I start James by command prompt).
The number of processes wouldn't change, because it runs inside the JVM (which is just one process).
The connection to the server has failed. Account: '127.0.0.1', Server: '127.0.0.1', Protocol: POP3, Port: 110, Secure(SSL): No, Socket Error: 10061, Error Number: 0x800CCC0E
Not sure what that's trying to tell us, but it sure doesn't look good. But "Account: '127.0.0.1'" looks particularly strange, as if the code were using "127.0.0.1" for the username.
In my application lib-folder, I store only phoenix-xxx.jar, jar files and mx4j-tools.jar. If I include all from JAMES_HOME/lib, and JAMES_HOME/tools, and JAMES_HOME/bin/lib, I continuously receive an exception and failed deployment of application...
I'd expect all jar files to be needed; if there are exceptions I'd start by tracking those down. It's possible that there are version conflicts with other jar files your code -or the servlet engine- uses.
You could also make this a separate web app, independent of the one that runs your other application code.
well, 127.0.0.1, was name of account nothing special. I have change it. I've delete applications from Tomcat's deployment directory, so this is the only. There is something wrong about some arguments, and excalibur.jar I have nowhere on my classpath. I just have configured PHOENIX_HOME environment variable. This is the stack trace ;