Hello
Thanks for trying to help me !

One of my tries is : compile the "maven-googlewebtoolkit2-sample"
    using gwt-maven-plugin
    it was a three modules project war rpc and server
    I reduced it to war server , by merging rpc and server

    I join the pom and web.xml of the war


mvn package report

ERROR] Failed to execute goal 
org.codehaus.mojo:gwt-maven-plugin:2.1.0-1:mergewebxml (default) on project 
maven-googlewebtoolkit2-sample-war: Unable to merge web.xml: 
NullPointerException -> [Help 1]






  ----- Original Message ----- 
  From: Andreas Horst 
  To: [email protected] 
  Sent: Wednesday, December 22, 2010 12:26 AM
  Subject: Re: Modular rpc blues


  Another question just coming to my mind:


  Where in the inherited module are you declaring the RPC servlet?


  If you declare it in the inherited module's web.xml then make sure the Maven 
GWT plugin parameter "webXml" properly points to it (Not sure how one would do 
this - never did it myself - especially since  inherited modules usually come 
as a .jar. If so does yours include the web.xml?).


  If you declare it in the inherited module's module descriptor (a.k.a. 
*.gwt.xml) all should be fine. Hence I assume you do not declare it there? Look 
here for details about the module descriptor, note the <servlet> tag.


  My 2cents: Use the second option.


  Why? Because obviously your inherited module realizes functionality that is 
to be reused. It is hence some sort of library and not (only?) an application 
or even a .war packed web application. All our inherited modules are _library_ 
modules, they don't get deployed on an _application_ server on their own. Now 
if one of those features functionality through RPC (we have some of those) we 
thankfully use the above mentioned <servlet> tag in the module descriptor and 
let the Maven GWT plugin do its job. IMHO on the one hand a web.xml does not 
belong into a common not "runnable" module and on the other one a (.war packed) 
application is not best suitable for inheriting functionality.


  Regards


  2010/12/21 Andreas Horst <[email protected]>




    2010/12/21 Thomas Broyer <[email protected]>




      On Tuesday, December 21, 2010 9:51:38 AM UTC+1, coelho wrote:
        Hello

        What seems to me great in GWT is that it's easy to build
            client code and server code that can communicate through GWT-RPC.

        What 's great too is that you can write modules
            and your webapp can use those modules.

        Then why is it so complicated ( is it possible ? ) to have a module 
with GWT-RPC code
                    ( implementation and interfaces )
                    that could be used in a webapp


      And by "so complicated" you mean adding half a dozen lines to your 
web.xml file, right?



    Actually the goal gwt:mergewebxml is really ALL you need (believe me, we 
use it just like that for exactly what you are trying to). Please clarify what 
you mean with "web.xml refers to external module". I assume either your web.xml 
gets or already is troubled or your POM is not configured properly.

        I tried many things in eclipse
        I tried many things with maven
            ( gwt-maven-plugin : goal mergewebxml ) fails when web.xml refers 
to external module

        still no success !


      Have a look at the cargo maven plugin (I haven't tried it though)


        I wondered if there is such a project already done

        Is there somewhere a jar , ready made , with GWT-RPC included that I 
could use as a reference ?

        or is hopeless ?


      I believe that's what web-fragments in Servlets 3.0 are meant to solve:
      
http://java.sun.com/developer/technicalArticles/JavaEE/JavaEE6Overview_Part2.html#webfrags



      -- 
      You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
      To post to this group, send email to [email protected].
      To unsubscribe from this group, send email to 
[email protected].
      For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



  -- 
  Andreas Horst
  Schwicheldtstraße 23, 38704 Liebenburg
  Tel. +49 (0)170 4162251, mailto:[email protected]


  -- 
  You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
  To post to this group, send email to [email protected].
  To unsubscribe from this group, send email to 
[email protected].
  For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


------------------------------------------------------------------------------

------------------------------------------------------------------------------

  Aucun virus trouvé dans ce message.
  Analyse effectuée par AVG - www.avg.fr
  Version: 10.0.1170 / Base de données virale: 426/3328 - Date: 20/12/2010

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd"; >

<web-app>
	<display-name>Archetype Created Web Application</display-name>
	
	<!--
	<servlet>
		<servlet-name>HttpServlet</servlet-name>
		<servlet-class>com.totsp.mavenplugin.gwt.sample.server.HttpServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>HttpServlet</servlet-name>
		<url-pattern>/HttpServlet</url-pattern>
	</servlet-mapping>
	-->
	
	<servlet>
		<servlet-name>TstServlet</servlet-name>
		<servlet-class>com.totsp.mavenplugin.gwt.sample.server.BidonServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>TstServlet</servlet-name>
		<url-pattern>/BidonServlet</url-pattern>
	</servlet-mapping>
	
	
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<project>
	<parent>
		<artifactId>maven-googlewebtoolkit2-sample</artifactId>
		<groupId>com.totsp.gwt</groupId>
		<version>1.0-SNAPSHOT</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>maven-googlewebtoolkit2-sample-war</artifactId>
	<packaging>war</packaging>
	<name>maven-googlewebtoolkit2-sample-war</name>	
	
	<dependencies> 
        <dependency>
            <groupId>com.totsp.gwt</groupId>
            <artifactId>maven-googlewebtoolkit2-sample-server</artifactId>
        </dependency>
        
        <!--  GWT deps -->
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwtVersion}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
            <scope>provided</scope>
        </dependency>
	
	<dependency>
		<groupId>com.google.gwt</groupId>
		<artifactId>gwt-dev</artifactId>
		<version>${gwtVersion}</version>
		<scope>provided</scope>
	</dependency>
	<!--
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
            <classifier>${platform}-libs</classifier>
            <type>zip</type>
            <scope>provided</scope>
        </dependency>       
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
            <classifier>${platform}</classifier>
            <scope>provided</scope>
        </dependency>
	-->

    </dependencies> 
	
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>
			<!-- All the fantastical settings that GWT needs -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>2.1.0-1</version>
				<!--
				<version>1.3-SNAPSHOT</version>
				-->
				<!--
				<groupId>com.totsp.gwt</groupId>
				<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
				<version>2.0-RC1</version>
				-->
				<configuration>					
					<logLevel>INFO</logLevel>
					<compileTargets>
						<value>com.totsp.mavenplugin.gwt.sample.Application</value>
					</compileTargets>
					<runTarget>com.totsp.mavenplugin.gwt.sample.Application/Application.html</runTarget>					
					<!-- use style OBF for prod -->
					<style>DETAILED</style>					
					<noServer>false</noServer>
					<extraJvmArgs>-Xmx512m</extraJvmArgs>
					<!--  this parameter is VERY important with automatic mode - has to match the version in your declared deps -->
					<!--  if this is set incorrect, or left out and default does not match (default is 1.5.3 for 2.0-RC1) you will have mysterious errors -->
					<gwtVersion>${gwtVersion}</gwtVersion>
				</configuration>
				<executions>
					<execution>
						<goals>							
							<!-- plugin goals -->
							<goal>mergewebxml</goal>
							<goal>compile</goal>
							<!--
							<goal>gwt</goal>
							-->
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
                    			<webXml>target/web.xml</webXml>
                		</configuration>
			</plugin>
			<!--
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>compile</phase>
						<goals>
							
							    <goal>copy</goal>
						    </goals>
						    <configuration>
							    <artifactItems>
								    <artifactItem>
									    <groupId>com.google.gwt</groupId>
									    <artifactId>gwt-dev</artifactId>
									    <version>${gwtVersion}</version>
										<type>jar</type>
										<overWrite>false</overWrite>
										<outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
									</artifactItem>
								</artifactItems>
							</configuration>
						</execution>
					</executions>
			</plugin>
			-->
			<!--
			<plugin>
                		<groupId>org.apache.maven.plugins</groupId>
                		<artifactId>maven-dependency-plugin</artifactId>
                		<executions>
                    			<execution>
                        			<id>unpack</id>
                        			<phase>compile</phase>
                        			<goals>
                            				<goal>unpack</goal>
                        			</goals>
                        			<configuration>
                            				<artifactItems>
                                				<artifactItem>
                                    					<groupId>com.google.gwt</groupId>
                                    					<artifactId>gwt-dev</artifactId>
                                    					<version>${gwtVersion}</version>
                                    					<classifier>${platform}-libs</classifier>
                                    					<type>zip</type>
                                    					<overWrite>true</overWrite>
                                    					<outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
                                				</artifactItem>
                            				</artifactItems>
                        			</configuration>
                    			</execution>
                		</executions>
            		</plugin>
			-->
		</plugins>
	</build>
	
	<!--  standard Maven reporting done here -->
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>
					maven-project-info-reports-plugin
				</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>dependencies</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<!--  the Maven Surefire Report plugin has a bug where it re-runs the tests, 
				this is needed to avoid that  - http://jira.codehaus.org/browse/SUREFIRE-257 -->
				<reportSets>
					<reportSet>
						<reports>
							<report>report-only</report>
						</reports>
					</reportSet>
				</reportSets>				
			</plugin>
		</plugins>
	</reporting>	
	
<!--  profiles (with activation per platform) 
    <profiles>
        <profile>
            <id>gwt-dev-windows</id>
            <properties>
                <platform>windows</platform>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
                <os>
                    <family>windows</family>
                </os>
            </activation>
        </profile>
        <profile>
            <id>gwt-dev-mac</id>
            <properties>
                <platform>mac</platform>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
                <os>
                    <family>mac</family>
                </os>
            </activation>
        </profile>
        <profile>
            <id>gwt-dev-linux</id>
            <properties>
                <platform>linux</platform>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
                <os>
                    <name>linux</name>
                </os>
            </activation>           
        </profile>
    </profiles>
-->
</project>

Reply via email to