Re: Eclipse Multiple Projects and Missing persistence.xml
On Jun 18, 2008, at 11:20 PM, uglything wrote: David Blevins wrote: On Jun 18, 2008, at 12:53 AM, uglything wrote: You're the man ! Muchas gracias! Or if my suspicions are correct. Maraming salamat! If I don't get things wrong, Maraming salamat is a philippines' expression, right ? Well, I'm a spanish man in france, as Police would say. Si, es filipino. Muchos de ellos tienen nombres espanoles, entonces nunca sabes :) Tenemos un committer en el projecto con el apellido "Cabrera" y su padre es filipino, entonces sospeche que tu tambien eras. Bienvenidos en qualquier forma :) -David David Blevins wrote: I just have to not use the injection annotations in my servlets and launchers, but everything else works as expected. We definitely plan to get a Jetty integration in there that has all the same quality of service that we offer with Tomcat. It's good to know you'd be interested in that kind of functionality as it helps us prioritize. Then, for the record, I'm very interested in a Jetty integration. That could be time saving for me as I develop with Maven2 + Eclipse and Jetty is the logical choice for testing in such environment. David Blevins wrote: I also tryed a JUnit launch on both my synthetic test application and my real application and everything works. (my synthetic application is described in http://www.nabble.com/forum/ViewPost.jtp?post=17628307&framed=y this post and http://www.nabble.com/forum/ViewPost.jtp?post=17666227&framed=y this other post The naming changes for the sake of readibility, but the underlaying application is the same. ) Thanks a million again. I'm still quite new on the OpenEJB forums but I'm **truly amazed** by your quickness at adressing the problems. Thanks. Part of the secret of OpenEJB is that we try very hard to keep the code "lean" and free from needless architecture and over abstraction. It has a very direct impact on how fast we can turn things around as there is usually very little standing in our way. That seems to be a good choice... I think I 'll try to be more pragmatic my own. I realize now that I am probabily "over concepting" my applications. I'll take a thourough look at your code and try to learn some coding philosophy :working: David Blevins wrote: And very seriously, we do appreciate the questions. As well if you have any "wouldn't it be neat if..." types of ideas, definitely let us know. Small or big, we'll take em all. Dare to dream :) -David I'll sleep more then, and keep you guys posted with the outcomes :-) Thanks again ! Regards, Juan Manuel -- View this message in context: http://www.nabble.com/Eclipse-Multiple-Projects-and-Missing-persistence.xml-tp16391627p17998053.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Eclipse Multiple Projects and Missing persistence.xml
David Blevins wrote: > > > On Jun 18, 2008, at 12:53 AM, uglything wrote: > >> >> You're the man ! > > Muchas gracias! Or if my suspicions are correct. Maraming salamat! > If I don't get things wrong, Maraming salamat is a philippines' expression, right ? Well, I'm a spanish man in france, as Police would say. David Blevins wrote: > > >> I just have to not use the injection annotations in my servlets and >> launchers, >> but everything else works as expected. > > We definitely plan to get a Jetty integration in there that has all > the same quality of service that we offer with Tomcat. It's good to > know you'd be interested in that kind of functionality as it helps us > prioritize. > Then, for the record, I'm very interested in a Jetty integration. That could be time saving for me as I develop with Maven2 + Eclipse and Jetty is the logical choice for testing in such environment. David Blevins wrote: > > >> I also tryed a JUnit launch on both my synthetic test application >> and my >> real application and everything works. >> >> (my synthetic application is described in >> http://www.nabble.com/forum/ViewPost.jtp?post=17628307&framed=y this >> post >> and >> http://www.nabble.com/forum/ViewPost.jtp?post=17666227&framed=y this >> other >> post >> The naming changes for the sake of readibility, but the underlaying >> application is the same. >> ) >> >> >> Thanks a million again. I'm still quite new on the OpenEJB forums >> but I'm >> **truly amazed** by your quickness at adressing the problems. > > Thanks. Part of the secret of OpenEJB is that we try very hard to > keep the code "lean" and free from needless architecture and over > abstraction. It has a very direct impact on how fast we can turn > things around as there is usually very little standing in our way. > > That seems to be a good choice... I think I 'll try to be more pragmatic my own. I realize now that I am probabily "over concepting" my applications. I'll take a thourough look at your code and try to learn some coding philosophy :working: David Blevins wrote: > > > And very seriously, we do appreciate the questions. As well if you > have any "wouldn't it be neat if..." types of ideas, definitely let us > know. Small or big, we'll take em all. Dare to dream :) > > -David > > > I'll sleep more then, and keep you guys posted with the outcomes :-) Thanks again ! Regards, Juan Manuel -- View this message in context: http://www.nabble.com/Eclipse-Multiple-Projects-and-Missing-persistence.xml-tp16391627p17998053.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Eclipse Multiple Projects and Missing persistence.xml
On Jun 18, 2008, at 12:53 AM, uglything wrote: You're the man ! Muchas gracias! Or if my suspicions are correct. Maraming salamat! I tried your version and all works like a charm. I've launched a webapp with Maven2/Jetty6 w/o problems. Great! I just have to not use the injection annotations in my servlets and launchers, but everything else works as expected. We definitely plan to get a Jetty integration in there that has all the same quality of service that we offer with Tomcat. It's good to know you'd be interested in that kind of functionality as it helps us prioritize. I also tryed a JUnit launch on both my synthetic test application and my real application and everything works. (my synthetic application is described in http://www.nabble.com/forum/ViewPost.jtp?post=17628307&framed=y this post and http://www.nabble.com/forum/ViewPost.jtp?post=17666227&framed=y this other post The naming changes for the sake of readibility, but the underlaying application is the same. ) Thanks a million again. I'm still quite new on the OpenEJB forums but I'm **truly amazed** by your quickness at adressing the problems. Thanks. Part of the secret of OpenEJB is that we try very hard to keep the code "lean" and free from needless architecture and over abstraction. It has a very direct impact on how fast we can turn things around as there is usually very little standing in our way. And very seriously, we do appreciate the questions. As well if you have any "wouldn't it be neat if..." types of ideas, definitely let us know. Small or big, we'll take em all. Dare to dream :) -David
Re: Eclipse Multiple Projects and Missing persistence.xml
You're the man ! I tried your version and all works like a charm. I've launched a webapp with Maven2/Jetty6 w/o problems. I just have to not use the injection annotations in my servlets and launchers, but everything else works as expected. I also tryed a JUnit launch on both my synthetic test application and my real application and everything works. (my synthetic application is described in http://www.nabble.com/forum/ViewPost.jtp?post=17628307&framed=y this post and http://www.nabble.com/forum/ViewPost.jtp?post=17666227&framed=y this other post The naming changes for the sake of readibility, but the underlaying application is the same. ) Thanks a million again. I'm still quite new on the OpenEJB forums but I'm **truly amazed** by your quickness at adressing the problems. Regards, Juan Manuel -- View this message in context: http://www.nabble.com/Eclipse-Multiple-Projects-and-Missing-persistence.xml-tp16391627p17961537.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Eclipse Multiple Projects and Missing persistence.xml
On Jun 11, 2008, at 5:57 PM, David Blevins wrote: 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. [...] I'm going to try and cook up a solution for this and put up some snapshot binaries that you both can try out. Ok. I've put something together here and created an example for it. http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/ear-testing/ To try it out in your modules update your openejb version to 3.1- SNAPSHOT. This will come out in 3.0.1, just we're running 3.1 on trunk at the moment. Then add openejb.deployments.classpath.ear=true this to your startup options as in: Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory"); p.put("openejb.deployments.classpath.ear", "true"); // <- new option Context context = new InitialContext(p); One thing that has yet to be fixed is that you still need an ejb- jar.xml (or web.xml, etc.) next to your persistence.xml in order for it to get picked up. Will get that fixed as well. Anyway, let us know if it works out. -David
Re: Eclipse Multiple Projects and Missing persistence.xml
Hi people. I indeed faced the same problem--> http://www.nabble.com/Sharing-persistence-unit-among-several-ejb-jars-in-a-collapsed-EAR-to17628307.html I had a main project containing my application, and a dependent project containing entities that were to be managed by a persistence unit declared in the main project. Using the JUnit test Eclipse facilities led me to your problem, namely the persistence unit is deployed only for the main project, not for the depending project. But my application worked fine when I packaged it as a war and dropped it to a openEJB enabled Tomcat. This got rid of the classpath problem David points at. I suggest you try the same just to ensure that everything else works correctly. Anyway, David I'm looking forward to test your new OpenEJB build ! Regards, Juan Manuel -- View this message in context: http://www.nabble.com/Eclipse-Multiple-Projects-and-Missing-persistence.xml-tp16391627p17793566.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Eclipse Multiple Projects and Missing persistence.xml
ger: Missing required persistence.xml for @PersistenceContext ref "entityManager" to unit "website" ERROR - FAIL ... AnnouncementManager: Missing required persistence.xml for @PersistenceContext ref "entityManager" to unit "website" ERROR - FAIL ... TagSearchManager: Missing required persistence.xml for @PersistenceContext ref "entityManager" to unit "website" ERROR - Invalid EjbModule(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/ WebsiteEJB/build/classes) INFO - Set the 'openejb.validation.output.level' system property to VERBOSE for increased validation details. WARN - Jar not loaded. /home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteEJB/build/ classes. Module failed validation. AppModule(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/ WebsiteEJB/build/classes) WARN - Property "BulkPassivate" not supported by "myStatelessContainer" INFO - Assembling app: /home/cskinne1/.eclipse/europa/workspaces/seamTest/ WebsiteBusinessModel/build/classes INFO - PersistenceUnit(name=website, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) ERROR - JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent. See http://openejb.apache.org/3.0/javaagent.html INFO - Deployed Application(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/ WebsiteBusinessModel/build/classes) INFO - Assembling app: /home/cskinne1/.m2/repository/org/jboss/seam/jboss-seam/2.0.1.GA/ jboss-seam-2.0.1.GA.jar INFO - Jndi(name=TimerServiceDispatcherLocal) --> Ejb(deployment-id=TimerServiceDispatcher) INFO - Jndi(name=EjbSynchronizationsLocal) --> Ejb(deployment-id=EjbSynchronizations) INFO - Created Ejb(deployment-id=TimerServiceDispatcher, ejb-name=TimerServiceDispatcher, container=myStatelessContainer) INFO - Created Ejb(deployment-id=EjbSynchronizations, ejb-name=EjbSynchronizations, container=myStatefulContainer) INFO - Deployed Application(path=/home/cskinne1/.m2/repository/org/jboss/seam/jboss- seam/2.0.1.GA/jboss-seam-2.0.1.GA.jar) If I set the system property - Dopenejb.validation.output.level=VERBOSE I get a series of the following error (one per entity). ERROR - FAIL ... JobManager:A persistence unit must be defined via META-INF/persistence.xml to satisfy @PersistenceContext ref "entityManager" to unit "website". An example of a suitable persistence.xml might be:http://java.sun.com/xml/ns/persistence"; version="1.0">name="website">java:openejb/Resource/myDataSourcejta-data-source>java:openejb/Resource/ myUnmanagedDataSource name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>unit> One of the things that concerns me is the error: WARN - Jar not loaded. /home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteEJB/build/ classes. Module failed validation. AppModule(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/ WebsiteEJB/build/classes) Does anyone know what I am missing so that I can get this to load my entities from one jar and the session beans from a seperate jar. I don't understand why my jar would not validate and the error does not tell me. Are there any other flags that I can set to figure out why the jar is not being loaded? Also, do I need to put anything in my ejb-jar.xml file to register the local interfaces for my beans (at this point I don't have any remote beans). -- View this message in context: http://www.nabble.com/Eclipse-Multiple-Projects-and-Missing-persistence.xml-tp16391627p17764028.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Eclipse Multiple Projects and Missing persistence.xml
.output.level' system property to VERBOSE for increased validation details. WARN - Jar not loaded. /home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteEJB/build/classes. Module failed validation. AppModule(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteEJB/build/classes) WARN - Property "BulkPassivate" not supported by "myStatelessContainer" INFO - Assembling app: /home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteBusinessModel/build/classes INFO - PersistenceUnit(name=website, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) ERROR - JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent. See http://openejb.apache.org/3.0/javaagent.html INFO - Deployed Application(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteBusinessModel/build/classes) INFO - Assembling app: /home/cskinne1/.m2/repository/org/jboss/seam/jboss-seam/2.0.1.GA/jboss-seam-2.0.1.GA.jar INFO - Jndi(name=TimerServiceDispatcherLocal) --> Ejb(deployment-id=TimerServiceDispatcher) INFO - Jndi(name=EjbSynchronizationsLocal) --> Ejb(deployment-id=EjbSynchronizations) INFO - Created Ejb(deployment-id=TimerServiceDispatcher, ejb-name=TimerServiceDispatcher, container=myStatelessContainer) INFO - Created Ejb(deployment-id=EjbSynchronizations, ejb-name=EjbSynchronizations, container=myStatefulContainer) INFO - Deployed Application(path=/home/cskinne1/.m2/repository/org/jboss/seam/jboss-seam/2.0.1.GA/jboss-seam-2.0.1.GA.jar) If I set the system property -Dopenejb.validation.output.level=VERBOSE I get a series of the following error (one per entity). ERROR - FAIL ... JobManager:A persistence unit must be defined via META-INF/persistence.xml to satisfy @PersistenceContext ref "entityManager" to unit "website". An example of a suitable persistence.xml might be:http://java.sun.com/xml/ns/persistence"; version="1.0">java:openejb/Resource/myDataSourcejava:openejb/Resource/myUnmanagedDataSource One of the things that concerns me is the error: WARN - Jar not loaded. /home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteEJB/build/classes. Module failed validation. AppModule(path=/home/cskinne1/.eclipse/europa/workspaces/seamTest/WebsiteEJB/build/classes) Does anyone know what I am missing so that I can get this to load my entities from one jar and the session beans from a seperate jar. I don't understand why my jar would not validate and the error does not tell me. Are there any other flags that I can set to figure out why the jar is not being loaded? Also, do I need to put anything in my ejb-jar.xml file to register the local interfaces for my beans (at this point I don't have any remote beans). -- View this message in context: http://www.nabble.com/Eclipse-Multiple-Projects-and-Missing-persistence.xml-tp16391627p17764028.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Eclipse Multiple Projects and Missing persistence.xml
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 "" That should tide you over till we can get this fixed. -David
Eclipse Multiple Projects and Missing persistence.xml
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? Thanks, -- Chad