Re: How to embed a server into openejb standard alone server
Hi David, Thanks for your reply. I think i might need the second option. Cause what my legacy server does is a kind of RPC invokation. So I need to embed it into openejb so that it could accept requests and map requests to specific session ejbs. If I understand correctly, i need to code up a container wrapper for it. Do you happen to know where I could find some references in order to do such things? Thanks a lot, Joe David Blevins wrote: On Jun 10, 2008, at 8:50 PM, xianzheng wrote: Hi all, I'm new to J2EE and OpenEJB. Just wondering, is there a way to embed an application server which is written in JAVA in openejb? I guess, I'll have to write a container to wrap it around? If so, is there a guide to write such thing? As my understanding, JCA can only allows ejbs to connect to other servers rather than listening connections? I have a very old server application i wrote, which complies a non- standard communication protocol. So i'm thinking whether i could embed it into openejb to listening to old request and benefit openejb's other cool features. Hi Joe, Depending on what you want to do exactly there are likely many ways to do it. It is possible to plug in new protocols into a standard OpenEJB install and support custom clients. It's very easy to drop something in that listens on a socket and does stuff. OpenEJB will find it on startup and hook it up as it does the other protocols. The stuff is where all the detail lies. Reflectively invoking proxies on the server side by looking them up from the local global JNDI (LocalInitialContextFactory) is easy, whereas sending invocations directly into the EJB Containers like the EJBd protocol does is harder. Can show you how to do that if it sounds like a route you might want to take. (you basically implement a specific interface then include a special properties file in your jar and drop it into openejb, pretty easy) If you have your own component container it is possible to add new custom containers to a standard OpenEJB install. This is a bit more involved but not completely impossible. The advantage here is that any container can be invoked by any of the protocols plugged into OpenEJB. Sounds like you want more the first option where you can add a new protocol. There are definitely options. Couple rounds of mutual data exchange (aka discussion) and I'm sure we can find a good game plan :) -David -- View this message in context: http://www.nabble.com/How-to-embed-a-server-into-openejb-standard-alone-server-tp17769556p17771513.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Antwort: Re: Antwort: Re: Antwort: Re: Re: maven build of openEJB3 [Virus checked]
Hi -dain the last build error I mailed in, was what it said it was, increasing the JAVA heap did the trick. I successfully compiled openejb3 ... mit freundlichen Grüßen/best regards Wolfgang Schrecker Der Inhalt eines Begriffs nimmt ab, wenn sein Umfang zunimmt; wird dieser allumfassend, so muß der Inhalt ganz verloren gehen. from G. Frege: Die Grundlagen der Arithmetik S. 40 -- -- Atos Worldline Processing GmbH Hahnstrasse 25 60528 Frankfurt/Main Germany Phone: +49 69/6657-1176 mailto:[EMAIL PROTECTED] http://www.atosworldline.com Geschäftsführer: Erik Munk Koefoed Aufsichtsratsvorsitzender: Didier Dhennin Sitz der Gesellschaft: Frankfurt/Main Handelsregister: Frankfurt/Main HRB 40 417 -- Atos Worldline Processing GmbH Hahnstraße 25 60528 Frankfurt/Main Germany Phone: +49 69/6657-1176 Fax : mailto: [EMAIL PROTECTED] http://www.atosworldline.com Geschäftsführer: Erik Munk Koefoed Aufsichtsratsvorsitzender: Didier Dhennin Sitz der Gesellschaft: Frankfurt/Main Handelsregister: Frankfurt/Main HRB 40 417 * * * * * * * * L E G A LD I S C L A I M E R * * * * * * * * This e-mail is destined for the above mentioned recipient. In case you received this e-mail by accident, we would appreciate it if you could contact the sender and delete all copies stored on your computer. Please be aware that the security and confidentiality of electronic data transmitted by e-mail is not completely guaranteed and that data may be seen, copied, downloaded or changed by third persons during transmission. Atos Origin accepts no liability for the security and confidentiality of data and documents sent by e-mail. Please make sure that all important messages will be confirmed in writing by means of a telefax or a letter. * * * * * * * * L E G A LD I S C L A I M E R * * * * * * * *
Re: Antwort: Re: Antwort: Re: Re: maven build of openEJB3 [Virus checked]
This would only be needed if the build fails (and it is only for the maven process). The problem is we generate and compile a large number of classes, and the plugin is using javac which isn't very efficient memory wise. When I get a chance, I'll update the plugin to optionally support the eclipse compiler. -dain On Jun 11, 2008, at 5:36 AM, Mohammad Nour El-Din wrote: I don't unserstand why we should increase the Java Heap size ? On Wed, Jun 11, 2008 at 10:39 AM, [EMAIL PROTECTED] wrote: Hi -dain the last build error I mailed in, was what it said it was, increasing the JAVA heap did the trick. I successfully compiled openejb3 ... mit freundlichen Grüßen/best regards Wolfgang Schrecker Der Inhalt eines Begriffs nimmt ab, wenn sein Umfang zunimmt; wird dieser allumfassend, so muß der Inhalt ganz verloren gehen. from G. Frege: Die Grundlagen der Arithmetik S. 40 -- -- Atos Worldline Processing GmbH Hahnstrasse 25 60528 Frankfurt/Main Germany Phone: +49 69/6657-1176 mailto:[EMAIL PROTECTED] http://www.atosworldline.com Geschäftsführer: Erik Munk Koefoed Aufsichtsratsvorsitzender: Didier Dhennin Sitz der Gesellschaft: Frankfurt/Main Handelsregister: Frankfurt/Main HRB 40 417 -- Atos Worldline Processing GmbH Hahnstraße 25 60528 Frankfurt/Main Germany Phone: +49 69/6657-1176 Fax : mailto: [EMAIL PROTECTED] http://www.atosworldline.com Geschäftsführer: Erik Munk Koefoed Aufsichtsratsvorsitzender: Didier Dhennin Sitz der Gesellschaft: Frankfurt/Main Handelsregister: Frankfurt/Main HRB 40 417 * * * * * * * * L E G A LD I S C L A I M E R * * * * * * * * This e-mail is destined for the above mentioned recipient. In case you received this e-mail by accident, we would appreciate it if you could contact the sender and delete all copies stored on your computer. Please be aware that the security and confidentiality of electronic data transmitted by e-mail is not completely guaranteed and that data may be seen, copied, downloaded or changed by third persons during transmission. Atos Origin accepts no liability for the security and confidentiality of data and documents sent by e-mail. Please make sure that all important messages will be confirmed in writing by means of a telefax or a letter. * * * * * * * * L E G A LD I S C L A I M E R * * * * * * * * -- Thanks - Mohammad Nour
Re: Antwort: Re: Antwort: Re: Re: maven build of openEJB3 [Virus checked]
Thanks for clarification :) On Wed, Jun 11, 2008 at 8:57 PM, Dain Sundstrom [EMAIL PROTECTED] wrote: This would only be needed if the build fails (and it is only for the maven process). The problem is we generate and compile a large number of classes, and the plugin is using javac which isn't very efficient memory wise. When I get a chance, I'll update the plugin to optionally support the eclipse compiler. -dain On Jun 11, 2008, at 5:36 AM, Mohammad Nour El-Din wrote: I don't unserstand why we should increase the Java Heap size ? On Wed, Jun 11, 2008 at 10:39 AM, [EMAIL PROTECTED] wrote: Hi -dain the last build error I mailed in, was what it said it was, increasing the JAVA heap did the trick. I successfully compiled openejb3 ... mit freundlichen Grüßen/best regards Wolfgang Schrecker Der Inhalt eines Begriffs nimmt ab, wenn sein Umfang zunimmt; wird dieser allumfassend, so muß der Inhalt ganz verloren gehen. from G. Frege: Die Grundlagen der Arithmetik S. 40 -- -- Atos Worldline Processing GmbH Hahnstrasse 25 60528 Frankfurt/Main Germany Phone: +49 69/6657-1176 mailto:[EMAIL PROTECTED] http://www.atosworldline.com Geschäftsführer: Erik Munk Koefoed Aufsichtsratsvorsitzender: Didier Dhennin Sitz der Gesellschaft: Frankfurt/Main Handelsregister: Frankfurt/Main HRB 40 417 -- Atos Worldline Processing GmbH Hahnstraße 25 60528 Frankfurt/Main Germany Phone: +49 69/6657-1176 Fax : mailto: [EMAIL PROTECTED] http://www.atosworldline.com Geschäftsführer: Erik Munk Koefoed Aufsichtsratsvorsitzender: Didier Dhennin Sitz der Gesellschaft: Frankfurt/Main Handelsregister: Frankfurt/Main HRB 40 417 * * * * * * * * L E G A LD I S C L A I M E R * * * * * * * * This e-mail is destined for the above mentioned recipient. In case you received this e-mail by accident, we would appreciate it if you could contact the sender and delete all copies stored on your computer. Please be aware that the security and confidentiality of electronic data transmitted by e-mail is not completely guaranteed and that data may be seen, copied, downloaded or changed by third persons during transmission. Atos Origin accepts no liability for the security and confidentiality of data and documents sent by e-mail. Please make sure that all important messages will be confirmed in writing by means of a telefax or a letter. * * * * * * * * L E G A LD I S C L A I M E R * * * * * * * * -- Thanks - Mohammad Nour -- Thanks - Mohammad Nour
Re: Help with OpenEJB3 and Spring IoC
On Jun 9, 2008, at 3:53 PM, Jon Carrera wrote: I went for the naughty option for printing out the classpath and it worked from within the test case, but didn't work with the bean factory. Apparently the problem is in org.springframework.test.jpa.AbstractJpaTests which internally uses org.springframework.test.jpa.OrmXmlOverridingShadowingClassLoader (which by the way isn't a subclass of URLClassLoader, so the PrintClasspath class didn't work here) and for some reason is not able to find the required classes. I solved the problem by replacing AbstractJpaTests with org.springframework.test.AbstractTransactionalSpringContextTests. Now my tests run just fine. I also changed the factories as you suggested so that OpenEjb was initialized by spring. Hope this can be of use for others. Thanks David and keep up the great job. Many thanks to you, Jon! We definitely appreciate your time as well. I've crafted up a doc that attempts to summarize the information in this thread: http://cwiki.apache.org/OPENEJBx30/spring.html (should sync to http://openejb.apache.org/3.0/spring.html in an hour or so) I'd like to put a section in there about testing and some details about which Abstract*Tests superclasses work and which do not. We definitely know that AbstractTransactionalSpringContextTests works and AbstractJpaTests does not. Are you game for trying out the parent of AbstractTransactionalSpringContextTests and so on till it breaks so we can get that data for the doc as well? Also, do you have any small sample test case code we could possibly show? On a side note, we actually do have a much tighter integration planned. Nothing concrete, but we'd like to find a way so that spring and ejb (openejb) can be mixed more easily with things like EntityManagers declarable and referencable right there in the spring xml obviating the need for your own custom factories, etc. You interested in trying something like that out and giving feedback when we get a prototype going? We're also interested in what people think would be their dream syntax for mixing spring and ejb and other things like entitymanagers, topics, queues, etc. Definitely feel free to post mock bean definition examples -- don't worry about reality, feel free to dream, there's usually a way to do anything with enough effort. -David
Re: Eclipse Multiple Projects and Missing persistence.xml
Hi Chad, This looks like the exact same issue that Juan Manuel is facing. I'm going to try and cook up a solution for this and put up some snapshot binaries that you both can try out. I'll likely be next week before I can get to this, but hopefully it will only take a couple days to get something together. The crux of the issue is that perfectly valid approach to testing is to treat the entire classpath and all modules in it as essentially one big ear, the things like persistence units declared in other jars will still be considered part of the same application. Currently we treat every module we find as a separate application which is really not the right technique for some people. -David On Jun 10, 2008, at 1:30 PM, chadws wrote: David Blevins wrote: On Mar 30, 2008, at 8:29 PM, Chad and Doria Skinner wrote: I have a project I am working on and we have separated our business model from our business logic by placing them into different projects in eclipse. These projects are both jars that are placed in our ear file. When I try to run a test on one of our session beans in the EJB project I keep getting errors that it is missing the persistence.xml file that is in our BusinessLogic project. The code is compiling properly, but the tests will not run until I copy the persistence.xml into the EJB project. Does anyone know if having separate jars for the SessionBeans and entities is supported? I think there might be an issue with the module getting picked up if it only contains a peristence.xml and nothing else. An alternate technique to moving the persistence.xml into the BusinessLogic project is to add an empty ejb-jar.xml file to the BusinessModel project containing only ejb-jar/ That should tide you over till we can get this fixed. -David I am getting back to working on this and still have the same problem. My projects are configured as: websiteBusinessLogic - contains Entity Beans websiteEJB - contains my EJBs I have ejb-jar.xml files in the META-INF directories of both projects and my my persistence.xml file contains the following: ?xml version=1.0 encoding=UTF-8? persistence version=1.0 xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; persistence-unit name=website transaction-type=JTA jta-data-sourcejdbc/websitedb/jta-data-source non-jta-data-sourcejdbc/unmanagedWebsitedb/non-jta-data-source classus.ks.k12.topeka.website.model.Alert/class classus.ks.k12.topeka.website.model.Announcement/class classus.ks.k12.topeka.website.model.Entry/class classus.ks.k12.topeka.website.model.Job/class classus.ks.k12.topeka.website.model.Location/class classus.ks.k12.topeka.website.model.NewsEntry/class classus.ks.k12.topeka.website.model.Preference/class classus.ks.k12.topeka.website.model.Profile/class classus.ks.k12.topeka.website.model.Tag/class classus.ks.k12.topeka.website.model.TagGroup/class classus.ks.k12.topeka.website.model.TagSearch/class properties /properties /persistence-unit /persistence my jUnit test: @Before public void setup() { try { Logger.getRootLogger().setLevel(Level.DEBUG); Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY, org.apache.openejb.client.LocalInitialContextFactory); p.put(openejb.deployments.classpath.include, .*seamTest/WebsiteBusinessModel/.*); p.put(jdbc/websitedb, new://Resource? type=DataSource); p.put(jdbc/websitedb.JdbcUrl, jdbc:mysql://localhost:3306/website); p.put(jdbc/websitedb.JdbcDriver, com.mysql.jdbc.Driver); p.put(jdbc/websitedb.UserName,webuser); p.put(jdbc/websitedb.Password,webpass); p.put(jdbc/unmanagedWebsitedb, new://Resource?type=DataSource); p.put(jdbc/unmanagedWebsitedb.JdbcUrl, jdbc:mysql://localhost:3306/website); p.put(jdbc/unmanagedWebsitedb.JdbcDriver, com.mysql.jdbc.Driver); p.put(jdbc/unmanagedWebsitedb.UserName,webuser); p.put(jdbc/unmanagedWebsitedb.Password,webpass); p.put(jdbc/unmanagedWebsitedb.JtaManaged, false); p.put(jdbc/profileDB, new://Resource? type=DataSource); p.put(jdbc/profileDB.JdbcUrl, jdbc:mysql://localhost:3306/website); p.put(jdbc/profileDB.JdbcDriver, com.mysql.jdbc.Driver);