OK, well, I don't know if this will work in JBoss Web, but here it is
anyways. This shows how you can create an EAR from some web modules, a JPA
module and a library (shared between all three classloaders). Note that the
plugin configuration defines the order that the modules are loaded, which is
why the spa module is first.

Derek

On Thu, Sep 17, 2009 at 2:24 PM, Charles F. Munat <c...@munat.com> wrote:

>
> It's not the AS, it's the souped-up Tomcat (JBoss Web). All their
> examples are WARs. But sure, send an EAR along, Mr. Van Gogh.
>
> Chas.
>
> Derek Chen-Becker wrote:
> > Also, if you're loading this up in JBoss, it might make more sense to
> > bundle the artifacts into an EAR, unless you intend for the two web
> > modules to have completely separate persistence units (e.g. different
> > DBs, etc). Maven has a nice plugin for doing EARs. I can send a sample
> > pom.xml if you'd like.
> >
> > Derek
> >
> > On Thu, Sep 17, 2009 at 1:01 PM, Derek Chen-Becker
> > <dchenbec...@gmail.com <mailto:dchenbec...@gmail.com>> wrote:
> >
> >     JBoss includes its own JTA libs, so you need to set the scope to
> >     exclude the other ones or else they'll conflict. Generally with any
> >     JEE container you would need to do that, since JTA is part of the
> >     spec. What exactly do you mean by "the objects are created, but none
> >     of the properties are saved"? Is an insert occurring but no fields
> >     are saved? If it's transaction related it's almost always a binary
> >     outcome (works/doesn't work), not something in between, although
> >     I've seen enough oddities to know that there are always exceptions :P
> >
> >     Derek
> >
> >
> >     On Thu, Sep 17, 2009 at 12:03 PM, Charles F. Munat <c...@munat.com
> >     <mailto:c...@munat.com>> wrote:
> >
> >
> >         Actually, I figured that out. They're included. But I have a
> >         different
> >         problem now -- one that you might know the answer to.
> >
> >         I'm loading this war file up in JBossWeb (basically a hopped-up
> >         Tomcat)
> >         and when I try to use it, I get a problem with transactions. I
> >         assume
> >         this is something in the JBossWeb server, since I have nothing in
> my
> >         code to cause that. Something on the server wants that jta.jar
> >         in there.
> >
> >         So I tried commenting out the javax.transaction exclusion in the
> >         pom.xml
> >         file for the "spa" project, and that added the jta jar to the
> >         lib, as
> >         expected. That also solved the problem with the server.
> >
> >         But now when I merge objects to the database, the objects are
> >         created,
> >         but none of the properties are saved. It's very strange. I am
> >         wondering
> >         if this is a transaction issue.
> >
> >         And just out of curiosity, why is the javax.transaction exclusion
> in
> >         there? I've often wondered about that.
> >
> >         Chas.
> >
> >         Derek Chen-Becker wrote:
> >          > Are you sure that they're not getting included (e.g. not
> >         actually in the
> >          > WAR file), or that they're not activated? If your dependency
> >         (in the web
> >          > modules) on the spa module is default scope, then it should
> >         be including
> >          > them.
> >          >
> >          > Derek
> >          >
> >          > On Wed, Sep 16, 2009 at 10:32 PM, Charles F. Munat
> >         <c...@munat.com <mailto:c...@munat.com>
> >          > <mailto:c...@munat.com <mailto:c...@munat.com>>> wrote:
> >          >
> >          >
> >          >     I have a Lift project with a JPA backend subproject, and
> >         then two Lift
> >          >     front ends that access the same back end, also as
> >         subprojects.
> >          >
> >          >     So my master pom.xml looks like this:
> >          >
> >          >       <modules>
> >          >         <module>web</module>
> >          >         <module>web2</module>
> >          >         <module>spa</module>
> >          >       </modules>
> >          >
> >          >     Works beautifully. Web responds on one port and Web2 on
> >         another (when I
> >          >     use the internal Jetty).
> >          >
> >          >     But when I do mvn package and put the war on the server,
> >         somehow the
> >          >     "spa" backend classes do not get included.
> >          >
> >          >     Any idea what I'm doing wrong?
> >          >
> >          >     Chas.
> >          >
> >          >
> >          >
> >          >
> >          > >
> >
> >
> >
> >
> >
> > >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

<?xml version="1.0"?><project>
  <parent>
    <groupId>com.foo</groupId>
    <artifactId>Master</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>EAR-Build</artifactId>
  <name>EAR-Build</name>
  <packaging>ear</packaging>

  <dependencies>
    <dependency>
      <groupId>${pom.groupId}</groupId>
      <artifactId>web</artifactId>
      <version>${pom.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>${pom.groupId}</groupId>
      <artifactId>web2</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>${pom.groupId}</groupId>
      <artifactId>spa</artifactId>
      <version>${pom.version}</version>
      <type>ejb</type>
    </dependency>
    <dependency>
    	<groupId>joda-time</groupId>
    	<artifactId>joda-time</artifactId>
    	<version>1.6</version>
    </dependency>   
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
           <modules>
             <ejbModule>
               <groupId>${pom.groupId}</groupId>
               <artifactId>spa</artifactId>
             </ejbModule>
             <webModule>
               <groupId>${pom.groupId}</groupId>
               <artifactId>web</artifactId>             
               <contextRoot>/web</contextRoot>
             </ejbModule>             
             <webModule>
               <groupId>${pom.groupId}</groupId>
               <artifactId>web2</artifactId>
               <contextRoot>/completelydifferent</contextRoot>
             </webModule>
             <jarModule>
               <groupId>joda-time</groupId>
               <artifactId>joda-time</artifactId>
               <bundleDir>lib</bundleDir>
             </jarModule>      
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>  
</project>

Reply via email to