多项目设置的请求验证 [英] Requestfactory Validation on Multi-Project Setup

查看:166
本文介绍了多项目设置的请求验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图改用gwt2.4的发行版,并遇到了问题。我在我的设置中使用多个项目。我有一个包含服务器代码的项目,一个包含共享代码的项目,可用于不同的gwt项目和一个gwt项目,它们将所有内容绑定在一起。我用maven构建一切。我遵循以下注释处理说明:
http:// code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation



当我编译我的共享项目时,代理和服务都在这里,创建了DeobfuscatorBuilder.java文件夹generated-sources \apt\。我将该项目的源代码作为我的主项目的依赖项,并尝试运行验证程序,但是此处未创建DeobfuscatorBuilder.java。所有东西都编译好了,但是当我调用requestfactory时,我得到错误:

$ p $ com.google.web.bindery.requestfactory。 server.UnexpectedException:没有操作的RequestContext ZwI9iqZS626uTt_TFwRtUwPYSOE =

我的设置有错误,但我无法找到哪里......
有人知道如何解决这个问题吗?

关注
arne



更新:



我将其添加到我的pom中:

 < plugin> 
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-dependency-plugin< / artifactId>

< executions>
<执行>
< id>解包< / id>
<阶段>初始化< /阶段>
<目标>
< goal>解包< / goal>
<! - < goal> build-classpath< / goal> - >
< /目标>
<配置>
< artifactItems>
< artifactItem>
< groupId> com.myproject.core< / groupId>
< artifactId>分享< / artifactId>
< version> $ {shared.version}< / version>
< classifier> sources< / classifier>
< overWrite> true< / overWrite>
< outputDirectory> $ {project.build.directory} /com.myproject.shared</outputDirectory>
< / artifactItem>
< / artifactItems>
< / configuration>
< /执行>
< /执行次数>
< / plugin>

这会解开我的依赖关系的源代码,并将它们放到我的目标文件夹中。
然后我加了:

 < configuration> 
< sourceDirectory> target / com.fileee.shared< / sourceDirectory>
< / configuration>

到我的处理器插件。

通过这种方式,不必在工作区中安装所有项目,并且应该使用持续集成系统。如果没有Andys回复,我不会想到这个:)

解决方案

我有同样的问题,花了几个小时在网上搜索没有任何运气的答案。如果我将处理器插件添加到共享项目中,它会生成DeobfuscatorBuilder类,但是我得到与您一样的No RequestContext异常。如果我只是在GWT战争项目中拥有processsor插件,那么根本就不会生成构建器。



通过大量的试验和错误,我发现添加源代码目录从共享项目转换为战争项目中的处理器插件配置...
http://code.google.com/p/android-shuffle/source/browse/shuffle-app-engine/pom.xml#269

这有点肮脏,但它有诀窍。如果有一种官方方法不需要跨项目hackery,那么我很乐意切换,但我还没有看到任何建议。



干杯
Andy

I tried changing to the release version of gwt2.4 and run into a problem. I use multiple projects in my setup. I have a project with serverside code, one project with shared code, that can be used in different gwt projects and a gwt project binding everything together. I build everything with maven. i followed the instructions for annotationprocessing found here: http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation

when I compile my shared project, where the proxies and services are, the folder "generated-sources\apt\" with the DeobfuscatorBuilder.java is created. I have the sources of this project as dependency of my mainproject and try to run the validator as well, but the DeobfuscatorBuilder.java is not created here. Everything compiles but when I invoke a call to the requestfactory I get the error:

com.google.web.bindery.requestfactory.server.UnexpectedException: No RequestContext for operation ZwI9iqZS626uTt_TFwRtUwPYSOE=

I guess there is an mistake in my setup, but I could't find where .. Does anybody know how to solve this problem?

Regards arne

UPDATE:

I added this to my pom:

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>

                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>unpack</goal>
                            <!-- <goal>build-classpath</goal> -->
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.myproject.core</groupId>
                                    <artifactId>shared</artifactId>
                                    <version>${shared.version}</version>
                                    <classifier>sources</classifier>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/com.myproject.shared</outputDirectory>
                                </artifactItem>
                                </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

This unpacks the sources of my dependencies and puts them into my target folder. Then I added:

            <configuration>
                <sourceDirectory>target/com.fileee.shared</sourceDirectory>
            </configuration>

to my processor-plugin.

This way it is not necessary to have all the projects in the workspace and it should work with a continous integration system. Wouldn't have figured that out without Andys reply though :)

解决方案

I had the same issue and spent hours scouring the web for an answer without any luck. If I add the processor plugin to the shared project, it generates the DeobfuscatorBuilder class, but I get the same No RequestContext exception as you. If I just have the processsor plugin on the GWT war project, the builder isn't generated at all.

With a fair amount of trial and error I found adding the source directory from the shared project into the processor plugin configuration on the war project worked... http://code.google.com/p/android-shuffle/source/browse/shuffle-app-engine/pom.xml#269

It's a bit dirty, but it does the trick. If there's an official method that doesn't require cross project hackery I'd be more than welcome to switch, but I haven't seen anything suggested yet.

Cheers Andy

这篇关于多项目设置的请求验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆