RequestFactory 验证多项目设置

发布于 2024-12-09 03:26:38 字数 2668 浏览 1 评论 0原文

我尝试更改为 gwt2.4 的发行版本,但遇到了问题。我在我的设置中使用了多个项目。我有一个包含服务器端代码的项目,一个包含共享代码的项目,可以在不同的 gwt 项目中使用,还有一个将所有内容绑定在一起的 gwt 项目。我用 Maven 构建一切。我按照此处找到的注释处理说明进行操作: http://code.google.com/p/google-web-toolkit /wiki/RequestFactoryInterfaceValidation

当我编译代理和服务所在的共享项目时,会创建包含 DeobfuscatorBuilder.java 的文件夹“ generated-sources\apt\”。我将此项目的源代码作为主项目的依赖项,并尝试运行验证器,但此处未创建 DeobfuscatorBuilder.java。一切都会编译,但是当我调用 requestfactory 时,我收到错误:

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

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

问候 arne

更新:

我将其添加到我的 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>

这会解压我的依赖项的源并将它们放入我的目标文件夹中。 然后我添加:

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

到我的处理器插件中。

这样就不需要将所有项目都放在工作区中,并且应该与持续集成系统一起使用。如果没有安迪的回复,我就不会明白这一点:)

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 :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月染过的梦 2024-12-16 03:26:38

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

经过大量的试验和错误,我发现将共享项目中的源目录添加到 war 项目的处理器插件配置中是有效的......
http://code.google .com/p/android-shuffle/source/browse/shuffle-app-engine/pom.xml#269

这有点脏,但它确实有效。如果有一个不需要跨项目黑客的官方方法,我非常欢迎切换,但我还没有看到任何建议。

干杯
安迪

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文