From sflaniga at redhat.com Tue Aug 14 07:27:01 2012 From: sflaniga at redhat.com (Sean Flanigan) Date: Tue, 14 Aug 2012 17:27:01 +1000 Subject: [zanata-devel] Getting Zanata to work on AS 7.x In-Reply-To: <742828ba-ab5a-41b9-bff2-45adb6e3fd41@zmail13.collab.prod.int.phx2.redhat.com> References: <742828ba-ab5a-41b9-bff2-45adb6e3fd41@zmail13.collab.prod.int.phx2.redhat.com> Message-ID: <5029FDC5.1080201@redhat.com> If anyone wants to tackle the AS 7.x upgrade, here are some updates about the situation. AS 7.1 added support for data source xml files again, which should simplify things: http://www.jaitechwriteups.blogspot.in/2012/02/jboss-as-710final-thunder-released-java.html This AS7 migration guide should still apply if we stick with Seam 2.2: https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 Note: I don't think the migration guide mentions the option of using data source xml files, so we may be able to skip or simplify some of the changes. However as a possible alternative, Seam 2.3 is in beta, which will support AS 7 natively: https://community.jboss.org/blogs/marek-novotny/2012/05/23/seam-230beta2-is-out (However, it would be nice if our AS7 upgrade didn't have to wait for Seam 2.3 GA.) On 2011-11-08 13:07, Sean Flanigan wrote: > David Mason has been trying to upgrade Hibernate so that we can take > advantage of the new MassIndexer in Hibernate Search. > > Unfortunately we'd have to modify some of EAP 5's configuration files > to make it work with a newer Hibernate, so we can't use it yet. > However, the changes have now been merged into master, with the > incompatible changes isolated in the profile "jboss7". Note that > they haven't been tested on JBoss 7, and I'm pretty sure they won't > work yet. > > Helen, perhaps you can use David's work as a base for your AS 7 > work? > > > ----- Original Message ----- >> Further to this... >> >> From my skimming of the AS7 upgrade guide, upgrading to AS7 will >> require >> upgrading at least to Hibernate 3.5. AS7.0.1 comes with Hibernate 4, >> but lets you package Hibernate 3.5+ with the application. >> >> https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide >> http://relation.to/Bloggers/UsingADifferentPersistenceProviderWithAS701 >> >> >> We can package Hibernate 3.5+ with the application if it helps, but I >> recommend we stick to Hibernate 3.3.2 APIs in the code, if possible. >> (Since Hibernate 3.3.2 is what comes with JBoss EWP 5.) >> >> Sean. >> >> On 2011-10-19 17:56, Sean Flanigan wrote: >>> Actually, it might be a good idea to ignore the standalone.xml I >>> created, and jump straight to a more scriptable way of creating the >>> datasource, using the AS7 CLI, or better still the >>> jboss-as-maven-plugin: >>> >>> https://docs.jboss.org/author/display/AS7/Management+Clients >>> https://docs.jboss.org/author/display/AS7/DataSource+configuration >>> http://planet.jboss.org/post/using_the_jboss_as_maven_plugin_to_deploy_datasources_to_as7 >>> >>> We'll need to get Maven to deploy on AS7 for local development >>> anyway. >>> >>> Sean. >>> >>> On 2011-10-19 11:34, Sean Flanigan wrote: >>>> Hi Helen, >>>> >>>> Thanks for offering to have a go at getting Zanata working on AS >>>> 7! >>>> >>>> >>>> When I last had a go at this, I: >>>> - downloaded and extracted jboss-as-7.0.2.Final.zip >>>> - copied mysql-connector-java.jar to >>>> jboss-as-7.0.2.Final/standalone/deployments >>>> - modified >>>> jboss-as-7.0.2.Final/standalone/configuration/standalone.xml >>>> to add a datasource (see attachment) >>>> - copied exploded zanata.war/ to >>>> jboss-as-7.0.2.Final/standalone/deployments >>>> - ran touch zanata.war.dodeploy (read README.txt for manual deploy >>>> mode) >>>> >>>> but it failed to deploy. It generated zanata.war.failed >>>> (attached) with >>>> an error message. >>>> >>>> I've attached my copy of standalone.xml, including the >>>> >>>> which I adapted from zanata-ds.xml. I think the datasource is >>>> /mostly/ >>>> correct, but based on the zanata.war deployment failure, the JNDI >>>> name >>>> might be wrong. >>>> >>>> This document should help: >>>> https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 >>>> . There's a section on Seam 2 applications which will probably be >>>> important. >>>> >>>> >>>> I recommend you commit to a feature branch, branched off master. >>>> That >>>> way it's easy to review the changes, and you don't have to worry >>>> about >>>> fitting into our release schedule. >>>> >>>> >>>> Thanks >>>> >>>> >>>> Sean. >>>> -- Sean Flanigan Senior Software Engineer Engineering - Internationalisation Red Hat -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 554 bytes Desc: OpenPGP digital signature URL: From sflaniga at redhat.com Mon Aug 20 07:58:48 2012 From: sflaniga at redhat.com (Sean Flanigan) Date: Mon, 20 Aug 2012 17:58:48 +1000 Subject: [zanata-devel] Getting Zanata to work on AS 7.x In-Reply-To: <5029FDC5.1080201@redhat.com> References: <742828ba-ab5a-41b9-bff2-45adb6e3fd41@zmail13.collab.prod.int.phx2.redhat.com> <5029FDC5.1080201@redhat.com> Message-ID: <5031EE38.6020606@redhat.com> Carlos and I finally managed to get zanata.war to deploy on EAP6, without using Seam 2.3. It still doesn't work, but at least it deploys! I have committed my changes to integration/master, but I had to comment out a couple of changes that are (a) incompatible with AS 5 and (b) difficult to control with Maven profiles. See the AS7 comments in jboss-web.xml and faces-config.xml. The datasource file I used is attached. You'll need to define a jboss module for mysql-connector: http://jaitechwriteups.blogspot.com.au/2012/02/jboss-as-710final-thunder-released-java.html Remaining problems: 1. JSF/RichFaces/Seam is not working properly yet. Just visit http://localhost:8080/zanata after deploying zanata.war in AS7 and you'll see that the home page has an exception. A breakpoint on MockViewHandler.getActionURL suggests that JSF didn't start properly. (At one stage it just returned the raw XHTML instead of having the exception, but I must have changed something. At least it's trying to use JSF now.) 2. We need to get zanata.properties into the classpath. This is the file that tells Zanata which authentication scheme to use (zanata.security.auth.type). Just to make it work, I dumped zanata.properties into zanata-war/src/main/resources. I haven't checked that in, because it would tie the war file to a single authentication scheme. Some better options would be: a. Create a jboss module to hold the properties file, and have zanata-war declare a dependency on that module (either through the manifest or through jboss-deployment-structure.xml). This is a lot of work for a single string though. https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath b. Inject zanata.security.auth.type as a JNDI string value. I think this would be a lot cleaner. https://community.jboss.org/message/641742#641742#641742 3. If anything goes wrong while processing Seam's components.xml, the exception isn't logged properly. It seems that the relevant Logger (org.apache.catalina.core.ContainerBase.*) has no handlers attached. I had to put a method breakpoint on org.jboss.logging.Logger.error() to work out what was going on. 4. Other logging isn't working either. It might be the slf4j bridge which is acting up, or we just don't have any log handlers for org.zanata.*. 5. NoClassDefFoundError: OperatingSystemMXBean warning during shutdown. This probably means that JavaMelody isn't shutting down cleanly. Still to do: 1. Clean up everything above. 2. Get exploded deployment working (or any automated deployment, for that matter). I think there's a Maven plugin for jboss-as we could look at, but we should probably get cargo working first. 3. Sort out JAAS security settings. I got as far as I did by adding this to JBOSS_HOME/standalone/configuration/standalone.xml: It's not terribly different from configuring application-policy elements in login-config.xml under AS 5. Sean. PS I know the Seam tests are broken. Sorry. I'm working on it. On 2012-08-14 17:27, Sean Flanigan wrote: > > If anyone wants to tackle the AS 7.x upgrade, here are some updates > about the situation. > > AS 7.1 added support for data source xml files again, which should > simplify things: > http://www.jaitechwriteups.blogspot.in/2012/02/jboss-as-710final-thunder-released-java.html > > This AS7 migration guide should still apply if we stick with Seam 2.2: > https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 > > Note: I don't think the migration guide mentions the option of using > data source xml files, so we may be able to skip or simplify some of the > changes. > > > However as a possible alternative, Seam 2.3 is in beta, which will > support AS 7 natively: > https://community.jboss.org/blogs/marek-novotny/2012/05/23/seam-230beta2-is-out > (However, it would be nice if our AS7 upgrade didn't have to wait for > Seam 2.3 GA.) > > > > > On 2011-11-08 13:07, Sean Flanigan wrote: >> David Mason has been trying to upgrade Hibernate so that we can take >> advantage of the new MassIndexer in Hibernate Search. >> >> Unfortunately we'd have to modify some of EAP 5's configuration files >> to make it work with a newer Hibernate, so we can't use it yet. >> However, the changes have now been merged into master, with the >> incompatible changes isolated in the profile "jboss7". Note that >> they haven't been tested on JBoss 7, and I'm pretty sure they won't >> work yet. >> >> Helen, perhaps you can use David's work as a base for your AS 7 >> work? >> >> >> ----- Original Message ----- >>> Further to this... >>> >>> From my skimming of the AS7 upgrade guide, upgrading to AS7 will >>> require >>> upgrading at least to Hibernate 3.5. AS7.0.1 comes with Hibernate 4, >>> but lets you package Hibernate 3.5+ with the application. >>> >>> https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide >>> http://relation.to/Bloggers/UsingADifferentPersistenceProviderWithAS701 >>> >>> >>> We can package Hibernate 3.5+ with the application if it helps, but I >>> recommend we stick to Hibernate 3.3.2 APIs in the code, if possible. >>> (Since Hibernate 3.3.2 is what comes with JBoss EWP 5.) >>> >>> Sean. >>> >>> On 2011-10-19 17:56, Sean Flanigan wrote: >>>> Actually, it might be a good idea to ignore the standalone.xml I >>>> created, and jump straight to a more scriptable way of creating the >>>> datasource, using the AS7 CLI, or better still the >>>> jboss-as-maven-plugin: >>>> >>>> https://docs.jboss.org/author/display/AS7/Management+Clients >>>> https://docs.jboss.org/author/display/AS7/DataSource+configuration >>>> http://planet.jboss.org/post/using_the_jboss_as_maven_plugin_to_deploy_datasources_to_as7 >>>> >>>> We'll need to get Maven to deploy on AS7 for local development >>>> anyway. >>>> >>>> Sean. >>>> >>>> On 2011-10-19 11:34, Sean Flanigan wrote: >>>>> Hi Helen, >>>>> >>>>> Thanks for offering to have a go at getting Zanata working on AS >>>>> 7! >>>>> >>>>> >>>>> When I last had a go at this, I: >>>>> - downloaded and extracted jboss-as-7.0.2.Final.zip >>>>> - copied mysql-connector-java.jar to >>>>> jboss-as-7.0.2.Final/standalone/deployments >>>>> - modified >>>>> jboss-as-7.0.2.Final/standalone/configuration/standalone.xml >>>>> to add a datasource (see attachment) >>>>> - copied exploded zanata.war/ to >>>>> jboss-as-7.0.2.Final/standalone/deployments >>>>> - ran touch zanata.war.dodeploy (read README.txt for manual deploy >>>>> mode) >>>>> >>>>> but it failed to deploy. It generated zanata.war.failed >>>>> (attached) with >>>>> an error message. >>>>> >>>>> I've attached my copy of standalone.xml, including the >>>>> >>>>> which I adapted from zanata-ds.xml. I think the datasource is >>>>> /mostly/ >>>>> correct, but based on the zanata.war deployment failure, the JNDI >>>>> name >>>>> might be wrong. >>>>> >>>>> This document should help: >>>>> https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 >>>>> . There's a section on Seam 2 applications which will probably be >>>>> important. >>>>> >>>>> >>>>> I recommend you commit to a feature branch, branched off master. >>>>> That >>>>> way it's easy to review the changes, and you don't have to worry >>>>> about >>>>> fitting into our release schedule. >>>>> >>>>> >>>>> Thanks >>>>> >>>>> >>>>> Sean. >>>>> -- Sean Flanigan Senior Software Engineer Engineering - Internationalisation Red Hat -------------- next part -------------- A non-text attachment was scrubbed... Name: zanata-ds.xml Type: text/xml Size: 1078 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 554 bytes Desc: OpenPGP digital signature URL: