On Nov 15, 2007 8:37 AM, Jacek Laskowski <[EMAIL PROTECTED]> wrote: > Just to let you know I'm still working on it and ended up with the > following plan with no changes to the sample application - booking. > With the plan I can easily deploy the sample, seam starts up > fine...almost. The PU the application uses is not injected, but the > duplicate class...something is not reported. Any comments greatly > appreciated.
Your silence was as helpful as verbal help that I did not receive and I do really appreciate it - I read it as "you're on your way to sort it out. keep going!" ;-) Thanks! It made me dug into the source code deeper and deeper and finally found the solution. I couldn't believe that it was a matter of creating the plan file with no other changes involved. I don't have to touch the sample either. No changes, but the plan makes Geronimo happy to deploy Seam's jee5 booking sample. Unbelievable how much you guys did in the server. Only now could I realize it. Awesome. I'm now able to run the sample when deployed with the following plan file. What's even more interesting is that I can run it with Hibernate JPA (!). Other than there's an issue I had to step over using a debugger with Ejb3Configuration changed (where it checks whether there're any jars to be processed where geronimo returns null when exclude-unlisted-classes is set to true, but hibernate expects empty list, i.e. Collections.EMPTY_LIST worked fine ;-)). I'm going to describe it very soon, but the real treasure is the plan and the supporting class - org.apache.geronimo.hibernate.transaction.GeronimoTransactionManagerLookup so Hibernate can get at Geronimo's tx manager (when openjpa's used it's not needed and it works fine too). The only change I did comparing to the previous plan was to change xa-transaction to local-transaction for jdbc/__default datasource as Seam didn't like it (don't remember what it was, but with the change it worked like a charm and didn't mean to spend more time investigating it). I think having Seam working pretty well on Geronimo makes Geronimo even more entertaining. Lots of people have asked me about it recently and am going to check whether other examples work fine as well. <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>org.jboss.seam.examples.jee5</groupId> <artifactId>jboss-seam-jee5</artifactId> <version>2.0.0.GA</version> <type>ear</type> </moduleId> <dependencies> <dependency> <groupId>org.apache.geronimo.hibernate.transaction</groupId> <artifactId>geronimo-hibernate-transaction-manager-lookup</artifactId> <type>jar</type> </dependency> </dependencies> </environment> <module> <web>jboss-seam-jee5.war</web> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>org.jboss.seam.examples.jee5</groupId> <artifactId>jboss-seam-jee5</artifactId> <version>2.0.0.GA</version> <type>war</type> </moduleId> </environment> <context-root>/seam-jee5</context-root> </web-app> </module> <module> <ejb>jboss-seam-jee5.jar</ejb> <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>org.jboss.seam.examples.jee5</groupId> <artifactId>jboss-seam-jee5</artifactId> <version>2.0.0.GA</version> <type>jar</type> </moduleId> </environment> <!-- overrides what's in the module's persistence.xml --> <persistence xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="bookingDatabase"> <!-- Hibernate JPA works fine too --> <!-- provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider --> <jta-data-source>jdbc/__default</jta-data-source> <class>org.jboss.seam.example.booking.Booking</class> <class>org.jboss.seam.example.booking.Hotel</class> <class>org.jboss.seam.example.booking.User</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="hibernate.transaction.manager_lookup_class" value="org.apache.geronimo.hibernate.transaction.GeronimoTransactionManagerLookup" /> </properties> </persistence-unit> <!-- change the way the default PU works - make it an alias to bookingDatabase PU --> <persistence-unit name="cmp"> <class>org.jboss.seam.example.booking.Booking</class> <class>org.jboss.seam.example.booking.Hotel</class> <class>org.jboss.seam.example.booking.User</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> </persistence-unit> </persistence> </openejb-jar> </module> <!-- <module> <ejb>jboss-seam.jar</ejb> <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>org.jboss.seam.examples.jee5</groupId> <artifactId>jboss-seam</artifactId> <version>2.0.0.GA</version> <type>jar</type> </moduleId> </environment> </openejb-jar> </module> --> <ext-module> <connector>seam-jee5-dbpool</connector> <external-path xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"> <dep:groupId>org.tranql</dep:groupId> <dep:artifactId>tranql-connector-derby-embed-xa</dep:artifactId> <dep:type>rar</dep:type> </external-path> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <moduleId> <groupId>org.jboss.seam.examples.jee5</groupId> <artifactId>booking-dbpool</artifactId> <version>2.0.0.GA</version> <type>rar</type> </moduleId> <dependencies> <dependency> <groupId>org.apache.geronimo.configs</groupId> <artifactId>system-database</artifactId> <type>car</type> </dependency> </dependencies> </environment> <resourceadapter> <outbound-resourceadapter> <connection-definition> <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface> <connectiondefinition-instance> <name>jdbc/__default</name> <config-property-setting name="DatabaseName">SystemDatabase</config-property-setting> <connectionmanager> <local-transaction /> <single-pool> <max-size>100</max-size> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds> <select-one-assume-match /> </single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> </outbound-resourceadapter> </resourceadapter> </connector> </ext-module> </application> Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
